com.splunk
Class EntityCollection<T extends Entity>

java.lang.Object
  extended by com.splunk.Resource
      extended by com.splunk.ResourceCollection<T>
          extended by com.splunk.EntityCollection<T>
Type Parameters:
T - The type of members in the collection.
All Implemented Interfaces:
java.util.Map<java.lang.String,T>
Direct Known Subclasses:
DataModelCollection, EventTypeCollection, FiredAlertGroupCollection, IndexCollection, InputCollection, JobCollection, LicensePoolCollection, MessageCollection, PasswordCollection, SavedSearchCollection, UserCollection

public class EntityCollection<T extends Entity>
extends ResourceCollection<T>

The EntityCollection class represents a collection of Splunk entities.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 T create(java.lang.String name)
          Creates an entity in this collection.
 T create(java.lang.String name, java.util.Map args)
          Creates an entity in this collection.
 T remove(java.lang.String key)
          Removes an entity from this collection.
 T 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, containsKey, containsValue, entrySet, equals, get, get, hashCode, isEmpty, keySet, list, put, putAll, refresh, remove, size, validate, values, valueSize
 
Methods inherited from class com.splunk.Resource
getName, getPath, getService, getTitle, invalidate
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public T create(java.lang.String name)
Creates an entity in this collection.

Parameters:
name - The name of the entity.
Returns:
The entity.

create

public T create(java.lang.String name,
                java.util.Map args)
Creates an entity in this collection.

Parameters:
name - The name of the entity.
args - Arguments for creating the entity.
Returns:
The entity.

remove

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

Parameters:
key - The name of the entity to remove.
Returns:
The collection.
Throws:
SplunkException - The exception "AMBIGUOUS" if the collection contains more than one entity with the specified key. Disambiguation is done through a similar method, remove(Object key, HashMap<String,String>namespace, which uses the namespace to perform the disambiguation.

remove

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

Parameters:
key - The name of the entity to remove.
namespace - The namespace restriction within the collection.
Returns:
This collection.