com.splunk
Class InputCollection

java.lang.Object
  extended by com.splunk.Resource
      extended by com.splunk.ResourceCollection<T>
          extended by com.splunk.EntityCollection<Input>
              extended by com.splunk.InputCollection
All Implemented Interfaces:
java.util.Map<java.lang.String,Input>

public class InputCollection
extends EntityCollection<Input>

The InputCollection class represents a collection of inputs. The collection is heterogeneous and each member contains an InputKind value that indicates the specific type of input.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
protected  java.util.Set<InputKind> inputKinds
           
 
Fields inherited from class com.splunk.ResourceCollection
itemClass, items
 
Fields inherited from class com.splunk.Resource
actions, path, refreshArgs, service, title
 
Method Summary
 boolean containsKey(java.lang.Object key)
          
 Input create(java.lang.String name)
          Creates a stub for a new data input.
<T extends Input>
T
create(java.lang.String name, InputKind kind)
          Creates a new data input based on the input kind.
<T extends Input>
T
create(java.lang.String name, InputKind kind, java.util.Map<java.lang.String,java.lang.Object> args)
          Creates a new data input based on the input kind and additional arguments.
 Input create(java.lang.String name, java.util.Map args)
          Creates a stub for a new data input based on additional arguments.
protected  Input createItem(AtomEntry entry)
          Creates a new data input based on an Atom entry.
 Input get(java.lang.Object key)
          Gets the value of a given key, if it exists within this collection.
 Input get(java.lang.Object key, Args namespace)
          Returns the value of a scoped, namespace-constrained key, if it exists within this collection.
 java.util.Set<InputKind> getInputKinds()
          Return a set of all the input kinds recognized by the Splunk server.
protected  InputKind itemKind(java.lang.String path)
          Returns the input kind for a given path.
protected static boolean matchesInputName(InputKind kind, java.lang.String searchFor, java.lang.String searchIn)
          Indicates whether a given string matches the input name (string equality).
 InputCollection refresh()
          Refreshes this input collection.
 Input remove(java.lang.String key)
          Removes an entity from this collection.
 Input remove(java.lang.String key, Args namespace)
          Removes an entity from this collection, with a namespace restriction.
 
Methods inherited from class com.splunk.ResourceCollection
clear, containsKey, containsValue, createItem, entrySet, equals, hashCode, isEmpty, itemKey, itemPath, keySet, list, put, putAll, remove, size, validate, values, valueSize
 
Methods inherited from class com.splunk.Resource
getName, getPath, getService, getTitle, invalidate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputKinds

protected java.util.Set<InputKind> inputKinds
Method Detail

containsKey

public boolean containsKey(java.lang.Object key)

Specified by:
containsKey in interface java.util.Map<java.lang.String,Input>
Overrides:
containsKey in class ResourceCollection<Input>

create

public Input create(java.lang.String name)
Creates a stub for a new data input.

Overrides:
create in class EntityCollection<Input>
Parameters:
name - Depending on the type of input, a string that contains:
  • The filename or directory and path (for monitor and oneshot inputs)
  • The script name (for script inputs)
  • The port number (for TCP and UDP inputs)
  • The collection name (for Windows Perfmon and WMI inputs)
  • The stanza (for Windows Registry inputs)
  • The name of the configuration (for Windows AD inputs)
Returns:
No return value.
Throws:
java.lang.UnsupportedOperationException

create

public Input create(java.lang.String name,
                    java.util.Map args)
Creates a stub for a new data input based on additional arguments.

Overrides:
create in class EntityCollection<Input>
Parameters:
name - Depending on the type of data input, a string that contains:
  • The filename or directory and path (for monitor and oneshot inputs)
  • The script name (for script inputs)
  • The port number (for TCP and UDP inputs)
  • The collection name (for Windows Perfmon and WMI inputs)
  • The stanza (for Windows Registry inputs)
  • The name of the configuration (for Windows AD inputs)
