org.opends.server.admin.server
Class ServerManagedObject<S extends Configuration>

java.lang.Object
  extended by org.opends.server.admin.server.ServerManagedObject<S>
Type Parameters:
S - The type of server configuration represented by the server managed object.
All Implemented Interfaces:
PropertyProvider

public final class ServerManagedObject<S extends Configuration>
extends java.lang.Object
implements PropertyProvider

A server-side managed object.


Field Summary
 
Fields inherited from interface org.opends.server.admin.PropertyProvider
DEFAULT_PROVIDER
 
Method Summary
<M extends Configuration>
void
deregisterAddListener(InstantiableRelationDefinition<?,M> d, ConfigurationAddListener<M> listener)
          Deregisters an existing configuration add listener.
<M extends Configuration>
void
deregisterAddListener(InstantiableRelationDefinition<?,M> d, ServerManagedObjectAddListener<M> listener)
          Deregisters an existing server managed object add listener.
<M extends Configuration>
void
deregisterAddListener(OptionalRelationDefinition<?,M> d, ConfigurationAddListener<M> listener)
          Deregisters an existing configuration add listener.
<M extends Configuration>
void
deregisterAddListener(OptionalRelationDefinition<?,M> d, ServerManagedObjectAddListener<M> listener)
          Deregisters an existing server managed object add listener.
 void deregisterChangeListener(ConfigurationChangeListener<? super S> listener)
          Deregisters an existing configuration change listener.
 void deregisterChangeListener(ServerManagedObjectChangeListener<? super S> listener)
          Deregisters an existing server managed object change listener.
<M extends Configuration>
void
deregisterDeleteListener(InstantiableRelationDefinition<?,M> d, ConfigurationDeleteListener<M> listener)
          Deregisters an existing configuration delete listener.
<M extends Configuration>
void
deregisterDeleteListener(InstantiableRelationDefinition<?,M> d, ServerManagedObjectDeleteListener<M> listener)
          Deregisters an existing server managed object delete listener.
<M extends Configuration>
void
deregisterDeleteListener(OptionalRelationDefinition<?,M> d, ConfigurationDeleteListener<M> listener)
          Deregisters an existing configuration delete listener.
<M extends Configuration>
void
deregisterDeleteListener(OptionalRelationDefinition<?,M> d, ServerManagedObjectDeleteListener<M> listener)
          Deregisters an existing server managed object delete listener.
<M extends Configuration>
ServerManagedObject<? extends M>
getChild(InstantiableRelationDefinition<?,M> d, java.lang.String name)
          Retrieve an instantiable child managed object.
<M extends Configuration>
ServerManagedObject<? extends M>
getChild(OptionalRelationDefinition<?,M> d)
          Retrieve an optional child managed object.
<M extends Configuration>
ServerManagedObject<? extends M>
getChild(SingletonRelationDefinition<?,M> d)
          Retrieve a singleton child managed object.
 S getConfiguration()
          Creates a server configuration view of this managed object.
 DN getDN()
          Get the DN of the LDAP entry associated with this server managed object.
 ManagedObjectDefinition<?,S> getManagedObjectDefinition()
          Get the definition associated with this server managed object.
 ManagedObjectPath<?,S> getManagedObjectPath()
          Get the path of this server managed object.
<T> T
getPropertyValue(PropertyDefinition<T> d)
          Get the effective value of the specified property.
<T> java.util.SortedSet<T>
getPropertyValues(PropertyDefinition<T> d)
          Get the effective values of the specified property.
 boolean hasChild(OptionalRelationDefinition<?,?> d)
          Determines whether or not the optional managed object associated with the specified optional relations exists.
 java.lang.String[] listChildren(InstantiableRelationDefinition<?,?> d)
          Lists the child managed objects associated with the specified instantiable relation.
<M extends Configuration>
void
registerAddListener(InstantiableRelationDefinition<?,M> d, ConfigurationAddListener<M> listener)
          Register to be notified when new child configurations are added beneath an instantiable relation.
<M extends Configuration>
void
registerAddListener(InstantiableRelationDefinition<?,M> d, ServerManagedObjectAddListener<M> listener)
          Register to be notified when new child server managed object are added beneath an instantiable relation.
