org.opends.server.admin.client
Class ManagementContext

java.lang.Object
  extended by org.opends.server.admin.client.ManagementContext
Direct Known Subclasses:
LDAPManagementContext

public abstract class ManagementContext
extends java.lang.Object

Client management connection context.


Constructor Summary
protected ManagementContext()
          Creates a new management context.
 
Method Summary
 void close()
          Closes this management context.
<C extends ConfigurationClient,S extends Configuration>
boolean
deleteManagedObject(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd, java.lang.String name)
          Deletes the named instantiable child managed object from the named parent managed object.
<C extends ConfigurationClient,S extends Configuration>
boolean
deleteManagedObject(ManagedObjectPath<?,?> parent, OptionalRelationDefinition<C,S> rd)
          Deletes the optional child managed object from the named parent managed object.
protected abstract  Driver getDriver()
          Gets the driver associated with this management context.
<C extends ConfigurationClient,S extends Configuration>
ManagedObject<? extends C>
getManagedObject(ManagedObjectPath<C,S> path)
          Gets the named managed object.
<PD> PD
getPropertyValue(ManagedObjectPath<?,?> path, PropertyDefinition<PD> pd)
          Gets the effective value of a property in the named managed object.
<PD> java.util.SortedSet<PD>
getPropertyValues(ManagedObjectPath<?,?> path, PropertyDefinition<PD> pd)
          Gets the effective values of a property in the named managed object.
 RootCfgClient getRootConfiguration()
          Gets the root configuration client associated with this management context.
 ManagedObject<RootCfgClient> getRootConfigurationManagedObject()
          Gets the root configuration 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.
<C extends ConfigurationClient,S extends Configuration>
java.lang.String[]
listManagedObjects(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd, AbstractManagedObjectDefinition<? extends C,? extends S> d)
          Lists the child managed objects of the named parent managed object which are a sub-type of the specified managed object definition.
 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
 

Constructor Detail

ManagementContext

protected ManagementContext()
Creates a new management context.

Method Detail

deleteManagedObject

public final <C extends ConfigurationClient,S extends Configuration> boolean deleteManagedObject(ManagedObjectPath<?,?> parent,
                                                                                                 InstantiableRelationDefinition<C,S> rd,
                                                                                                 java.lang.String name)
                                  throws java.lang.IllegalArgumentException,
                                         ManagedObjectNotFoundException,
                                         OperationRejectedException,
                                         AuthorizationException,
                                         CommunicationException
Deletes the named instantiable child managed object from 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.
name - The name of the child managed object to be removed.
Returns:
Returns true if the named instantiable child managed object was found, or false if it was not found.
Throws:
java.lang.IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
ManagedObjectNotFoundException - If the parent managed object could not be found.
OperationRejectedException - If the managed object cannot be removed due to some client-side or server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
AuthorizationException - If the server refuses to remove the managed objects because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

deleteManagedObject

public final <C extends ConfigurationClient,S extends Configuration> boolean deleteManagedObject(ManagedObjectPath<?,?> parent,
                                                                                                 OptionalRelationDefinition<C,S> rd)
                                  throws java.lang.IllegalArgumentException,
                                         ManagedObjectNotFoundException,
                                         OperationRejectedException,
                                         AuthorizationException,
                                         CommunicationException
Deletes the optional child managed object from 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 optional relation definition.
Returns:
Returns true if the optional child managed object was found, or false if it was not found.
Throws:
java.lang.IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
ManagedObjectNotFoundException - If the parent managed object could not be found.
OperationRejectedException - If the managed object cannot be removed due to some client-side or server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
AuthorizationException - If the server refuses to remove the managed objects because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

getManagedObject

public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getManagedObject(ManagedObjectPath<C,S> path)
                                                                              throws DefinitionDecodingException,
                                                                                     ManagedObjectDecodingException,
                                                                                     ManagedObjectNotFoundException,
                                                                                     AuthorizationException,
                                                                                     CommunicationException
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:
DefinitionDecodingException - If the managed object was found but its type could not be determined.
ManagedObjectDecodingException - If the managed object was found but one or more of its properties could not be decoded.
ManagedObjectNotFoundException - If the requested managed object could not be found on the server.
AuthorizationException - If the server refuses to retrieve the managed object because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

