org.opends.server.admin.server
Class ServerManagementContext

java.lang.Object
  extended by org.opends.server.admin.server.ServerManagementContext

public final class ServerManagementContext
extends java.lang.Object

Server management connection context.


Method Summary
static ServerManagementContext getInstance()
          Get the single server-side management context.
<C extends ConfigurationClient,S extends Configuration>
ServerManagedObject<? extends S>
getManagedObject(ManagedObjectPath<C,S> path)
          Gets the named managed object.
<C extends ConfigurationClient,S extends Configuration,PD>
PD
getPropertyValue(ManagedObjectPath<C,S> path, PropertyDefinition<PD> pd)
          Gets the effective value of a property in the named managed object.
<C extends ConfigurationClient,S extends Configuration,PD>
java.util.SortedSet<PD>
getPropertyValues(ManagedObjectPath<C,S> path, PropertyDefinition<PD> pd)
          Gets the effective values of a property in the named managed object.
 RootCfg getRootConfiguration()
          Get the root configuration manager associated with this management context.
 ServerManagedObject<RootCfg> getRootConfigurationManagedObject()
          Get the root configuration server managed object associated with this management context.
<C extends ConfigurationClient,S extends Configuration>
java.lang.String[]
listManagedObjects(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd)
          Lists the child managed objects of the named parent managed object.
 boolean managedObjectExists(ManagedObjectPath<?,?> path)
          Determines whether or not the named managed object exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ServerManagementContext getInstance()
Get the single server-side management context.

Returns:
Returns the single server-side management context.

getManagedObject

public <C extends ConfigurationClient,S extends Configuration> ServerManagedObject<? extends S> getManagedObject(ManagedObjectPath<C,S> path)
                                                                        throws ConfigException
Gets the named managed object.

Type Parameters:
C - The type of client managed object configuration that the path definition refers to.
S - The type of server managed object configuration that the path definition refers to.
Parameters:
path - The path of the managed object.
Returns:
Returns the named managed object.
Throws:
ConfigException - If the named managed object could not be found or if it could not be decoded.

getPropertyValue

public <C extends ConfigurationClient,S extends Configuration,PD> PD getPropertyValue(ManagedObjectPath<C,S> path,
                                                                                      PropertyDefinition<PD> pd)
                    throws java.lang.IllegalArgumentException,
                           ConfigException,
                           PropertyException
Gets the effective value of a property in the named managed object.

Type Parameters:
C - The type of client managed object configuration that the path definition refers to.
S - The type of server managed object configuration that the path definition refers to.
PD - The type of the property to be retrieved.
Parameters:
path - The path of the managed object containing the property.
pd - The property to be retrieved.
Returns:
Returns the property's effective value, or null if there are no values defined.
Throws:
java.lang.IllegalArgumentException - If the property definition is not associated with the referenced managed object's definition.
PropertyException - If the managed object was found but the requested property could not be decoded.
ConfigException - If the named managed object could not be found or if it could not be decoded.

getPropertyValues

public <C extends ConfigurationClient,S extends Configuration,PD> java.util.SortedSet<PD> getPropertyValues(ManagedObjectPath<C,S> path,
                                                                                                            PropertyDefinition<PD> pd)
                                          throws java.lang.IllegalArgumentException,
                                                 ConfigException,
                                                 PropertyException
Gets the effective values of a property in the named managed object.

Type Parameters:
C - The type of client managed object configuration that the path definition refers to.
S - The type of server managed object configuration that the path definition refers to.
PD - The type of the property to be retrieved.
Parameters:
path - The path of the managed object containing the property.
pd - The property to be retrieved.
Returns:
Returns the property's effective values, or an empty set if there are no values defined.
Throws:
java.lang.IllegalArgumentException - If the property definition is not associated with the referenced managed object's definition.
PropertyException - If the managed object was found but the requested property could not be decoded.
ConfigException - If the named managed object could not be found or if it could not be decoded.

getRootConfiguration

public RootCfg getRootConfiguration()
Get the root configuration manager associated with this management context.

Returns:
Returns the root configuration manager associated with this management context.

getRootConfigurationManagedObject

public ServerManagedObject<RootCfg> getRootConfigurationManagedObject()
Get the root configuration server managed object associated with this management context.

Returns:
Returns the root configuration server managed object associated with this management context.

listManagedObjects

public <C extends ConfigurationClient,S extends Configuration> java.lang.String[] listManagedObjects(ManagedObjectPath<?,?> parent,
                                                                                                     InstantiableRelationDefinition<C,S> rd)
                                      throws java.lang.IllegalArgumentException
Lists the child managed objects of the named parent managed object.

Type Parameters:
C - The type of client managed object configuration that the relation definition refers to.
S - The type of server managed object configuration that the relation definition refers to.
Parameters:
parent - The path of the parent managed object.
rd - 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 the parent managed object's definition.

managedObjectExists

public boolean managedObjectExists(ManagedObjectPath<?,?> path)
Determines whether or not the named managed object exists.

Parameters:
path - The path of the named managed object.
Returns:
Returns true if the named managed object exists, false otherwise.