T
- The type of client configuration represented by the client managed
object.public abstract class AbstractManagedObject<T extends ConfigurationClient> extends Object implements ManagedObject<T>
Modifier | Constructor and 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.
|
Modifier and Type | Method and 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> |
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> |
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> |
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> |
getChild(InstantiableRelationDefinition<C,S> r,
String name)
Retrieves an instantiable child managed object.
|
<C extends ConfigurationClient,S extends Configuration> |
getChild(OptionalRelationDefinition<C,S> r)
Retrieves an optional child managed object.
|
<C extends ConfigurationClient,S extends Configuration> |
getChild(SetRelationDefinition<C,S> r,
String name)
Retrieves a set child managed object.
|
<C extends ConfigurationClient,S extends Configuration> |
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<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> |
hasChild(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> |
listChildren(InstantiableRelationDefinition<C,S> r)
Lists the child managed objects associated with the specified
instantiable relation.
|
<C extends ConfigurationClient,S extends Configuration> |
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> |
listChildren(SetRelationDefinition<C,S> r)
Lists the child managed objects associated with the specified set
relation.
|
<C extends ConfigurationClient,S extends Configuration> |
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> |
newInstance(ManagedObjectDefinition<M,?> d,
ManagedObjectPath<M,?> path,
PropertySet properties,
boolean existsOnServer,
PropertyDefinition<?> namingPropertyDefinition)
Creates a new managed object.
|
<C extends ConfigurationClient,S extends Configuration> |
removeChild(InstantiableRelationDefinition<C,S> r,
String name)
Removes the named instantiable child managed object.
|
<C extends ConfigurationClient,S extends Configuration> |
removeChild(OptionalRelationDefinition<C,S> r)
Removes an optional child managed object.
|
<C extends ConfigurationClient,S extends Configuration> |
removeChild(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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isModified
protected AbstractManagedObject(ManagedObjectDefinition<T,? extends Configuration> d, ManagedObjectPath<T,? extends Configuration> path, PropertySet properties, boolean existsOnServer, PropertyDefinition<?> namingPropertyDefinition)
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.public final void commit() throws ManagedObjectAlreadyExistsException, MissingMandatoryPropertiesException, ConcurrentModificationException, OperationRejectedException, LdapException
ManagedObject
See the class description for more information regarding pending and active values.
commit
in interface ManagedObject<T extends ConfigurationClient>
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.public boolean isModified(PropertyDefinition<?> pd)
ManagedObject
isModified
in interface ManagedObject<T extends ConfigurationClient>
pd
- The property definition.true
if the provided property has been modified since this managed object was
constructed.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
ManagedObject
ManagedObject.commit()
method.createChild
in interface ManagedObject<T extends ConfigurationClient>
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.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 any
PropertyException
s that occurred whilst
attempting to determine the managed object's default values.IllegalManagedObjectNameException
- If the name of the child managed object is invalid.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)
ManagedObject
ManagedObject.commit()
method.createChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The optional relation definition.d
- The definition of the managed object to be created.exceptions
- A collection in which to place any
PropertyException
s that occurred whilst
attempting to determine the managed object's default values.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)
ManagedObject
ManagedObject.commit()
method.createChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The set relation definition.d
- The definition of the managed object to be created.exceptions
- A collection in which to place any
PropertyException
s that occurred whilst
attempting to determine the managed object's default values.public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(InstantiableRelationDefinition<C,S> r, String name) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
ManagedObject
getChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The instantiable relation definition.name
- The name of the child managed object.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.public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(OptionalRelationDefinition<C,S> r) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
ManagedObject
getChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The optional relation 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.public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(SingletonRelationDefinition<C,S> r) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
ManagedObject
getChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The singleton relation 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.public final <C extends ConfigurationClient,S extends Configuration> ManagedObject<? extends C> getChild(SetRelationDefinition<C,S> r, String name) throws DefinitionDecodingException, ManagedObjectDecodingException, ManagedObjectNotFoundException, ConcurrentModificationException, LdapException
ManagedObject
getChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The set relation definition.name
- The name of the child managed object.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.public final T getConfiguration()
ManagedObject
getConfiguration
in interface ManagedObject<T extends ConfigurationClient>
public final ManagedObjectDefinition<T,? extends Configuration> getManagedObjectDefinition()
ManagedObject
getManagedObjectDefinition
in interface ManagedObject<T extends ConfigurationClient>
public final ManagedObjectPath<T,? extends Configuration> getManagedObjectPath()
ManagedObject
getManagedObjectPath
in interface ManagedObject<T extends ConfigurationClient>
public final <P> SortedSet<P> getPropertyDefaultValues(PropertyDefinition<P> pd)
ManagedObject
getPropertyDefaultValues
in interface ManagedObject<T extends ConfigurationClient>
P
- The type of the property to be retrieved.pd
- The property to be retrieved.public final <P> ValueOrExpression<P> getPropertyValue(PropertyDefinition<P> pd)
ManagedObject
See the class description for more information about how the effective property value is derived.
getPropertyValue
in interface ManagedObject<T extends ConfigurationClient>
P
- The type of the property to be retrieved.pd
- The property to be retrieved.null
if
there is no effective value defined.public final <P> SortedSet<ValueOrExpression<P>> getPropertyValues(PropertyDefinition<P> pd)
ManagedObject
See the class description for more information about how the effective property values are derived.
getPropertyValues
in interface ManagedObject<T extends ConfigurationClient>
getPropertyValues
in interface PropertyProvider
P
- The type of the property to be retrieved.pd
- The property to be retrieved.public final <C extends ConfigurationClient,S extends Configuration> boolean hasChild(OptionalRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
ManagedObject
hasChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The optional relation definition.true
if the optional managed object exists,
false
otherwise.ConcurrentModificationException
- If this managed object has been removed from the server by
another client.LdapException
- If there is any other error.public final boolean isPropertyPresent(PropertyDefinition<?> pd)
ManagedObject
isPropertyPresent
in interface ManagedObject<T extends ConfigurationClient>
pd
- The property definition.true
if the property has been set, or
false
if it is unset and any default behavior
associated with the property applies.public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(InstantiableRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
ManagedObject
listChildren
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The instantiable relation definition.ConcurrentModificationException
- If this managed object has been removed from the server by
another client.LdapException
- If any other error occurs.public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(InstantiableRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ConcurrentModificationException, LdapException
ManagedObject
listChildren
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The instantiable relation definition.d
- The managed object definition.ConcurrentModificationException
- If this managed object has been removed from the server by
another client.LdapException
- If any other error occurs.public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(SetRelationDefinition<C,S> r) throws ConcurrentModificationException, LdapException
ManagedObject
listChildren
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The set relation definition.ConcurrentModificationException
- If this managed object has been removed from the server by
another client.LdapException
- If any other error occurs.public final <C extends ConfigurationClient,S extends Configuration> String[] listChildren(SetRelationDefinition<C,S> r, AbstractManagedObjectDefinition<? extends C,? extends S> d) throws ConcurrentModificationException, LdapException
ManagedObject
listChildren
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The set relation definition.d
- The managed object definition.ConcurrentModificationException
- If this managed object has been removed from the server by
another client.LdapException
- If any other error occurs.public final <C extends ConfigurationClient,S extends Configuration> void removeChild(InstantiableRelationDefinition<C,S> r, String name) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
ManagedObject
removeChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The instantiable relation definition.name
- The name of the child managed object to be removed.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.public final <C extends ConfigurationClient,S extends Configuration> void removeChild(OptionalRelationDefinition<C,S> r) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
ManagedObject
removeChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The optional relation 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.public final <C extends ConfigurationClient,S extends Configuration> void removeChild(SetRelationDefinition<C,S> r, String name) throws ManagedObjectNotFoundException, OperationRejectedException, ConcurrentModificationException, LdapException
ManagedObject
removeChild
in interface ManagedObject<T extends ConfigurationClient>
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.r
- The set relation definition.name
- The name of the child managed object to be removed.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.public final <P> void setPropertyValue(PropertyDefinition<P> pd, ValueOrExpression<P> value)
ManagedObject
See the class description for more information regarding pending values.
setPropertyValue
in interface ManagedObject<T extends ConfigurationClient>
P
- The type of the property to be modified.pd
- The property to be modified.value
- The new pending value for the property, or null
if the property should be reset to its default behavior.public final <P> void setPropertyValues(PropertyDefinition<P> pd, Collection<ValueOrExpression<P>> values)
ManagedObject
See the class description for more information regarding pending values.
setPropertyValues
in interface ManagedObject<T extends ConfigurationClient>
P
- The type of the property to be modified.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.protected abstract void addNewManagedObject() throws LdapException, OperationRejectedException, ConcurrentModificationException, ManagedObjectAlreadyExistsException
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.protected abstract Driver getDriver()
protected final PropertyDefinition<?> getNamingPropertyDefinition()
null
if this managed object does
not have a naming property.protected final <P> Property<P> getProperty(PropertyDefinition<P> pd)
P
- The underlying type of the property.pd
- The Property definition.IllegalArgumentException
- If this property provider does not recognize the requested
property definition.protected abstract void modifyExistingManagedObject() throws ConcurrentModificationException, OperationRejectedException, LdapException
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.protected abstract <M extends ConfigurationClient> ManagedObject<M> newInstance(ManagedObjectDefinition<M,?> d, ManagedObjectPath<M,?> path, PropertySet properties, boolean existsOnServer, PropertyDefinition<?> namingPropertyDefinition)
M
- The type of client configuration represented by the client
managed object.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.Copyright 2010-2018 ForgeRock AS.