getPropertyValue

public final <PD> PD getPropertyValue(ManagedObjectPath<?,?> path,
                                      PropertyDefinition<PD> pd)
                          throws java.lang.IllegalArgumentException,
                                 DefinitionDecodingException,
                                 AuthorizationException,
                                 ManagedObjectNotFoundException,
                                 CommunicationException,
                                 PropertyException
Gets the effective value of a property in the named managed object.

Type Parameters:
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.
DefinitionDecodingException - If the managed object was found but its type could not be determined.
PropertyException - If the managed object was found but the requested property could not be decoded.
ManagedObjectNotFoundException - If the requested managed object could not be found on the server.
AuthorizationException - If the server refuses to retrieve the managed object because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

getPropertyValues

public final <PD> java.util.SortedSet<PD> getPropertyValues(ManagedObjectPath<?,?> path,
                                                            PropertyDefinition<PD> pd)
                                                throws java.lang.IllegalArgumentException,
                                                       DefinitionDecodingException,
                                                       AuthorizationException,
                                                       ManagedObjectNotFoundException,
                                                       CommunicationException,
                                                       PropertyException
Gets the effective values of a property in the named managed object.

Type Parameters:
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.
DefinitionDecodingException - If the managed object was found but its type could not be determined.
PropertyException - If the managed object was found but the requested property could not be decoded.
ManagedObjectNotFoundException - If the requested managed object could not be found on the server.
AuthorizationException - If the server refuses to retrieve the managed object because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

getRootConfiguration

public final RootCfgClient getRootConfiguration()
Gets the root configuration client associated with this management context.

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

getRootConfigurationManagedObject

public final ManagedObject<RootCfgClient> getRootConfigurationManagedObject()
Gets the root configuration managed object associated with this management context.

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

listManagedObjects

public final <C extends ConfigurationClient,S extends Configuration> java.lang.String[] listManagedObjects(ManagedObjectPath<?,?> parent,
                                                                                                           InstantiableRelationDefinition<C,S> rd)
                                            throws java.lang.IllegalArgumentException,
                                                   ManagedObjectNotFoundException,
                                                   AuthorizationException,
                                                   CommunicationException
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.
ManagedObjectNotFoundException - If the parent managed object could not be found.
AuthorizationException - If the server refuses to list the managed objects because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

listManagedObjects

public final <C extends ConfigurationClient,S extends Configuration> java.lang.String[] listManagedObjects(ManagedObjectPath<?,?> parent,
                                                                                                           InstantiableRelationDefinition<C,S> rd,
                                                                                                           AbstractManagedObjectDefinition<? extends C,? extends S> d)
                                            throws java.lang.IllegalArgumentException,
                                                   ManagedObjectNotFoundException,
                                                   AuthorizationException,
                                                   CommunicationException
Lists the child managed objects of the named parent managed object which are a sub-type of the specified managed object definition.

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.
d - The managed object definition.
Returns:
Returns the names of the child managed objects which are a sub-type of the specified managed object definition.
Throws:
java.lang.IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
ManagedObjectNotFoundException - If the parent managed object could not be found.
AuthorizationException - If the server refuses to list the managed objects because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

managedObjectExists

public final boolean managedObjectExists(ManagedObjectPath<?,?> path)
                                  throws ManagedObjectNotFoundException,
                                         AuthorizationException,
                                         CommunicationException
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.
Throws:
ManagedObjectNotFoundException - If the parent managed object could not be found.
AuthorizationException - If the server refuses to make the determination because the client does not have the correct privileges.
CommunicationException - If the client cannot contact the server due to an underlying communication problem.

getDriver

protected abstract Driver getDriver()
Gets the driver associated with this management context.

Returns:
Returns the driver associated with this management context.

close

public final void close()
Closes this management context.