Class AbstractManagedObject<T extends ConfigurationClient>
- java.lang.Object
-
- org.forgerock.opendj.config.client.spi.AbstractManagedObject<T>
-
- Type Parameters:
T
- The type of client configuration represented by the client managed object.
- All Implemented Interfaces:
ManagedObject<T>
,PropertyProvider
public abstract class AbstractManagedObject<T extends ConfigurationClient> extends Object implements ManagedObject<T>
An abstract managed object implementation.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractManagedObject(ManagedObjectDefinition<T,? extends Configuration> d, ManagedObjectPath<T,? extends Configuration> path, PropertySet properties, boolean existsOnServer, PropertyDefinition<?> namingPropertyDefinition)
Creates a new abstract managed object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addNewManagedObject()
Adds this new managed object.void
commit()
Adds this managed object to the server or commits any changes made to it depending on whether the managed object already exists on the server.<C extends ConfigurationClient,S extends Configuration,C1 extends C>
ManagedObject<C1>createChild(InstantiableRelationDefinition<C,S> r, ManagedObjectDefinition<C1,? extends S> d, String name, Collection<PropertyException> exceptions)
Creates a new child managed object bound to the specified instantiable relation.<C extends ConfigurationClient,S extends Configuration,C1 extends C>
ManagedObject<C1>createChild(OptionalRelationDefinition<C,S> r, ManagedObjectDefinition<C1,? extends S> d, Collection<PropertyException> exceptions)
Creates a new child managed object bound to the specified optional relation.<C extends ConfigurationClient,S extends Configuration,C1 extends C>
ManagedObject<C1>createChild(SetRelationDefinition<C,S> r, ManagedObjectDefinition<C1,? extends S> d, Collection<PropertyException> exceptions)
Creates a new child managed object bound to the specified set relation.<C extends ConfigurationClient,S extends Configuration>
ManagedObject<? extends C>getChild(InstantiableRelationDefinition<C,S> r, String name)
Retrieves an instantiable child managed object.<C extends ConfigurationClient,S extends Configuration>
ManagedObject<? extends C>getChild(OptionalRelationDefinition<C,S> r)
Retrieves an optional child managed object.<C extends ConfigurationClient,S extends Configuration>
ManagedObject<? extends C>getChild(SetRelationDefinition<C,S> r, String name)
Retrieves a set child managed object.<C extends ConfigurationClient,S extends Configuration>
ManagedObject<? extends C>getChild(SingletonRelationDefinition<C,S> r)
Retrieves a singleton child managed object.T
getConfiguration()
Creates a client configuration view of this managed object.protected abstract Driver
getDriver()
Gets the management context driver associated with this managed object.ManagedObjectDefinition<T,? extends Configuration>
getManagedObjectDefinition()
Gets the definition associated with this managed object.ManagedObjectPath<T,? extends Configuration>
getManagedObjectPath()
Gets the path of this managed object.protected PropertyDefinition<?>
getNamingPropertyDefinition()
Gets the naming property definition associated with this managed object.protected <P> Property<P>
getProperty(PropertyDefinition<P> pd)
Gets the property associated with the specified property definition.<P> SortedSet<ValueOrExpression<P>>
getPropertyDefaultValues(PropertyDefinition<P> pd)
Gets a mutable copy of the set of default values for the specified property.<P> ValueOrExpression<P>
getPropertyValue(PropertyDefinition<P> pd)
Gets the effective value of the specified property.<P> SortedSet<ValueOrExpression<P>>
getPropertyValues(PropertyDefinition<P> pd)
Gets a mutable copy of the set of effective values for the specified property.<C extends ConfigurationClient,S extends Configuration>
booleanhasChild(OptionalRelationDefinition<C,S> r)
Determines whether the optional managed object associated with the specified optional relations exists.boolean
isModified(PropertyDefinition<?> pd)
Determines whether the provided property has been modified since this managed object was constructed.boolean
isPropertyPresent(PropertyDefinition<?> pd)
Determines whether the specified property is set.<C extends ConfigurationClient,S extends Configuration>
String[]listChildren(InstantiableRelationDefinition<C,S> r)
Lists the child managed objects associated with the specified instantiable relation.<C extends ConfigurationClient,S extends Configuration>
String[]listChildren(InstantiableRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d)
Lists the child managed objects associated with the specified instantiable relation which are a sub-type of the specified managed object definition.<C extends ConfigurationClient,S extends Configuration>
String[]listChildren(SetRelationDefinition<C,S> r)
Lists the child managed objects associated with the specified set relation.<C extends ConfigurationClient,S extends Configuration>
String[]listChildren(SetRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d)
Lists the child managed objects associated with the specified set relation which are a sub-type of the specified managed object definition.protected abstract void
modifyExistingManagedObject()
Applies changes made to this managed object.protected abstract <M extends ConfigurationClient>
ManagedObject<M>newInstance(ManagedObjectDefinition<M,?> d, ManagedObjectPath<M,?> path, PropertySet properties, PropertyDefinition<?> namingPropertyDefinition)
Creates a new managed object.<C extends ConfigurationClient,S extends Configuration>
voidremoveChild(InstantiableRelationDefinition<C,S> r, String name)
Removes the named instantiable child managed object.<C extends ConfigurationClient,S extends Configuration>
voidremoveChild(OptionalRelationDefinition<C,S> r)
Removes an optional child managed object.<C extends ConfigurationClient,S extends Configuration>
voidremoveChild(SetRelationDefinition<C,S> r, String name)
Removes s set child managed object.<P> void
setPropertyValue(PropertyDefinition<P> pd, ValueOrExpression<P> value)
Sets a new pending value for the specified property.<P> void
setPropertyValues(PropertyDefinition<P> pd, Collection<ValueOrExpression<P>> values)
Sets a new pending values for the specified property.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.forgerock.opendj.config.client.ManagedObject
isModified
-
-
-
-
Constructor Detail
-
AbstractManagedObject
protected AbstractManagedObject(ManagedObjectDefinition<T,? extends Configuration> d, ManagedObjectPath<T,? extends Configuration> path, PropertySet properties, boolean existsOnServer, PropertyDefinition<?> namingPropertyDefinition)
Creates a new abstract managed object.- Parameters:
d
- The managed object's definition.path
- The managed object's path.properties
- The managed object's properties.existsOnServer
- Indicates whether the managed object exists on the server (false means the managed object is new and has not been committed).namingPropertyDefinition
- Optional naming property definition.
-
-
Method Detail
-
commit
public final void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException, ConcurrentModificationException, OperationRejectedException, LdapException
Description copied from interface:ManagedObject
Adds this managed object to the server or commits any changes made to it depending on whether the managed object already exists on the server. Pending property values will be committed to the managed object. If successful, the pending values will become active values.See the class description for more information regarding pending and active values.
- Specified by:
commit
in interfaceManagedObject<T extends ConfigurationClient>
- Throws:
ManagedObjectAlreadyExistsException
- If the managed object cannot be added to the server because it already exists.MissingMandatoryPropertiesException
- If the managed object contains some mandatory properties which have been left undefined.ConcurrentModificationException
- If the managed object is being added to the server but its parent has been removed by another client, or if this managed object is being modified but it has been removed from the server by another client.OperationRejectedException
- If this managed object cannot be added or modified due to some client-side or server-side constraint which cannot be satisfied.LdapException
- If any other error occurs.
-
isModified
public boolean isModified(PropertyDefinition<?> pd)
Description copied from interface:ManagedObject
Determines whether the provided property has been modified since this managed object was constructed. In other words, whether the set of pending values differs from the set of active values for the given property.- Specified by:
isModified
in interfaceManagedObject<T extends ConfigurationClient>
- Parameters:
pd
- The property definition.- Returns:
- Returns
true
if the provided property has been modified since this managed object was constructed.
-
createChild
public final <C extends ConfigurationClient,S extends Configuration,C1 extends C> ManagedObject<C1> createChild(InstantiableRelationDefinition<C,S> r, ManagedObjectDefinition<C1,? extends S> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException
Description copied from interface:ManagedObject
Creates a new child managed object bound to the specified instantiable relation. The new managed object will initially not contain any property values (including mandatory properties). Once the managed object has been configured it can be added to the server using theManagedObject.commit()
method.- Specified by:
createChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The expected type of the child managed object configuration client.S
- The expected type of the child managed object server configuration.C1
- The actual type of the added managed object configuration client.- Parameters:
r
- The instantiable relation definition.d
- The definition of the managed object to be created.name
- The name of the child managed object.exceptions
- A collection in which to place anyPropertyException
s that occurred whilst attempting to determine the managed object's default values.- Returns:
- Returns a new child managed object bound to the specified instantiable relation.
- Throws:
IllegalManagedObjectNameException
- If the name of the child managed object is invalid.
-
createChild
public final <C extends ConfigurationClient,S extends Configuration,C1 extends C> ManagedObject<C1> createChild(OptionalRelationDefinition<C,S> r, ManagedObjectDefinition<C1,? extends S> d, Collection<PropertyException> exceptions)
Description copied from interface:ManagedObject
Creates a new child managed object bound to the specified optional relation. The new managed object will initially not contain any property values (including mandatory properties). Once the managed object has been configured it can be added to the server using theManagedObject.commit()
method.- Specified by:
createChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The expected type of the child managed object configuration client.S
- The expected type of the child managed object server configuration.C1
- The actual type of the added managed object configuration client.- Parameters:
r
- The optional relation definition.d
- The definition of the managed object to be created.exceptions
- A collection in which to place anyPropertyException
s that occurred whilst attempting to determine the managed object's default values.- Returns:
- Returns a new child managed object bound to the specified optional relation.
-
createChild
public final <C extends ConfigurationClient,S extends Configuration,C1 extends C> ManagedObject<C1> createChild(SetRelationDefinition<C,S> r, ManagedObjectDefinition<C1,? extends S> d, Collection<PropertyException> exceptions)
Description copied from interface:ManagedObject
Creates a new child managed object bound to the specified set relation. The new managed object will initially not contain any property values (including mandatory properties). Once the managed object has been configured it can be added to the server using theManagedObject.commit()
method.- Specified by:
createChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The expected type of the child managed object configuration client.S
- The expected type of the child managed object server configuration.C1
- The actual type of the added managed object configuration client.- Parameters:
r
- The set relation definition.d
- The definition of the managed object to be created.exceptions
- A collection in which to place anyPropertyException
s that occurred whilst attempting to determine the managed object's default values.- Returns:
- Returns a new child managed object bound to the specified set relation.
-
getChild
public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(InstantiableRelationDefinition<C,S> r, String name) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Retrieves an instantiable child managed object.- Specified by:
getChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The requested type of the child managed object configuration client.S
- The type of server managed object configuration that the relation definition refers to.- Parameters:
r
- The instantiable relation definition.name
- The name of the child managed object.- Returns:
- Returns the instantiable child 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.ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
getChild
public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(OptionalRelationDefinition<C,S> r) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Retrieves an optional child managed object.- Specified by:
getChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The requested type of the child managed object configuration client.S
- The type of server managed object configuration that the relation definition refers to.- Parameters:
r
- The optional relation definition.- Returns:
- Returns the optional child 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.ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
getChild
public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(SingletonRelationDefinition<C,S> r) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Retrieves a singleton child managed object.- Specified by:
getChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The requested type of the child managed object configuration client.S
- The type of server managed object configuration that the relation definition refers to.- Parameters:
r
- The singleton relation definition.- Returns:
- Returns the singleton child 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.ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
getChild
public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(SetRelationDefinition<C,S> r, String name) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Retrieves a set child managed object.- Specified by:
getChild
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
C
- The requested type of the child managed object configuration client.S
- The type of server managed object configuration that the relation definition refers to.- Parameters:
r
- The set relation definition.name
- The name of the child managed object.- Returns:
- Returns the set child 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.ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
getConfiguration
public final T getConfiguration()
Description copied from interface:ManagedObject
Creates a client configuration view of this managed object. Modifications made to this managed object will be reflected in the client configuration view and vice versa.- Specified by:
getConfiguration
in interfaceManagedObject<T extends ConfigurationClient>
- Returns:
- Returns a client configuration view of this managed object.
-
getManagedObjectDefinition
public final ManagedObjectDefinition<T,? extends Configuration> getManagedObjectDefinition()
Description copied from interface:ManagedObject
Gets the definition associated with this managed object.- Specified by:
getManagedObjectDefinition
in interfaceManagedObject<T extends ConfigurationClient>
- Returns:
- Returns the definition associated with this managed object.
-
getManagedObjectPath
public final ManagedObjectPath<T,? extends Configuration> getManagedObjectPath()
Description copied from interface:ManagedObject
Gets the path of this managed object.- Specified by:
getManagedObjectPath
in interfaceManagedObject<T extends ConfigurationClient>
- Returns:
- Returns the path of this managed object.
-
getPropertyDefaultValues
public final <P> SortedSet<ValueOrExpression<P>> getPropertyDefaultValues(PropertyDefinition<P> pd)
Description copied from interface:ManagedObject
Gets a mutable copy of the set of default values for the specified property.- Specified by:
getPropertyDefaultValues
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
P
- The type of the property to be retrieved.- Parameters:
pd
- The property to be retrieved.- Returns:
- Returns the property's default values, or an empty set if there are no default values defined.
-
getPropertyValue
public final <P> ValueOrExpression<P> getPropertyValue(PropertyDefinition<P> pd)
Description copied from interface:ManagedObject
Gets the effective value of the specified property.See the class description for more information about how the effective property value is derived.
- Specified by:
getPropertyValue
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
P
- The type of the property to be retrieved.- Parameters:
pd
- The property to be retrieved.- Returns:
- Returns the property's effective value, or
null
if there is no effective value defined.
-
getPropertyValues
public final <P> SortedSet<ValueOrExpression<P>> getPropertyValues(PropertyDefinition<P> pd)
Description copied from interface:ManagedObject
Gets a mutable copy of the set of effective values for the specified property.See the class description for more information about how the effective property values are derived.
- Specified by:
getPropertyValues
in interfaceManagedObject<T extends ConfigurationClient>
- Specified by:
getPropertyValues
in interfacePropertyProvider
- Type Parameters:
P
- The type of the property to be retrieved.- Parameters:
pd
- The property to be retrieved.- Returns:
- Returns the property's effective values, or an empty set if there are no effective values defined.
-
hasChild
public final <C extends ConfigurationClient,S extends Configuration> boolean hasChild(OptionalRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Determines whether the optional managed object associated with the specified optional relations exists.- Specified by:
hasChild
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The optional relation definition.- Returns:
- Returns
true
if the optional managed object exists,false
otherwise. - Throws:
ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If there is any other error.
-
isPropertyPresent
public final boolean isPropertyPresent(PropertyDefinition<?> pd)
Description copied from interface:ManagedObject
Determines whether the specified property is set. If the property is unset, then any default behavior associated with the property applies.- Specified by:
isPropertyPresent
in interfaceManagedObject<T extends ConfigurationClient>
- Parameters:
pd
- The property definition.- Returns:
- Returns
true
if the property has been set, orfalse
if it is unset and any default behavior associated with the property applies.
-
listChildren
public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(InstantiableRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Lists the child managed objects associated with the specified instantiable relation.- Specified by:
listChildren
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The instantiable relation definition.- Returns:
- Returns the names of the child managed objects.
- Throws:
ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
listChildren
public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(InstantiableRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Lists the child managed objects associated with the specified instantiable relation which are a sub-type of the specified managed object definition.- Specified by:
listChildren
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- 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:
ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
listChildren
public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(SetRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Lists the child managed objects associated with the specified set relation.- Specified by:
listChildren
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The set relation definition.- Returns:
- Returns the names of the child managed objects which for set relations are the definition names of each managed object.
- Throws:
ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
listChildren
public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(SetRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Lists the child managed objects associated with the specified set relation which are a sub-type of the specified managed object definition.- Specified by:
listChildren
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The set relation definition.d
- The managed object definition.- Returns:
- Returns the names of the child managed objects which for set relations are the definition names of each managed object.
- Throws:
ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
removeChild
public final <C extends ConfigurationClient,S extends Configuration> void removeChild(InstantiableRelationDefinition<C,S> r, String name) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Removes the named instantiable child managed object.- Specified by:
removeChild
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The instantiable relation definition.name
- The name of the child managed object to be removed.- Throws:
ManagedObjectNotFoundException
- If the managed object could not be removed because it could not found on the server.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).ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
removeChild
public final <C extends ConfigurationClient,S extends Configuration> void removeChild(OptionalRelationDefinition<C,S> r) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Removes an optional child managed object.- Specified by:
removeChild
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The optional relation definition.- Throws:
ManagedObjectNotFoundException
- If the managed object could not be removed because it could not found on the server.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).ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
removeChild
public final <C extends ConfigurationClient,S extends Configuration> void removeChild(SetRelationDefinition<C,S> r, String name) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
Description copied from interface:ManagedObject
Removes s set child managed object.- Specified by:
removeChild
in interfaceManagedObject<T extends ConfigurationClient>
- 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:
r
- The set relation definition.name
- The name of the child managed object to be removed.- Throws:
ManagedObjectNotFoundException
- If the managed object could not be removed because it could not found on the server.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).ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
setPropertyValue
public final <P> void setPropertyValue(PropertyDefinition<P> pd, ValueOrExpression<P> value)
Description copied from interface:ManagedObject
Sets a new pending value for the specified property.See the class description for more information regarding pending values.
- Specified by:
setPropertyValue
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
P
- The type of the property to be modified.- Parameters:
pd
- The property to be modified.value
- The new pending value for the property, ornull
if the property should be reset to its default behavior.
-
setPropertyValues
public final <P> void setPropertyValues(PropertyDefinition<P> pd, Collection<ValueOrExpression<P>> values)
Description copied from interface:ManagedObject
Sets a new pending values for the specified property.See the class description for more information regarding pending values.
- Specified by:
setPropertyValues
in interfaceManagedObject<T extends ConfigurationClient>
- Type Parameters:
P
- The type of the property to be modified.- Parameters:
pd
- The property to be modified.values
- A non-null
set of new pending values for the property (an empty set indicates that the property should be reset to its default behavior). The set will not be referenced by this managed object.
-
addNewManagedObject
protected abstract void addNewManagedObject() throws LdapException, OperationRejectedException, ConcurrentModificationException, ManagedObjectAlreadyExistsException
Adds this new managed object.- Throws:
ManagedObjectAlreadyExistsException
- If the managed object cannot be added to the server because it already exists.ConcurrentModificationException
- If the managed object's parent has been removed by another client.OperationRejectedException
- If the managed object cannot be added due to some client-side or server-side constraint which cannot be satisfied.LdapException
- If any other error occurs.
-
getDriver
protected abstract Driver getDriver()
Gets the management context driver associated with this managed object.- Returns:
- Returns the management context driver associated with this managed object.
-
getNamingPropertyDefinition
protected final PropertyDefinition<?> getNamingPropertyDefinition()
Gets the naming property definition associated with this managed object.- Returns:
- Returns the naming property definition associated with this
managed object, or
null
if this managed object does not have a naming property.
-
getProperty
protected final <P> Property<P> getProperty(PropertyDefinition<P> pd)
Gets the property associated with the specified property definition.- Type Parameters:
P
- The underlying type of the property.- Parameters:
pd
- The Property definition.- Returns:
- Returns the property associated with the specified property definition.
- Throws:
IllegalArgumentException
- If this property provider does not recognize the requested property definition.
-
modifyExistingManagedObject
protected abstract void modifyExistingManagedObject() throws ConcurrentModificationException, OperationRejectedException, LdapException
Applies changes made to this managed object.- Throws:
ConcurrentModificationException
- If this managed object has been removed from the server by another client.OperationRejectedException
- If the managed object cannot be added due to some client-side or server-side constraint which cannot be satisfied.LdapException
- If any other error occurs.
-
newInstance
protected abstract <M extends ConfigurationClient> ManagedObject<M> newInstance(ManagedObjectDefinition<M,?> d, ManagedObjectPath<M,?> path, PropertySet properties, PropertyDefinition<?> namingPropertyDefinition)
Creates a new managed object.- Type Parameters:
M
- The type of client configuration represented by the client managed object.- Parameters:
d
- The managed object's definition.path
- The managed object's path.properties
- The managed object's properties.namingPropertyDefinition
- Optional naming property definition.- Returns:
- Returns the new managed object.
-
-