Class ServerManagementContext
- java.lang.Object
-
- org.forgerock.opendj.config.server.ServerManagementContext
-
public final class ServerManagementContext extends Object
Server management connection context.
-
-
Constructor Summary
Constructors Constructor Description ServerManagementContext(ConfigurationRepository repository, SubstitutionService substitutionService)
Creates a context from the provided configuration repository.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurationRepository
getConfigRepository()
Returns the repository containing all configuration entries.<C extends ConfigurationClient,S extends Configuration>
ServerManagedObject<? extends S>getManagedObject(ManagedObjectPath<C,S> path)
Gets 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>
String[]listManagedObjects(ManagedObjectPath<?,?> parent, RelationDefinition<C,S> relationDef)
Lists the child managed objects of the named parent managed object.boolean
managedObjectExists(ManagedObjectPath<?,?> path)
Determines whether the named managed object exists.
-
-
-
Constructor Detail
-
ServerManagementContext
public ServerManagementContext(ConfigurationRepository repository, SubstitutionService substitutionService)
Creates a context from the provided configuration repository.- Parameters:
repository
- The repository of configuration entries.substitutionService
- The service to substitute commons-config expressions in configuration entries.
-
-
Method Detail
-
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.
-
getRootConfiguration
public RootCfg getRootConfiguration()
Get the root configuration manager associated with this management context.- 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:
- the root configuration server managed object
-
listManagedObjects
public <C extends ConfigurationClient,S extends Configuration> String[] listManagedObjects(ManagedObjectPath<?,?> parent, RelationDefinition<C,S> relationDef)
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.relationDef
- The relation definition.- Returns:
- Returns the names of the child managed objects.
- Throws:
IllegalArgumentException
- If the relation definition is not associated with the parent managed object's definition.
-
managedObjectExists
public boolean managedObjectExists(ManagedObjectPath<?,?> path)
Determines whether 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.
-
getConfigRepository
public ConfigurationRepository getConfigRepository()
Returns the repository containing all configuration entries.- Returns:
- the repository
-
-