<M extends Configuration>
void
registerAddListener(OptionalRelationDefinition<?,M> d, ConfigurationAddListener<M> listener)
          Register to be notified when a new child configurations is added beneath an optional relation.
<M extends Configuration>
void
registerAddListener(OptionalRelationDefinition<?,M> d, ServerManagedObjectAddListener<M> listener)
          Register to be notified when a new child server managed object is added beneath an optional relation.
 void registerChangeListener(ConfigurationChangeListener<? super S> listener)
          Register to be notified when this server managed object is changed.
 void registerChangeListener(ServerManagedObjectChangeListener<? super S> listener)
          Register to be notified when this server managed object is changed.
<M extends Configuration>
void
registerDeleteListener(InstantiableRelationDefinition<?,M> d, ConfigurationDeleteListener<M> listener)
          Register to be notified when existing child configurations are deleted beneath an instantiable relation.
<M extends Configuration>
void
registerDeleteListener(InstantiableRelationDefinition<?,M> d, ServerManagedObjectDeleteListener<M> listener)
          Register to be notified when existing child server managed objects are deleted beneath an instantiable relation.
<M extends Configuration>
void
registerDeleteListener(OptionalRelationDefinition<?,M> d, ConfigurationDeleteListener<M> listener)
          Register to be notified when an existing child configuration is deleted beneath an optional relation.
<M extends Configuration>
void
registerDeleteListener(OptionalRelationDefinition<?,M> d, ServerManagedObjectDeleteListener<M> listener)
          Register to be notified when an existing child server managed object is deleted beneath an optional relation.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

deregisterAddListener

public <M extends Configuration> void deregisterAddListener(InstantiableRelationDefinition<?,M> d,
                                                            ConfigurationAddListener<M> listener)
                           throws java.lang.IllegalArgumentException
Deregisters an existing configuration add listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The configuration add listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.

deregisterAddListener

public <M extends Configuration> void deregisterAddListener(InstantiableRelationDefinition<?,M> d,
                                                            ServerManagedObjectAddListener<M> listener)
                           throws java.lang.IllegalArgumentException
Deregisters an existing server managed object add listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The server managed object add listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.

deregisterAddListener

public <M extends Configuration> void deregisterAddListener(OptionalRelationDefinition<?,M> d,
                                                            ConfigurationAddListener<M> listener)
                           throws java.lang.IllegalArgumentException
Deregisters an existing configuration add listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The configuration add listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.

deregisterAddListener

public <M extends Configuration> void deregisterAddListener(OptionalRelationDefinition<?,M> d,
                                                            ServerManagedObjectAddListener<M> listener)
                           throws java.lang.IllegalArgumentException
Deregisters an existing server managed object add listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The server managed object add listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.

deregisterChangeListener

public void deregisterChangeListener(ConfigurationChangeListener<? super S> listener)
Deregisters an existing configuration change listener.

Parameters:
listener - The configuration change listener.

deregisterChangeListener

public void deregisterChangeListener(ServerManagedObjectChangeListener<? super S> listener)
Deregisters an existing server managed object change listener.

Parameters:
listener - The server managed object change listener.

deregisterDeleteListener

public <M extends Configuration> void deregisterDeleteListener(InstantiableRelationDefinition<?,M> d,
                                                               ConfigurationDeleteListener<M> listener)
                              throws java.lang.IllegalArgumentException
Deregisters an existing configuration delete listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The configuration delete listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.

deregisterDeleteListener

public <M extends Configuration> void deregisterDeleteListener(InstantiableRelationDefinition<?,M> d,
                                                               ServerManagedObjectDeleteListener<M> listener)
                              throws java.lang.IllegalArgumentException
Deregisters an existing server managed object delete listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The server managed object delete listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.

deregisterDeleteListener

public <M extends Configuration> void deregisterDeleteListener(OptionalRelationDefinition<?,M> d,
                                                               ConfigurationDeleteListener<M> listener)
                              throws java.lang.IllegalArgumentException
Deregisters an existing configuration delete listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The configuration delete listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.

deregisterDeleteListener

