Class DriverBasedManagementContext
- java.lang.Object
 - 
- org.forgerock.opendj.config.client.DriverBasedManagementContext
 
 
- 
- All Implemented Interfaces:
 Closeable,AutoCloseable,ManagementContext
- Direct Known Subclasses:
 LdapManagementContext
public abstract class DriverBasedManagementContext extends Object implements ManagementContext
Driver based client management connection context. 
- 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedDriverBasedManagementContext()Creates a new management context. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()<C extends ConfigurationClient,S extends Configuration>
booleandeleteManagedObject(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd, String name)Deletes the named instantiable child managed object from the named parent managed object.<C extends ConfigurationClient,S extends Configuration>
booleandeleteManagedObject(ManagedObjectPath<?,?> parent, OptionalRelationDefinition<C,S> rd)Deletes the optional child managed object from the named parent managed object.<C extends ConfigurationClient,S extends Configuration>
booleandeleteManagedObject(ManagedObjectPath<?,?> parent, SetRelationDefinition<C,S> rd, String name)Deletes s set child managed object from the named parent managed object.protected abstract DrivergetDriver()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.<P> ValueOrExpression<P>getPropertyValue(ManagedObjectPath<?,?> path, PropertyDefinition<P> pd)Gets the effective value of a property in the named managed object.<P> SortedSet<ValueOrExpression<P>>getPropertyValues(ManagedObjectPath<?,?> path, PropertyDefinition<P> pd)Gets the effective values of a property in the named managed object.RootCfgClientgetRootConfiguration()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>
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>
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.<C extends ConfigurationClient,S extends Configuration>
String[]listManagedObjects(ManagedObjectPath<?,?> parent, SetRelationDefinition<C,S> rd)Lists the child managed objects of the named parent managed object.booleanmanagedObjectExists(ManagedObjectPath<?,?> path)Determines whether the named managed object exists. 
 - 
 
- 
- 
Method Detail
- 
deleteManagedObject
public final <C extends ConfigurationClient,S extends Configuration> boolean deleteManagedObject(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd, String name) throws ManagedObjectNotFoundException, OperationRejectedException, LdapException
Description copied from interface:ManagementContextDeletes the named instantiable child managed object from the named parent managed object.- Specified by:
 deleteManagedObjectin interfaceManagementContext- 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 
trueif the named instantiable child managed object was found, orfalseif it was not found. - Throws:
 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).LdapException- If any other error occurs.
 
- 
deleteManagedObject
public final <C extends ConfigurationClient,S extends Configuration> boolean deleteManagedObject(ManagedObjectPath<?,?> parent, OptionalRelationDefinition<C,S> rd) throws ManagedObjectNotFoundException, OperationRejectedException, LdapException
Description copied from interface:ManagementContextDeletes the optional child managed object from the named parent managed object.- Specified by:
 deleteManagedObjectin interfaceManagementContext- 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 
trueif the optional child managed object was found, orfalseif it was not found. - Throws:
 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).LdapException- If any other error occurs.
 
- 
deleteManagedObject
public final <C extends ConfigurationClient,S extends Configuration> boolean deleteManagedObject(ManagedObjectPath<?,?> parent, SetRelationDefinition<C,S> rd, String name) throws ManagedObjectNotFoundException, OperationRejectedException, LdapException
Description copied from interface:ManagementContextDeletes s set child managed object from the named parent managed object.- Specified by:
 deleteManagedObjectin interfaceManagementContext- 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 set relation definition.name- The name of the child managed object to be removed.- Returns:
 - Returns 
trueif the set child managed object was found, orfalseif it was not found. - Throws:
 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).LdapException- If any other error occurs.
 
- 
getManagedObject
public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getManagedObject(ManagedObjectPath<C,S> path) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, LdapException
Description copied from interface:ManagementContextGets the named managed object.- Specified by:
 getManagedObjectin interfaceManagementContext- 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.LdapException- If any other error occurs.
 
