Interface ManagedObject<T extends ConfigurationClient>
-
- Type Parameters:
T
- The type of client configuration represented by the client managed object.
- All Superinterfaces:
PropertyProvider
- All Known Implementing Classes:
AbstractManagedObject
public interface ManagedObject<T extends ConfigurationClient> extends PropertyProvider
A generic interface for accessing client-side managed objects.A managed object comprises of zero or more properties. A property has associated with it three sets of property value(s). These are:
- default value(s) - these value(s) represent the default behavior for the property when it has no active values. When a property inherits its default value(s) from elsewhere (i.e. a property in another managed object), the default value(s) represent the active value(s) of the inherited property at the time the managed object was retrieved
- active value(s) - these value(s) represent the state of the property at the time the managed object was retrieved
- pending value(s) - these value(s) represent any modifications made
to the property's value(s) since the managed object object was retrieved and
before the changes have been committed using the
commit()
method, the pending values can be empty indicating that the property should be modified back to its default values.
- the pending values if defined and non-empty
- or, the default values if the pending values are defined but are empty
- or, the active values if defined and non-empty
- or, the default values if there are no active values
- or, an empty set of values, if there are no default values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.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.<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()
Determines whether this managed object has been modified since it was constructed.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.<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.
-
-
-
Method Detail
-
commit
void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException, ConcurrentModificationException, OperationRejectedException, LdapException
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.
- 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
boolean isModified()
Determines whether this managed object has been modified since it was constructed. In other words, whether the set of pending values differs from the set of active values.- Returns:
- Returns
true
if this managed object has been modified since it was constructed.
-
isModified
boolean isModified(PropertyDefinition<?> pd)
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.- Parameters:
pd
- The property definition.- Returns:
- Returns
true
if the provided property has been modified since this managed object was constructed.
-
createChild
<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
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 thecommit()
method.- 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.IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.
-
createChild
<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. 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 thecommit()
method.- 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.
- Throws:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.
-
createChild
<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. 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 thecommit()
method.- 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.
- Throws:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.
-
getChild
<C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(InstantiableRelationDefinition<C,S> r, String name) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Retrieves an instantiable child managed object.- 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:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.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
<C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(OptionalRelationDefinition<C,S> r) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Retrieves an optional child managed object.- 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:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.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
<C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(SingletonRelationDefinition<C,S> r) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Retrieves a singleton child managed object.- 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:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.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
<C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(SetRelationDefinition<C,S> r, String name) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
Retrieves a set child managed object.- 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:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.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
T getConfiguration()
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.- Returns:
- Returns a client configuration view of this managed object.
-
getManagedObjectDefinition
ManagedObjectDefinition<T,? extends Configuration> getManagedObjectDefinition()
Gets the definition associated with this managed object.- Returns:
- Returns the definition associated with this managed object.
-
getManagedObjectPath
ManagedObjectPath<T,? extends Configuration> getManagedObjectPath()
Gets the path of this managed object.- Returns:
- Returns the path of this managed object.
-
getPropertyDefaultValues
<P> SortedSet<ValueOrExpression<P>> getPropertyDefaultValues(PropertyDefinition<P> pd)
Gets a mutable copy of the set of default values for the specified property.- 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.
- Throws:
IllegalArgumentException
- If the property definition is not associated with this managed object's definition.
-
getPropertyValue
<P> ValueOrExpression<P> getPropertyValue(PropertyDefinition<P> pd)
Gets the effective value of the specified property.See the class description for more information about how the effective property value is derived.
- 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. - Throws:
IllegalArgumentException
- If the property definition is not associated with this managed object's definition.
-
getPropertyValues
<P> SortedSet<ValueOrExpression<P>> getPropertyValues(PropertyDefinition<P> pd)
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 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.
- Throws:
IllegalArgumentException
- If the property definition is not associated with this managed object's definition.
-
isPropertyPresent
boolean isPropertyPresent(PropertyDefinition<?> pd)
Determines whether the specified property is set. If the property is unset, then any default behavior associated with the property applies.- 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. - Throws:
IllegalArgumentException
- If the property definition is not associated with this managed object's definition.
-
hasChild
<C extends ConfigurationClient,S extends Configuration> boolean hasChild(OptionalRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
Determines whether the optional managed object associated with the specified optional relations exists.- 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.
-
listChildren
<C extends ConfigurationClient,S extends Configuration> String[] listChildren(InstantiableRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
Lists the child managed objects associated with the specified instantiable relation.- 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:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
listChildren
<C extends ConfigurationClient,S extends Configuration> String[] listChildren(InstantiableRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ConcurrentModificationException, LdapException
Lists the child managed objects associated with the specified instantiable relation 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:
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
<C extends ConfigurationClient,S extends Configuration> String[] listChildren(SetRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
Lists the child managed objects associated with the specified set relation.- 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
<C extends ConfigurationClient,S extends Configuration> String[] listChildren(SetRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ConcurrentModificationException, LdapException
Lists the child managed objects associated with the specified set relation 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:
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:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.ConcurrentModificationException
- If this managed object has been removed from the server by another client.LdapException
- If any other error occurs.
-
removeChild
<C extends ConfigurationClient,S extends Configuration> void removeChild(InstantiableRelationDefinition<C,S> r, String name) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
Removes the named instantiable child 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:
r
- The instantiable relation definition.name
- The name of the child managed object to be removed.- Throws:
IllegalArgumentException
- If the relation definition is not associated with this managed object's definition.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
<C extends ConfigurationClient,S extends Configuration> void removeChild(OptionalRelationDefinition<C,S> r) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
Removes an optional child 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:
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
<C extends ConfigurationClient,S extends Configuration> void removeChild(SetRelationDefinition<C,S> r, String name) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
Removes s set child 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:
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
<P> void setPropertyValue(PropertyDefinition<P> pd, ValueOrExpression<P> value)
Sets a new pending value for the specified property.See the class description for more information regarding pending values.
- 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.- Throws:
PropertyException
- If this is not a new managed object and the property is read-only or for monitoring purposes.PropertyException
- If an attempt was made to remove a mandatory property.
-
setPropertyValues
<P> void setPropertyValues(PropertyDefinition<P> pd, Collection<ValueOrExpression<P>> values)
Sets a new pending values for the specified property.See the class description for more information regarding pending values.
- 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.- Throws:
PropertyException
- If an attempt was made to add multiple pending values to a single-valued property.PropertyException
- If this is not a new managed object and the property is read-only or for monitoring purposes.PropertyException
- If an attempt was made to remove a mandatory property.
-
-