Package org.forgerock.opendj.config
Class AbstractManagedObjectDefinition<C extends ConfigurationClient,S extends Configuration>
java.lang.Object
org.forgerock.opendj.config.AbstractManagedObjectDefinition<C,S>
- Type Parameters:
C
- The type of client managed object configuration that this definition represents.S
- The type of server managed object configuration that this definition represents.
- Direct Known Subclasses:
AuthenticationPolicyCfgDefn
,CommonAuditAccessLogPublisherCfgDefn
,HttpAuthorizationMechanismCfgDefn
,LocalBackendCfgDefn
,LogPublisherCfgDefn
,ManagedObjectDefinition
,NetConnectionHandlerCfgDefn
,PluggableBackendCfgDefn
,TopCfgDefn
public abstract class AbstractManagedObjectDefinition<C extends ConfigurationClient,S extends Configuration>
extends Object
Defines the structure of an abstract managed object. Abstract managed objects
cannot be instantiated.
Applications can query a managed object definition in order to determine the overall configuration model of an application.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractManagedObjectDefinition
(String name, AbstractManagedObjectDefinition<? super C, ? super S> parent) Create a new abstract managed object definition. -
Method Summary
Modifier and TypeMethodDescriptionfinal Collection
<AggregationPropertyDefinition<?, ?>> Returns an unmodifiable collection containing the aggregation property definitions defined by this managed object definition.final Collection
<AggregationPropertyDefinition<?, ?>> Returns an unmodifiable collection containing all the aggregation property definitions associated with this type of managed object.final Collection
<AbstractManagedObjectDefinition<? extends C, ? extends S>> Get all the child managed object definitions which inherit from this managed object definition.final Collection
<Constraint> Get all the constraints associated with this type of managed object.final Collection
<PropertyDefinition<?>> Returns an unmodifiable collection containing all the property definitions associated with this type of managed object.final Collection
<RelationDefinition<?, ?>> Returns an unmodifiable collection containing all the relation definitions associated with this type of managed object.final Collection
<RelationDefinition<? super C, ? super S>> Get all the relation definitions which refer to this managed object definition.final Collection
<Tag> Returns an unmodifiable collection containing all the tags associated with this type of managed object.final AbstractManagedObjectDefinition
<? extends C, ? extends S> Returns the named child managed object definition which inherits from this managed object definition.final Collection
<AbstractManagedObjectDefinition<? extends C, ? extends S>> Get the child managed object definitions which inherit directly from this managed object definition.final Collection
<Constraint> Returns an unmodifiable collection containing the constraints defined by this managed object definition.final Deprecated
Returns Deprecation information about this managed object if it is deprecated, otherwise null.final LocalizableMessage
Returns the description of this managed object definition in the default locale, ornull
if there is no description.final LocalizableMessage
getDescription
(Locale locale) Returns the description of this managed object definition in the specified locale, ornull
if there is no description.final String
getName()
Returns the name of the definition.final AbstractManagedObjectDefinition
<? super C, ? super S> Returns the parent of this managed object definition, ornull
if this definition is theTopCfgDefn
.final PropertyDefinition
<?> getPropertyDefinition
(String name) Returns the specified property definition associated with this type of managed object.final Collection
<PropertyDefinition<?>> Returns an unmodifiable collection containing the property definitions defined by this managed object definition.final RelationDefinition
<?, ?> getRelationDefinition
(String name) Returns the specified relation definition associated with this type of managed object.final Collection
<RelationDefinition<?, ?>> Returns an unmodifiable collection containing the relation definitions defined by this managed object definition.final Collection
<AggregationPropertyDefinition<?, ?>> Returns an unmodifiable collection containing the aggregation property definitions which refer directly to this managed object definition.final Collection
<RelationDefinition<C, S>> Returns Returns an unmodifiable collection containing the relation definitions which refer directly to this managed object definition.final LocalizableMessage
Returns the synopsis of this managed object definition in the default locale.final LocalizableMessage
getSynopsis
(Locale locale) Returns the synopsis of this managed object definition in the specified locale.final LocalizableMessage
Returns the user-friendly name of this managed object definition in the default locale.final LocalizableMessage
getUserFriendlyName
(Locale locale) Returns the user-friendly name of this managed object definition in the specified locale.final LocalizableMessage
Returns the user-friendly plural name of this managed object definition in the default locale.final LocalizableMessage
getUserFriendlyPluralName
(Locale locale) Returns the user-friendly plural name of this managed object definition in the specified locale.final boolean
Returns whether this type of managed object has any child managed object definitions which inherit from this managed object definition.final boolean
hasOption
(ManagedObjectOption option) Returns whether this managed object definition has the specified option.final boolean
Returns whether this managed object definition has the specified tag.protected final void
Initializes all the components associated with this managed object definition.final boolean
Returns whether this managed object definition is a sub-type of the provided managed object definition.final boolean
Returns whether this managed object definition is a super-type of the provided managed object definition.final boolean
isTop()
Determines whether this managed object definition is theTopCfgDefn
.protected final void
registerConstraint
(Constraint constraint) Register a constraint with this managed object definition.protected final void
registerDeprecated
(Deprecated deprecated) Register a deprecation with this managed object definition.protected final void
registerOption
(ManagedObjectOption option) Register an option with this managed object definition.protected final void
Register a property definition with this managed object definition, overriding any existing property definition with the same name.protected final void
Register a relation definition with this managed object definition, overriding any existing relation definition with the same name.protected final void
registerTag
(Tag tag) Register a tag with this managed object definition.final ManagedObjectDefinition
<? extends C, ? extends S> Returns the sub-type of this managed object definition which most closely corresponds to the matching criteria of the provided definition resolver.final String
toString()
final void
toString
(StringBuilder builder) Append a string representation of the managed object definition to the provided string builder.
-
Constructor Details
-
AbstractManagedObjectDefinition
protected AbstractManagedObjectDefinition(String name, AbstractManagedObjectDefinition<? super C, ? super S> parent) Create a new abstract managed object definition.- Parameters:
name
- The name of the definition.parent
- The parent definition, ornull
if there is no parent (only theTopCfgDefn
should have anull
parent, unless the definition is being used for testing).
-
-
Method Details
-
getDeprecated
Returns Deprecation information about this managed object if it is deprecated, otherwise null.- Returns:
- Deprecation information about this managed object if it is deprecated, otherwise null
-
getAllChildren
Get all the child managed object definitions which inherit from this managed object definition.- Returns:
- Returns an unmodifiable collection containing all the subordinate managed object definitions which inherit from this managed object definition.
-
getAllConstraints
Get all the constraints associated with this type of managed object. The returned collection will contain inherited constraints.- Returns:
- Returns a collection containing all the constraints associated with this type of managed object. The caller is free to modify the collection if required.
-
getAllPropertyDefinitions
Returns an unmodifiable collection containing all the property definitions associated with this type of managed object.. The returned collection will contain inherited property- Returns:
- an unmodifiable collection containing all the property definitions associated with this type of managed object
-
getAllRelationDefinitions
Returns an unmodifiable collection containing all the relation definitions associated with this type of managed object.. The returned collection will contain inherited relation definitions.- Returns:
- an unmodifiable collection containing all the relation definitions associated with this type of managed object
-
getAllReverseRelationDefinitions
Get all the relation definitions which refer to this managed object definition. The returned collection will contain relation definitions which refer to parents of this managed object definition.- Returns:
- Returns a collection containing all the relation definitions which refer to this managed object definition. The caller is free to modify the collection if required.
-
getAllAggregationPropertyDefinitions
Returns an unmodifiable collection containing all the aggregation property definitions associated with this type of managed object. The returned collection will contain inherited aggregation property definitions.- Returns:
- an unmodifiable collection containing all the aggregation property definitions associated with this type of managed object
-
getAllTags
Returns an unmodifiable collection containing all the tags associated with this type of managed object. The returned collection will contain inherited tags.- Returns:
- an unmodifiable collection containing all the tags associated with this type of managed object
-
getChild
Returns the named child managed object definition which inherits from this managed object definition. This method will recursively search down through the inheritance hierarchy.- Parameters:
name
- The name of the managed object definition sub-type.- Returns:
- the named child managed object definition which inherits from this managed object definition
- Throws:
IllegalArgumentException
- If the specified managed object definition name was null or empty or if the requested subordinate managed object definition was not found.
-
getChildren
Get the child managed object definitions which inherit directly from this managed object definition.- Returns:
- Returns an unmodifiable collection containing the subordinate managed object definitions which inherit directly from this managed object definition.
-
getConstraints
Returns an unmodifiable collection containing the constraints defined by this managed object definition. The returned collection will not contain inherited constraints.- Returns:
- an unmodifiable collection containing the constraints defined by this managed object definition
-
getDescription
Returns the description of this managed object definition in the default locale, ornull
if there is no description..- Returns:
- the description of this managed object definition in the default locale,
or
null
if there is no description - Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getDescription
Returns the description of this managed object definition in the specified locale, ornull
if there is no description..- Parameters:
locale
- The locale.- Returns:
- the description of this managed object definition in the specified locale,
or
null
if there is no description - Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getName
Returns the name of the definition.- Returns:
- the name of the definition
-
getParent
Returns the parent of this managed object definition, ornull
if this definition is theTopCfgDefn
.- Returns:
- the parent of this managed object definition, or
null
if this definition is theTopCfgDefn
-
getPropertyDefinition
public final PropertyDefinition<?> getPropertyDefinition(String name) throws IllegalArgumentException Returns the specified property definition associated with this type of managed object. The search will include any inherited property definitions.- Parameters:
name
- The name of the property definition to be retrieved.- Returns:
- the specified property definition associated with this type of managed object
- Throws:
IllegalArgumentException
- If the specified property name was null or empty or if the requested property definition was not found.
-
getPropertyDefinitions
Returns an unmodifiable collection containing the property definitions defined by this managed object definition. The returned collection will not contain inherited property definitions.- Returns:
- an unmodifiable collection containing the property definitions defined by this managed object definition
-
getRelationDefinition
Returns the specified relation definition associated with this type of managed object. The search will include any inherited relation definitions.- Parameters:
name
- The name of the relation definition to be retrieved.- Returns:
- the specified relation definition associated with this type of managed object
- Throws:
IllegalArgumentException
- If the specified relation name was null or empty or if the requested relation definition was not found.
-
getRelationDefinitions
Returns an unmodifiable collection containing the relation definitions defined by this managed object definition. The returned collection will not contain inherited relation definitions.- Returns:
- an unmodifiable collection containing the relation definitions defined by this managed object definition
-
getReverseRelationDefinitions
Returns Returns an unmodifiable collection containing the relation definitions which refer directly to this managed object definition. The returned collection will not contain relation definitions which refer to parents of this managed object definition.- Returns:
- Returns an unmodifiable collection containing the relation definitions which refer directly to this managed object definition
-
getAggregationPropertyDefinitions
Returns an unmodifiable collection containing the aggregation property definitions defined by this managed object definition. The returned collection will not contain inherited aggregation property definitions.- Returns:
- an unmodifiable collection containing the aggregation property definitions defined by this managed object definition
-
getReverseAggregationPropertyDefinitions
public final Collection<AggregationPropertyDefinition<?,?>> getReverseAggregationPropertyDefinitions()Returns an unmodifiable collection containing the aggregation property definitions which refer directly to this managed object definition. The returned collection will not contain aggregation property definitions which refer to parents of this managed object definition.- Returns:
- an unmodifiable collection containing the aggregation property definitions which refer directly to this managed object definition
-
getSynopsis
Returns the synopsis of this managed object definition in the default locale.- Returns:
- the synopsis of this managed object definition in the default locale
- Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getSynopsis
Returns the synopsis of this managed object definition in the specified locale.- Parameters:
locale
- The locale.- Returns:
- the synopsis of this managed object definition in the specified locale
- Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getUserFriendlyName
Returns the user-friendly name of this managed object definition in the default locale.- Returns:
- the user-friendly name of this managed object definition in the default locale
- Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getUserFriendlyName
Returns the user-friendly name of this managed object definition in the specified locale.- Parameters:
locale
- The locale}- Returns:
- the user-friendly name of this managed object definition in the specified locale
- Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getUserFriendlyPluralName
Returns the user-friendly plural name of this managed object definition in the default locale.- Returns:
- the user-friendly plural name of this managed object definition in the default locale
- Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
getUserFriendlyPluralName
Returns the user-friendly plural name of this managed object definition in the specified locale.- Parameters:
locale
- The locale.- Returns:
- the user-friendly plural name of this managed object definition in the specified locale
- Throws:
UnsupportedOperationException
- If this managed object definition is theTopCfgDefn
.
-
hasChildren
public final boolean hasChildren()Returns whether this type of managed object has any child managed object definitions which inherit from this managed object definition..- Returns:
- whether this type of managed object has any child managed object definitions which inherit from this managed object definition
-
hasOption
Returns whether this managed object definition has the specified option.- Parameters:
option
- The option to test.- Returns:
- whether this managed object definition has the specified option
-
hasTag
Returns whether this managed object definition has the specified tag.- Parameters:
t
- The tag definition.- Returns:
- whether this managed object definition has the specified tag
-
isChildOf
Returns whether this managed object definition is a sub-type of the provided managed object definition. This managed object definition is a sub-type of the provided managed object definition if they are both the same or if the provided managed object definition can be obtained by recursive invocations of thegetParent()
method.- Parameters:
d
- The managed object definition to be checked.- Returns:
- whether this managed object definition is a sub-type of the provided managed object definition
-
isParentOf
Returns whether this managed object definition is a super-type of the provided managed object definition. This managed object definition is a super-type of the provided managed object definition if they are both the same or if the provided managed object definition is a member of the set of children returned fromgetAllChildren()
.- Parameters:
d
- The managed object definition to be checked.- Returns:
- whether this managed object definition is a super-type of the provided managed object definition
-
isTop
public final boolean isTop()Determines whether this managed object definition is theTopCfgDefn
.- Returns:
- Returns
true
if this managed object definition is theTopCfgDefn
.
-
resolveManagedObjectDefinition
public final ManagedObjectDefinition<? extends C,? extends S> resolveManagedObjectDefinition(DefinitionResolver r) throws DefinitionDecodingException Returns the sub-type of this managed object definition which most closely corresponds to the matching criteria of the provided definition resolver..- Parameters:
r
- The definition resolver.- Returns:
- the sub-type of this managed object definition which most closely corresponds to the matching criteria of the provided definition resolver
- Throws:
DefinitionDecodingException
- If no matching sub-type could be found or if the resolved definition was abstract.
-
toString
-
toString
Append a string representation of the managed object definition to the provided string builder.- Parameters:
builder
- The string builder where the string representation should be appended.
-
initialize
Initializes all the components associated with this managed object definition.- Throws:
Exception
- If this managed object definition could not be initialized.
-
registerDeprecated
Register a deprecation with this managed object definition.This method must not be called by applications.
- Parameters:
deprecated
- The deprecated to be registered.
-
registerConstraint
Register a constraint with this managed object definition.This method must not be called by applications.
- Parameters:
constraint
- The constraint to be registered.
-
registerPropertyDefinition
Register a property definition with this managed object definition, overriding any existing property definition with the same name.This method must not be called by applications.
- Parameters:
d
- The property definition to be registered.
-
registerRelationDefinition
Register a relation definition with this managed object definition, overriding any existing relation definition with the same name.This method must not be called by applications.
- Parameters:
d
- The relation definition to be registered.
-
registerOption
Register an option with this managed object definition.This method must not be called by applications.
- Parameters:
option
- The option to be registered.
-
registerTag
Register a tag with this managed object definition.This method must not be called by applications.
- Parameters:
tag
- The tag to be registered.
-