public <M extends Configuration> void deregisterDeleteListener(OptionalRelationDefinition<?,M> d,
                                                               ServerManagedObjectDeleteListener<M> listener)
                              throws java.lang.IllegalArgumentException
Deregisters an existing server managed object delete listener.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The server managed object delete listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.

getChild

public <M extends Configuration> ServerManagedObject<? extends M> getChild(InstantiableRelationDefinition<?,M> d,
                                                                           java.lang.String name)
                                                                throws java.lang.IllegalArgumentException,
                                                                       ConfigException
Retrieve an instantiable child managed object.

Type Parameters:
M - The requested type of the child server managed object configuration.
Parameters:
d - The instantiable relation definition.
name - The name of the child managed object.
Returns:
Returns the instantiable child managed object.
Throws:
java.lang.IllegalArgumentException - If the relation definition is not associated with this managed object's definition.
ConfigException - If the child managed object could not be found or if it could not be decoded.

getChild

public <M extends Configuration> ServerManagedObject<? extends M> getChild(OptionalRelationDefinition<?,M> d)
                                                                throws java.lang.IllegalArgumentException,
                                                                       ConfigException
Retrieve an optional child managed object.

Type Parameters:
M - The requested type of the child server managed object configuration.
Parameters:
d - The optional relation definition.
Returns:
Returns the optional child managed object.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.
ConfigException - If the child managed object could not be found or if it could not be decoded.

getChild

public <M extends Configuration> ServerManagedObject<? extends M> getChild(SingletonRelationDefinition<?,M> d)
                                                                throws java.lang.IllegalArgumentException,
                                                                       ConfigException
Retrieve a singleton child managed object.

Type Parameters:
M - The requested type of the child server managed object configuration.
Parameters:
d - The singleton relation definition.
Returns:
Returns the singleton child managed object.
Throws:
java.lang.IllegalArgumentException - If the relation definition is not associated with this managed object's definition.
ConfigException - If the child managed object could not be found or if it could not be decoded.

getConfiguration

public S getConfiguration()
Creates a server configuration view of this managed object.

Returns:
Returns the server configuration view of this managed object.

getDN

public DN getDN()
Get the DN of the LDAP entry associated with this server managed object.

Returns:
Returns the DN of the LDAP entry associated with this server managed object, or an null DN if this is the root managed object.

getManagedObjectDefinition

public ManagedObjectDefinition<?,S> getManagedObjectDefinition()
Get the definition associated with this server managed object.

Returns:
Returns the definition associated with this server managed object.

getManagedObjectPath

public ManagedObjectPath<?,S> getManagedObjectPath()
Get the path of this server managed object.

Returns:
Returns the path of this server managed object.

getPropertyValue

public <T> T getPropertyValue(PropertyDefinition<T> d)
                   throws java.lang.IllegalArgumentException
Get the effective value of the specified property. If the property is multi-valued then just the first value is returned. If the property does not have a value then its default value is returned if it has one, or null indicating that any default behavior is applicable.

Type Parameters:
T - The type of the property to be retrieved.
Parameters:
d - The property to be retrieved.
Returns:
Returns the property's effective value, or null indicating that any default behavior is applicable.
Throws:
java.lang.IllegalArgumentException - If the property definition is not associated with this managed object's definition.

getPropertyValues

public <T> java.util.SortedSet<T> getPropertyValues(PropertyDefinition<T> d)
                                         throws java.lang.IllegalArgumentException
Get the effective values of the specified property. If the property does not have any values then its default values are returned if it has any, or an empty set indicating that any default behavior is applicable.

Specified by:
getPropertyValues in interface PropertyProvider
Type Parameters:
T - The type of the property to be retrieved.
Parameters:
d - The property to be retrieved.
Returns:
Returns an unmodifiable set containing the property's effective values. An empty set indicates that the property has no default values defined and any default behavior is applicable.
Throws:
java.lang.IllegalArgumentException - If the property definition is not associated with this managed object's definition.

hasChild

public boolean hasChild(OptionalRelationDefinition<?,?> d)
                 throws java.lang.IllegalArgumentException
Determines whether or not the optional managed object associated with the specified optional relations exists.

Parameters:
d - The optional relation definition.
Returns:
Returns true if the optional managed object exists, false otherwise.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.

