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
Modifier and TypeClassDescriptionprotected static class
RelationDefinition.AbstractBuilder<C extends ConfigurationClient,
S extends Configuration, D extends RelationDefinition<C, S>> An interface for incrementally constructing relation definitions.protected static final class
RelationDefinition.Common<C extends ConfigurationClient,
S extends Configuration> Opaque structure containing fields common to all relation definition types. -
Constructor Summary
ModifierConstructorDescriptionprotected
RelationDefinition
(RelationDefinition.Common<C, S> common) Create a new managed object relation definition with the specified common fields. -
Method Summary
Modifier and TypeMethodDescriptionabstract <R,
P> R accept
(RelationDefinitionVisitor<R, P> v, P p) Apply a visitor to this relation definition.final AbstractManagedObjectDefinition<C,
S> Get the definition of the child managed object.final LocalizableMessage
Gets the optional description of this relation definition in the default locale.final LocalizableMessage
getDescription
(Locale locale) Gets the optional description of this relation definition in the specified locale.final String
getName()
Get the name of the relation.final AbstractManagedObjectDefinition<?,
?> Get the definition of the parent managed object.final LocalizableMessage
Gets the synopsis of this relation definition in the default locale.final LocalizableMessage
getSynopsis
(Locale locale) Gets the synopsis of this relation definition in the specified locale.final LocalizableMessage
Gets the user friendly name of this relation definition in the default locale.final LocalizableMessage
getUserFriendlyName
(Locale locale) Gets the user friendly name of this relation definition in the specified locale.final boolean
hasOption
(RelationOption option) Check if the specified option is set for this relation definition.protected void
Performs any run-time initialization required by this relation definition.final String
toString()
abstract void
toString
(StringBuilder builder) Append a string representation of the managed object relation to the provided string builder.
-
Constructor Details
-
RelationDefinition
Create a new managed object relation definition with the specified common fields.- Parameters:
common
- The common fields of the new relation definition.
-
-
Method Details
-
accept
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
Get the definition of the child managed object.- Returns:
- Returns the definition of the child managed object.
-
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
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
Get the name of the relation.- Returns:
- Returns the name of the relation.
-
getParentDefinition
Get the definition of the parent managed object.- Returns:
- Returns the definition of the parent managed object.
-
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
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
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
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
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
-
toString
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
Performs any run-time initialization required by this relation definition. This may include resolving managed object paths and property names.- Throws:
Exception
- If this relation definition could not be initialized.
-