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

java.lang.Object
  extended by org.opends.server.admin.RelationDefinition<C,S>
Type Parameters:
C - The type of client managed object configuration that this relation definition refers to.
S - The type of server managed object configuration that this relation definition refers to.
Direct Known Subclasses:
InstantiableRelationDefinition, OptionalRelationDefinition, SingletonRelationDefinition

public abstract class RelationDefinition<C extends ConfigurationClient,S extends Configuration>
extends java.lang.Object

Relation definitions define relationships between types of managed objects. In addition they define the ownership model:

Relations define how clients interact with the configuration. For example, clients manage aggregated managed objects in a shared location and attach them to parent managed objects. Composed managed objects, on the other hand, would be created directly beneath the parent managed object and destroyed with it too.

Within the server, listeners can choose to request notification of managed objects being added or removed from relations.

In LDAP, compositions are represented as follows:

Whereas, aggregations are represented by storing the DNs of the referenced managed objects in an attribute of the aggregating managed object.


Nested Class Summary
protected static class RelationDefinition.AbstractBuilder<C extends ConfigurationClient,S extends Configuration,D extends RelationDefinition<C,S>>
          An interface for incrementally constructing relation definitions.
protected static class RelationDefinition.Common<C extends ConfigurationClient,S extends Configuration>
          Opaque structure containing fields common to all relation definition types.
 
Constructor Summary
protected RelationDefinition(RelationDefinition.Common<C,S> common)
          Create a new managed object relation definition with the specified common fields.
 
Method Summary
abstract
<R,P> R
accept(RelationDefinitionVisitor<R,P> v, P p)
          Apply a visitor to this relation definition.
 AbstractManagedObjectDefinition<C,S> getChildDefinition()
          Get the definition of the child managed object.
 Message getDescription()
          Gets the optional description of this relation definition in the default locale.
 Message getDescription(java.util.Locale locale)
          Gets the optional description of this relation definition in the specified locale.
 java.lang.String getName()
          Get the name of the relation.
 AbstractManagedObjectDefinition<?,?> getParentDefinition()
          Get the definition of the parent managed object.
 Message getSynopsis()
          Gets the synopsis of this relation definition in the default locale.
 Message getSynopsis(java.util.Locale locale)
          Gets the synopsis of this relation definition in the specified locale.
 Message getUserFriendlyName()
          Gets the user friendly name of this relation definition in the default locale.
 Message getUserFriendlyName(java.util.Locale locale)
          Gets the user friendly name of this relation definition in the specified locale.
 boolean hasOption(RelationOption option)
          Check if the specified option is set for this relation definition.
protected  void initialize()
          Performs any run-time initialization required by this relation definition.
 java.lang.String toString()
          
abstract  void toString(java.lang.StringBuilder builder)
          Append a string representation of the managed object relation to the provided string builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationDefinition

protected RelationDefinition(RelationDefinition.Common<C,S> common)
Create a new managed object relation definition with the specified common fields.

Parameters:
common - The common fields of the new relation definition.
Method Detail

accept

public abstract <R,P> R accept(RelationDefinitionVisitor<R,P> v,
                               P p)
Apply a visitor to this relation definition.

Type Parameters:
R - The return type of the visitor's methods.
P - The type of the additional parameters to the visitor's methods.
Parameters:
v - The relation definition visitor.
p - Optional additional visitor parameter.
Returns:
Returns a result as specified by the visitor.

getChildDefinition

public final AbstractManagedObjectDefinition<C,S> getChildDefinition()
Get the definition of the child managed object.

Returns:
Returns the definition of the child managed object.

getDescription

public final Message getDescription()
Gets the optional description of this relation definition in the default locale.

Returns:
Returns the description of this relation definition in the default locale, or null if there is no description.

getDescription

public final Message getDescription(java.util.Locale locale)
Gets the optional description of this relation definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the description of this relation definition in the specified locale, or null if there is no description.

getName

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

Returns:
Returns the name of the relation.

getParentDefinition

public final AbstractManagedObjectDefinition<?,?> getParentDefinition()
Get the definition of the parent managed object.

Returns:
Returns the definition of the parent managed object.

getSynopsis

public final Message getSynopsis()
Gets the synopsis of this relation definition in the default locale.

Returns:
Returns the synopsis of this relation definition in the default locale.

getSynopsis

public final Message getSynopsis(java.util.Locale locale)
Gets the synopsis of this relation definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the synopsis of this relation definition in the specified locale.

getUserFriendlyName

public final Message getUserFriendlyName()
Gets the user friendly name of this relation definition in the default locale.

Returns:
Returns the user friendly name of this relation definition in the default locale.

getUserFriendlyName

public final Message getUserFriendlyName(java.util.Locale locale)
Gets the user friendly name of this relation definition in the specified locale.

Parameters:
locale - The locale.
Returns:
Returns the user friendly name of this relation definition in the specified locale.

hasOption

public final boolean hasOption(RelationOption option)
Check if the specified option is set for this relation definition.

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

toString

public final java.lang.String toString()

Overrides:
toString in class java.lang.Object

toString

public abstract void toString(java.lang.StringBuilder builder)
Append a string representation of the managed object relation to the provided string builder.

Parameters:
builder - The string builder where the string representation should be appended.

initialize

protected void initialize()
                   throws java.lang.Exception
Performs any run-time initialization required by this relation definition. This may include resolving managed object paths and property names.

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