args - Optional arguments to define the data input. For a list of the available parameters, see Input parameters on dev.splunk.com.
Returns:
No return value.
Throws:
java.lang.UnsupportedOperationException

create

public <T extends Input> T create(java.lang.String name,
                                  InputKind kind)
Creates a new data input based on the input kind.

Type Parameters:
T - The implicit type of the input.
Parameters:
name - Depending on the type of data input, a string that contains:
  • The filename or directory and path (for monitor and oneshot inputs)
  • The script name (for script inputs)
  • The port number (for TCP and UDP inputs)
  • The collection name (for Windows Perfmon and WMI inputs)
  • The stanza (for Windows Registry inputs)
  • The name of the configuration (for Windows AD inputs)
kind - A member of InputKind, indicating the type of input.
Returns:
The Input that was created.

create

public <T extends Input> T create(java.lang.String name,
                                  InputKind kind,
                                  java.util.Map<java.lang.String,java.lang.Object> args)
Creates a new data input based on the input kind and additional arguments.

Type Parameters:
T - The implicit type of the input.
Parameters:
name - Depending on the type of data input, a string that contains:
  • The filename or directory and path (for monitor and oneshot inputs)
  • The script name (for script inputs)
  • The port number (for TCP and UDP inputs)
  • The collection name (for Windows Perfmon and WMI inputs)
  • The stanza (for Windows Registry inputs)
  • The name of the configuration (for Windows AD inputs)
kind - A member of InputKind, indicating the type of input.
args - Optional arguments to define the data input. For a list of the available parameters, see Input parameters on dev.splunk.com.
Returns:
The Input that was created.

createItem

protected Input createItem(AtomEntry entry)
Creates a new data input based on an Atom entry.

Overrides:
createItem in class ResourceCollection<Input>
Parameters:
entry - The AtomEntry object describing the entry.
Returns:
The Input that was created.

get

public Input get(java.lang.Object key)
Gets the value of a given key, if it exists within this collection.

Specified by:
get in interface java.util.Map<java.lang.String,Input>
Overrides:
get in class ResourceCollection<Input>
Parameters:
key - The key to look up.
Returns:
The value indexed by the key, or null if it doesn't exist.

get

public Input get(java.lang.Object key,
                 Args namespace)
Returns the value of a scoped, namespace-constrained key, if it exists within this collection.

Overrides:
get in class ResourceCollection<Input>
Parameters:
key - The key to look up.
namespace - The namespace to constrain the search to.
Returns:
The value indexed by the key, or null if it doesn't exist.

itemKind

protected InputKind itemKind(java.lang.String path)
Returns the input kind for a given path.

Parameters:
path - The relative endpoint path (the path that follows data/inputs).
Returns:
A member of InputKind, indicating the type of input.

getInputKinds

public java.util.Set<InputKind> getInputKinds()
Return a set of all the input kinds recognized by the Splunk server.

Returns:
A set of InputKinds.

matchesInputName

protected static boolean matchesInputName(InputKind kind,
                                          java.lang.String searchFor,
                                          java.lang.String searchIn)
Indicates whether a given string matches the input name (string equality). For scripted inputs, which are listed by their full path, this method compares only the final component of the filename for a match.

Parameters:
kind - A member of InputKind, indicating the type of input.
searchFor - A string to search for.
searchIn - The string that contains the input name.
Returns:
true if the string matches the input name, false if not.

refresh

public InputCollection refresh()
Refreshes this input collection.

Overrides:
refresh in class ResourceCollection<Input>
Returns:
The refreshed InputCollection.

remove

public Input remove(java.lang.String key)
Removes an entity from this collection.

Overrides:
remove in class EntityCollection<Input>
Parameters:
key - The name of the entity to remove.
Returns:
The collection.

remove

public Input remove(java.lang.String key,
                    Args namespace)
Removes an entity from this collection, with a namespace restriction.

Overrides:
remove in class EntityCollection<Input>
Parameters:
key - The name of the entity to remove.
namespace - The namespace restriction within the collection.
Returns:
This collection.