listChildren

public java.lang.String[] listChildren(InstantiableRelationDefinition<?,?> d)
                                throws java.lang.IllegalArgumentException
Lists the child managed objects associated with the specified instantiable relation.

Parameters:
d - The instantiable relation definition.
Returns:
Returns the names of the child managed objects.
Throws:
java.lang.IllegalArgumentException - If the relation definition is not associated with this managed object's definition.

registerAddListener

public <M extends Configuration> void registerAddListener(InstantiableRelationDefinition<?,M> d,
                                                          ConfigurationAddListener<M> listener)
                         throws java.lang.IllegalArgumentException,
                                ConfigException
Register to be notified when new child configurations are added beneath an instantiable relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The configuration add listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the instantiable relation could not be retrieved.

registerAddListener

public <M extends Configuration> void registerAddListener(InstantiableRelationDefinition<?,M> d,
                                                          ServerManagedObjectAddListener<M> listener)
                         throws java.lang.IllegalArgumentException,
                                ConfigException
Register to be notified when new child server managed object are added beneath an instantiable relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The server managed object add listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the instantiable relation could not be retrieved.

registerAddListener

public <M extends Configuration> void registerAddListener(OptionalRelationDefinition<?,M> d,
                                                          ConfigurationAddListener<M> listener)
                         throws java.lang.IllegalArgumentException,
                                ConfigException
Register to be notified when a new child configurations is added beneath an optional relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The configuration add listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the optional relation could not be retrieved.

registerAddListener

public <M extends Configuration> void registerAddListener(OptionalRelationDefinition<?,M> d,
                                                          ServerManagedObjectAddListener<M> listener)
                         throws java.lang.IllegalArgumentException,
                                ConfigException
Register to be notified when a new child server managed object is added beneath an optional relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The server managed object add listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the optional relation could not be retrieved.

registerChangeListener

public void registerChangeListener(ConfigurationChangeListener<? super S> listener)
Register to be notified when this server managed object is changed.

Parameters:
listener - The configuration change listener.

registerChangeListener

public void registerChangeListener(ServerManagedObjectChangeListener<? super S> listener)
Register to be notified when this server managed object is changed.

Parameters:
listener - The server managed object change listener.

registerDeleteListener

public <M extends Configuration> void registerDeleteListener(InstantiableRelationDefinition<?,M> d,
                                                             ConfigurationDeleteListener<M> listener)
                            throws java.lang.IllegalArgumentException,
                                   ConfigException
Register to be notified when existing child configurations are deleted beneath an instantiable relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The configuration delete listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the instantiable relation could not be retrieved.

registerDeleteListener

public <M extends Configuration> void registerDeleteListener(InstantiableRelationDefinition<?,M> d,
                                                             ServerManagedObjectDeleteListener<M> listener)
                            throws java.lang.IllegalArgumentException,
                                   ConfigException
Register to be notified when existing child server managed objects are deleted beneath an instantiable relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The instantiable relation definition.
listener - The server managed objects delete listener.
Throws:
java.lang.IllegalArgumentException - If the instantiable relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the instantiable relation could not be retrieved.

registerDeleteListener

public <M extends Configuration> void registerDeleteListener(OptionalRelationDefinition<?,M> d,
                                                             ConfigurationDeleteListener<M> listener)
                            throws java.lang.IllegalArgumentException,
                                   ConfigException
Register to be notified when an existing child configuration is deleted beneath an optional relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The configuration delete listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the optional relation could not be retrieved.

registerDeleteListener

public <M extends Configuration> void registerDeleteListener(OptionalRelationDefinition<?,M> d,
                                                             ServerManagedObjectDeleteListener<M> listener)
                            throws java.lang.IllegalArgumentException,
                                   ConfigException
Register to be notified when an existing child server managed object is deleted beneath an optional relation.

Type Parameters:
M - The type of the child server configuration object.
Parameters:
d - The optional relation definition.
listener - The server managed object delete listener.
Throws:
java.lang.IllegalArgumentException - If the optional relation definition is not associated with this managed object's definition.
ConfigException - If the configuration entry associated with the optional relation could not be retrieved.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object