Package org.forgerock.opendj.config
Class RelationDefinition<C extends ConfigurationClient,S extends Configuration>
- java.lang.Object
-
- org.forgerock.opendj.config.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
,SetRelationDefinition
,SingletonRelationDefinition
public abstract class RelationDefinition<C extends ConfigurationClient,S extends Configuration> extends Object
Relation definitions define relationships between types of managed objects. In addition they define the ownership model:- composition - referenced managed objects are owned by the parent managed object and are deleted when the parent is deleted
- aggregation - referenced managed objects are not owned by the parent managed object. Instead they are shared by other managed objects.
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:
- singleton relations (one to one): a referenced managed object is represented using a child entry directly beneath the parent
- optional relations (one to zero or one): a referenced managed object is represented using a child entry directly beneath the parent
- instantiable relations (one to many): the relation is represented using a child entry directly beneath the parent. Referenced managed objects are represented using child entries of this "relation entry" and are named by the user
- set relations (one to many): the relation is represented using a child entry directly beneath the parent. Referenced managed objects are represented using child entries of this "relation entry" whose name is the type of the managed object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description 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
Constructors Modifier Constructor Description protected
RelationDefinition(RelationDefinition.Common<C,S> common)
Create a new managed object relation definition with the specified common fields.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <R,P>
Raccept(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.LocalizableMessage
getDescription()
Gets the optional description of this relation definition in the default locale.LocalizableMessage
getDescription(Locale locale)
Gets the optional description of this relation definition in the specified locale.String
getName()
Get the name of the relation.AbstractManagedObjectDefinition<?,?>
getParentDefinition()
Get the definition of the parent managed object.LocalizableMessage
getSynopsis()
Gets the synopsis of this relation definition in the default locale.LocalizableMessage
getSynopsis(Locale locale)
Gets the synopsis of this relation definition in the specified locale.LocalizableMessage
getUserFriendlyName()
Gets the user friendly name of this relation definition in the default locale.LocalizableMessage
getUserFriendlyName(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.String
toString()
abstract void
toString(StringBuilder builder)
Append a string representation of the managed object relation to the provided string builder.
-
-
-
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 LocalizableMessage 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 LocalizableMessage getDescription(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 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 LocalizableMessage 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 LocalizableMessage getSynopsis(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 LocalizableMessage 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 LocalizableMessage getUserFriendlyName(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, orfalse
otherwise.
-
toString
public abstract void toString(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.
-
-