org.opends.server.admin
Class AbstractManagedObjectDefinition<C extends ConfigurationClient,S extends Configuration>

java.lang.Object
  extended by org.opends.server.admin.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:
LogPublisherCfgDefn, ManagedObjectDefinition, MatchingRuleCfgDefn, TopCfgDefn

public abstract class AbstractManagedObjectDefinition<C extends ConfigurationClient,S extends Configuration>
extends java.lang.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
protected AbstractManagedObjectDefinition(java.lang.String name, AbstractManagedObjectDefinition<? super C,? super S> parent)
          Create a new abstract managed object definition.
 
Method Summary
 AggregationPropertyDefinition<?,?> getAggregationPropertyDefinition(java.lang.String name)
          Get the specified aggregation property definition associated with this type of managed object.The search will include any inherited aggregation property definitions.
 java.util.Collection<AggregationPropertyDefinition<?,?>> getAggregationPropertyDefinitions()
          Get the aggregation property definitions defined by this managed object definition.
 java.util.Collection<AggregationPropertyDefinition<?,?>> getAllAggregationPropertyDefinitions()
          Get all the aggregation property definitions associated with this type of managed object.
 java.util.Collection<AbstractManagedObjectDefinition<? extends C,? extends S>> getAllChildren()
          Get all the child managed object definitions which inherit from this managed object definition.
 java.util.Collection<Constraint> getAllConstraints()
          Get all the constraints associated with this type of managed object.
 java.util.Collection<PropertyDefinition<?>> getAllPropertyDefinitions()
          Get all the property definitions associated with this type of managed object.
 java.util.Collection<RelationDefinition<?,?>> getAllRelationDefinitions()
          Get all the relation definitions associated with this type of managed object.
 java.util.Collection<AggregationPropertyDefinition<?,?>> getAllReverseAggregationPropertyDefinitions()
          Get all the aggregation property definitions which refer to this managed object definition.
 java.util.Collection<RelationDefinition<? super C,? super S>> getAllReverseRelationDefinitions()
          Get all the relation definitions which refer to this managed object definition.
 java.util.Collection<Tag> getAllTags()
          Get all the tags associated with this type of managed object.
 AbstractManagedObjectDefinition<? extends C,? extends S> getChild(java.lang.String name)
          Get the named child managed object definition which inherits from this managed object definition.
 java.util.Collection<AbstractManagedObjectDefinition<? extends C,? extends S>> getChildren()
          Get the child managed object definitions which inherit directly from this managed object definition.
 java.util.Collection<Constraint> getConstraints()
          Get the constraints defined by this managed object definition.
 Message getDescription()
          Gets the optional description of this managed object definition in the default locale.
 Message getDescription(java.util.Locale locale)
          Gets the optional description of this managed object definition in the specified locale.
 java.lang.String getName()
          Get the name of the definition.
 AbstractManagedObjectDefinition<? super C,? super S> getParent()
          Get the parent managed object definition, if applicable.
 PropertyDefinition<?> getPropertyDefinition(java.lang.String name)
          Get the specified property definition associated with this type of managed object.
 java.util.Collection<PropertyDefinition<?>> getPropertyDefinitions()
          Get the property definitions defined by this managed object definition.
 RelationDefinition<?,?> getRelationDefinition(java.lang.String name)
          Get the specified relation definition associated with this type of managed object.The search will include any inherited relation definitions.
 java.util.Collection<RelationDefinition<?,?>> getRelationDefinitions()
          Get the relation definitions defined by this managed object definition.
 java.util.Collection<AggregationPropertyDefinition<?,?>> getReverseAggregationPropertyDefinitions()
          Get the aggregation property definitions which refer directly to this managed object definition.
 java.util.Collection<RelationDefinition<C,S>> getReverseRelationDefinitions()
          Get the relation definitions which refer directly to this managed object definition.
 Message getSynopsis()
          Gets the synopsis of this managed object definition in the default locale.
 Message getSynopsis(java.util.Locale locale)
          Gets the synopsis of this managed object definition in the specified locale.
 Message getUserFriendlyName()
          Gets the user friendly name of this managed object definition in the default locale.
 Message getUserFriendlyName(java.util.Locale locale)
          Gets the user friendly name of this managed object definition in the specified locale.
 Message getUserFriendlyPluralName()
          Gets the user friendly plural name of this managed object definition in the default locale.
 Message getUserFriendlyPluralName(java.util.Locale locale)
          Gets the user friendly plural name of this managed object definition in the specified locale.
 boolean hasChildren()
          Determine whether there are any child managed object definitions which inherit from this managed object definition.
 boolean hasOption(ManagedObjectOption option)
          Determines whether or not this managed object definition has the specified option.
 boolean hasTag(Tag t)
          Determines whether or not this managed object definition has the specified tag.