- 
getPropertyValue
public final <P> ValueOrExpression<P> getPropertyValue(ManagedObjectPath<?,?> path, PropertyDefinition<P> pd) throws DefinitionDecodingException, LdapException, ManagedObjectNotFoundException
Description copied from interface:ManagementContextGets the effective value of a property in the named managed object.- Specified by:
 getPropertyValuein interfaceManagementContext- Type Parameters:
 P- 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 
nullif there are no values defined. - Throws:
 DefinitionDecodingException- If the managed object was found but its type could not be determined.LdapException- If any other error occurs.ManagedObjectNotFoundException- If the requested managed object could not be found on the server.
 
- 
getPropertyValues
public final <P> SortedSet<ValueOrExpression<P>> getPropertyValues(ManagedObjectPath<?,?> path, PropertyDefinition<P> pd) throws DefinitionDecodingException, LdapException, ManagedObjectNotFoundException
Description copied from interface:ManagementContextGets the effective values of a property in the named managed object.- Specified by:
 getPropertyValuesin interfaceManagementContext- Type Parameters:
 P- 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:
 DefinitionDecodingException- If the managed object was found but its type could not be determined.LdapException- If any other error occurs.ManagedObjectNotFoundException- If the requested managed object could not be found on the server.
 
- 
getRootConfiguration
public final RootCfgClient getRootConfiguration()
Description copied from interface:ManagementContextGets the root configuration client associated with this management context.- Specified by:
 getRootConfigurationin interfaceManagementContext- Returns:
 - Returns the root configuration client associated with this management context.
 
 
- 
getRootConfigurationManagedObject
public final ManagedObject<RootCfgClient> getRootConfigurationManagedObject()
Description copied from interface:ManagementContextGets the root configuration managed object associated with this management context.- Specified by:
 getRootConfigurationManagedObjectin interfaceManagementContext- Returns:
 - Returns the root configuration managed object associated with this management context.
 
 
- 
listManagedObjects
public final <C extends ConfigurationClient,S extends Configuration> String[] listManagedObjects(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd) throws ManagedObjectNotFoundException, LdapException
Description copied from interface:ManagementContextLists the child managed objects of the named parent managed object.- Specified by:
 listManagedObjectsin interfaceManagementContext- 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:
 ManagedObjectNotFoundException- If the parent managed object could not be found.LdapException- If any other error occurs.
 
- 
listManagedObjects
public final <C extends ConfigurationClient,S extends Configuration> String[] listManagedObjects(ManagedObjectPath<?,?> parent, InstantiableRelationDefinition<C,S> rd, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ManagedObjectNotFoundException, LdapException
Description copied from interface:ManagementContextLists the child managed objects of the named parent managed object which are a sub-type of the specified managed object definition.- Specified by:
 listManagedObjectsin interfaceManagementContext- 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:
 ManagedObjectNotFoundException- If the parent managed object could not be found.LdapException- If any other error occurs.
 
- 
listManagedObjects
public final <C extends ConfigurationClient,S extends Configuration> String[] listManagedObjects(ManagedObjectPath<?,?> parent, SetRelationDefinition<C,S> rd) throws ManagedObjectNotFoundException, LdapException
Description copied from interface:ManagementContextLists the child managed objects of the named parent managed object.- Specified by:
 listManagedObjectsin interfaceManagementContext- 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 set relation definition.- Returns:
 - Returns the names of the child managed objects.
 - Throws:
 ManagedObjectNotFoundException- If the parent managed object could not be found.LdapException- If any other error occurs.
 
- 
managedObjectExists
public final boolean managedObjectExists(ManagedObjectPath<?,?> path) throws ManagedObjectNotFoundException, LdapException
Description copied from interface:ManagementContextDetermines whether the named managed object exists.- Specified by:
 managedObjectExistsin interfaceManagementContext- Parameters:
 path- The path of the named managed object.- Returns:
 - Returns 
trueif the named managed object exists,falseotherwise. - Throws:
 ManagedObjectNotFoundException- If the parent managed object could not be found.LdapException- If any other error occurs.
 
- 
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()
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable
 
 - 
 
 -