protected  void initialize()
          Initializes all of the components associated with this managed object definition.
 boolean isChildOf(AbstractManagedObjectDefinition<?,?> d)
          Determines whether or not this managed object definition is a sub-type of the provided managed object definition.
 boolean isParentOf(AbstractManagedObjectDefinition<?,?> d)
          Determines whether or not this managed object definition is a super-type of the provided managed object definition.
 boolean isTop()
          Determines whether or not this managed object definition is the TopCfgDefn.
protected  void registerConstraint(Constraint constraint)
          Register a constraint with this managed object definition.
protected  void registerOption(ManagedObjectOption option)
          Register an option with this managed object definition.
protected  void registerPropertyDefinition(PropertyDefinition<?> d)
          Register a property definition with this managed object definition, overriding any existing property definition with the same name.
protected  void registerRelationDefinition(RelationDefinition<?,?> d)
          Register a relation definition with this managed object definition, overriding any existing relation definition with the same name.
protected  void registerTag(Tag tag)
          Register a tag with this managed object definition.
 ManagedObjectDefinition<? extends C,? extends S> resolveManagedObjectDefinition(DefinitionResolver r)
          Finds a sub-type of this managed object definition which most closely corresponds to the matching criteria of the provided definition resolver.
 java.lang.String toString()
          
 void toString(java.lang.StringBuilder builder)
          Append a string representation of the managed object definition to the provided string builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractManagedObjectDefinition

protected AbstractManagedObjectDefinition(java.lang.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, or null if there is no parent (only the TopCfgDefn should have a null parent, unless the definition is being used for testing).
Method Detail

getAllChildren

public final java.util.Collection<AbstractManagedObjectDefinition<? extends C,? extends S>> 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

public final java.util.Collection<Constraint> 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

public final java.util.Collection<PropertyDefinition<?>> getAllPropertyDefinitions()
Get all the property definitions associated with this type of managed object. The returned collection will contain inherited property definitions.

Returns:
Returns an unmodifiable collection containing all the property definitions associated with this type of managed object.

getAllRelationDefinitions

public final java.util.Collection<RelationDefinition<?,?>> getAllRelationDefinitions()
Get all the relation definitions associated with this type of managed object. The returned collection will contain inherited relation definitions.

Returns:
Returns an unmodifiable collection containing all the relation definitions associated with this type of managed object.

getAllReverseRelationDefinitions

public final java.util.Collection<RelationDefinition<? super C,? super S>> 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

public final java.util.Collection<AggregationPropertyDefinition<?,?>> getAllAggregationPropertyDefinitions()
Get all the aggregation property definitions associated with this type of managed object. The returned collection will contain inherited aggregation property definitions.

Returns:
Returns an unmodifiable collection containing all the aggregation property definitions associated with this type of managed object.

getAllReverseAggregationPropertyDefinitions

public final java.util.Collection<AggregationPropertyDefinition<?,?>> getAllReverseAggregationPropertyDefinitions()
Get all the aggregation property definitions which refer to this managed object definition. The returned collection will contain aggregation property definitions which refer to parents of this managed object definition.

Returns:
Returns a collection containing all the aggregation property definitions which refer to this managed object definition. The caller is free to modify the collection if required.

getAllTags

public final java.util.Collection<Tag> getAllTags()
Get all the tags associated with this type of managed object. The returned collection will contain inherited tags.

Returns:
Returns an unmodifiable collection containing all the tags associated with this type of managed object.

getChild

public final AbstractManagedObjectDefinition<? extends C,? extends S> getChild(java.lang.String name)
                                                                                                                          throws java.lang.IllegalArgumentException
Get 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:
Returns the named child managed object definition which inherits from this managed object definition.
Throws:
java.lang.IllegalArgumentException - If the specified managed object definition name was null or empty or if the requested subordinate managed object definition was not found.

getChildren

public final java.util.Collection<AbstractManagedObjectDefinition<? extends C,? extends S>> 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

public final java.util.Collection<Constraint> getConstraints()
Get the constraints defined by this managed object definition. The returned collection will not contain inherited constraints.

Returns:
Returns an unmodifiable collection containing the constraints defined by this managed object definition.

getDescription

public final Message getDescription()
                             throws java.lang.UnsupportedOperationException
Gets the optional description of this managed object definition in the default locale.

Returns:
Returns the description of this managed object definition in the default locale, or null if there is no description.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getDescription

public final Message getDescription(java.util.Locale locale)
                             throws java.lang.UnsupportedOperationException
Gets the optional description of this managed object definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the description of this managed object definition in the specified locale, or null if there is no description.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getName

public final java.lang.String getName()
Get the name of the definition.

Returns:
Returns the name of the definition.

getParent

public final AbstractManagedObjectDefinition<? super C,? super S> getParent()
Get the parent managed object definition, if applicable.

Returns:
Returns the parent of this managed object definition, or null if this definition is the TopCfgDefn.

getPropertyDefinition

public final PropertyDefinition<?> getPropertyDefinition(java.lang.String name)
                                                  throws java.lang.IllegalArgumentException
Get 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:
Returns the specified property definition associated with this type of managed object.
Throws:
java.lang.IllegalArgumentException - If the specified property name was null or empty or if the requested property definition was not found.

getPropertyDefinitions

public final java.util.Collection<PropertyDefinition<?>> getPropertyDefinitions()
Get the property definitions defined by this managed object definition. The returned collection will not contain inherited property definitions.

Returns:
Returns an unmodifiable collection containing the property definitions defined by this managed object definition.

getRelationDefinition

public final RelationDefinition<?,?> getRelationDefinition(java.lang.String name)
                                                    throws java.lang.IllegalArgumentException
Get 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:
Returns the specified relation definition associated with this type of managed object.
Throws:
java.lang.IllegalArgumentException - If the specified relation name was null or empty or if the requested relation definition was not found.

getRelationDefinitions

public final java.util.Collection<RelationDefinition<?,?>> getRelationDefinitions()
Get the relation definitions defined by this managed object definition. The returned collection will not contain inherited relation definitions.

Returns:
Returns an unmodifiable collection containing the relation definitions defined by this managed object definition.

getReverseRelationDefinitions

public final java.util.Collection<RelationDefinition<C,S>> getReverseRelationDefinitions()
Get 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.

getAggregationPropertyDefinition

public final AggregationPropertyDefinition<?,?> getAggregationPropertyDefinition(java.lang.String name)
                                                                          throws java.lang.IllegalArgumentException
Get the specified aggregation property definition associated with this type of managed object.The search will include any inherited aggregation property definitions.

Parameters:
name - The name of the aggregation property definition to be retrieved.
Returns:
Returns the specified aggregation property definition associated with this type of managed object.
Throws:
java.lang.IllegalArgumentException - If the specified aggregation property name was null or empty or if the requested aggregation property definition was not found.

getAggregationPropertyDefinitions

public final java.util.Collection<AggregationPropertyDefinition<?,?>> getAggregationPropertyDefinitions()
Get the aggregation property definitions defined by this managed object definition. The returned collection will not contain inherited aggregation property definitions.

Returns:
Returns an unmodifiable collection containing the aggregation property definitions defined by this managed object definition.

getReverseAggregationPropertyDefinitions

public final java.util.Collection<AggregationPropertyDefinition<?,?>> getReverseAggregationPropertyDefinitions()
Get 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:
Returns an unmodifiable collection containing the aggregation property definitions which refer directly to this managed object definition.

getSynopsis

public final Message getSynopsis()
                          throws java.lang.UnsupportedOperationException
Gets the synopsis of this managed object definition in the default locale.

Returns:
Returns the synopsis of this managed object definition in the default locale.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getSynopsis

public final Message getSynopsis(java.util.Locale locale)
                          throws java.lang.UnsupportedOperationException
Gets the synopsis of this managed object definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the synopsis of this managed object definition in the specified locale.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getUserFriendlyName

public final Message getUserFriendlyName()
                                  throws java.lang.UnsupportedOperationException
Gets the user friendly name of this managed object definition in the default locale.

Returns:
Returns the user friendly name of this managed object definition in the default locale.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getUserFriendlyName

public final Message getUserFriendlyName(java.util.Locale locale)
                                  throws java.lang.UnsupportedOperationException
Gets the user friendly name of this managed object definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the user friendly name of this managed object definition in the specified locale.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getUserFriendlyPluralName

public final Message getUserFriendlyPluralName()
                                        throws java.lang.UnsupportedOperationException
Gets the user friendly plural name of this managed object definition in the default locale.

Returns:
Returns the user friendly plural name of this managed object definition in the default locale.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

getUserFriendlyPluralName

public final Message getUserFriendlyPluralName(java.util.Locale locale)
                                        throws java.lang.UnsupportedOperationException
Gets the user friendly plural name of this managed object definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the user friendly plural name of this managed object definition in the specified locale.
Throws:
java.lang.UnsupportedOperationException - If this managed object definition is the TopCfgDefn.

hasChildren

public final boolean hasChildren()
Determine whether there are any child managed object definitions which inherit from this managed object definition.

Returns:
Returns true if this type of managed object has any child managed object definitions, false otherwise.

hasOption

public final boolean hasOption(ManagedObjectOption option)
Determines whether or not this managed object definition has the specified option.

Parameters:
option - The option to test.
Returns:
Returns true if the option is set, or false otherwise.

hasTag

public final boolean hasTag(Tag t)
Determines whether or not this managed object definition has the specified tag.

Parameters:
t - The tag definition.
Returns:
Returns true if this managed object definition has the specified tag.

isChildOf

public final boolean isChildOf(AbstractManagedObjectDefinition<?,?> d)
Determines whether or not 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 the getParent() method.

Parameters:
d - The managed object definition to be checked.
Returns:
Returns true if this managed object definition is a sub-type of the provided managed object definition.

isParentOf

public final boolean isParentOf(AbstractManagedObjectDefinition<?,?> d)
Determines whether or not 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 from getAllChildren().

Parameters:
d - The managed object definition to be checked.
Returns:
Returns true if this managed object definition is a super-type of the provided managed object definition.

isTop

public final boolean isTop()
Determines whether or not this managed object definition is the TopCfgDefn.

Returns:
Returns true if this managed object definition is the TopCfgDefn.

resolveManagedObjectDefinition

public final ManagedObjectDefinition<? extends C,? extends S> resolveManagedObjectDefinition(DefinitionResolver r)
                                                                                                                                        throws DefinitionDecodingException
Finds a 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:
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.
See Also:
DefinitionResolver

toString

public final java.lang.String toString()

Overrides:
toString in class java.lang.Object

toString

public final void toString(java.lang.StringBuilder builder)
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

protected final void initialize()
                         throws java.lang.Exception
Initializes all of the components associated with this managed object definition.

Throws:
java.lang.Exception - If this managed object definition could not be initialized.

registerConstraint

protected final void registerConstraint(Constraint constraint)
Register a constraint with this managed object definition.

This method must not be called by applications.

Parameters:
constraint - The constraint to be registered.

registerPropertyDefinition

protected final void registerPropertyDefinition(PropertyDefinition<?> d)
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

protected final void registerRelationDefinition(RelationDefinition<?,?> d)
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

protected final void registerOption(ManagedObjectOption option)
Register an option with this managed object definition.

This method must not be called by applications.

Parameters:
option - The option to be registered.

registerTag

protected final void registerTag(Tag tag)
Register a tag with this managed object definition.

This method must not be called by applications.

Parameters:
tag - The tag to be registered.