|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.admin.ManagedObjectPath<C,S>
C
- The type of client managed object configuration that this
path references.S
- The type of server managed object configuration that this
path references.public final class ManagedObjectPath<C extends ConfigurationClient,S extends Configuration>
A path which can be used to determine the location of a managed object instance.
A path is made up of zero or more elements each of which represents a managed object. Managed objects are arranged hierarchically with the root configuration being the top-most managed object. Elements are ordered such that the root configuration managed object is the first element and subsequent elements representing managed objects further down the hierarchy.
A path can be encoded into a string representation using the
toString()
and toString(StringBuilder)
methods.
Conversely, this string representation can be parsed using the
valueOf(String)
method.
The string representation of a managed object path is similar in principle to a UNIX file-system path and is defined as follows:
/
/
character
relation=
relation
[+type=
definition]
, where
relation is the name of the relation and definition
is the name of the referenced managed object's definition if
required (usually this is implied by the relation itself)
relation=
relation[+type=
definition]
+name=
name,
where relation is the name of the relation and
definition is the name of the referenced managed object's
definition if required (usually this is implied by the relation
itself), and name is the name of the managed object
instance.
type
is not
specified indicating that the path identifies a connection handler
called my handler which can be any type of connection
handler):
/relation=connection-handler+name=my handlerIf the identified connection handler must be an LDAP connection handler then the above path should include the
type
:
/relation=connection-handler+type=ldap-connection-handler+name=my handlerThe final example identifies the global configuration:
/relation=global-configuration
Method Summary | ||
---|---|---|
|
asSubType(AbstractManagedObjectDefinition<CC,SS> nd)
Creates a new managed object path which has the same structure as this path except that the final path element is associated with the specified managed object definition. |
|
|
child(InstantiableRelationDefinition<? super M,? super N> r,
AbstractManagedObjectDefinition<M,N> d,
java.lang.String name)
Creates a new child managed object path beneath the provided parent path having the specified managed object definition. |
|
|
child(InstantiableRelationDefinition<M,N> r,
java.lang.String name)
Creates a new child managed object path beneath the provided parent path using the relation's child managed object definition. |
|
|
child(OptionalRelationDefinition<? super M,? super N> r,
AbstractManagedObjectDefinition<M,N> d)
Creates a new child managed object path beneath the provided parent path having the specified managed object definition. |
|
|
child(OptionalRelationDefinition<M,N> r)
Creates a new child managed object path beneath the provided parent path using the relation's child managed object definition. |
|
|
child(SingletonRelationDefinition<? super M,? super N> r,
AbstractManagedObjectDefinition<M,N> d)
Creates a new child managed object path beneath the provided parent path having the specified managed object definition. |
|
|
child(SingletonRelationDefinition<M,N> r)
Creates a new child managed object path beneath the provided parent path using the relation's child managed object definition. |
|
static ManagedObjectPath<RootCfgClient,RootCfg> |
emptyPath()
Creates a new managed object path representing the configuration root. |
|
boolean |
equals(java.lang.Object obj)
|
|
AbstractManagedObjectDefinition<C,S> |
getManagedObjectDefinition()
Get the definition of the managed object referred to by this path. |
|
java.lang.String |
getName()
Get the name of the managed object referred to by this path if applicable. |
|
RelationDefinition<? super C,? super S> |
getRelationDefinition()
Get the relation definition of the managed object referred to by this path. |
|
int |
hashCode()
|
|
boolean |
isEmpty()
Determine whether or not this path contains any path elements. |
|
boolean |
matches(ManagedObjectPath<?,?> other)
Determines whether this managed object path references the same location as the provided managed object path. |
|
ManagedObjectPath<?,?> |
parent()
Creates a new parent managed object path representing the immediate parent of this path. |
|
ManagedObjectPath<?,?> |
parent(int offset)
Creates a new parent managed object path the specified number of path elements above this path. |
|
ManagedObjectPath<C,S> |
rename(java.lang.String newName)
Creates a new managed object path which has the same structure as this path except that the final path element is renamed. |
|
void |
serialize(ManagedObjectPathSerializer serializer)
Serialize this managed object path using the provided serialization strategy. |
|
int |
size()
Get the number of path elements in this managed object path. |
|
DN |
toDN()
Creates a DN representation of this managed object path. |
|
java.lang.String |
toString()
|
|
void |
toString(java.lang.StringBuilder builder)
Appends a string representation of this managed object path to the provided string builder. |
|
static ManagedObjectPath<?,?> |
valueOf(java.lang.String s)
Returns a managed object path holding the value of the specified string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static ManagedObjectPath<RootCfgClient,RootCfg> emptyPath()
public static ManagedObjectPath<?,?> valueOf(java.lang.String s) throws java.lang.IllegalArgumentException
s
- The string to be parsed.
java.lang.IllegalArgumentException
- If the string could not be parsed.public <CC extends C,SS extends S> ManagedObjectPath<CC,SS> asSubType(AbstractManagedObjectDefinition<CC,SS> nd)
CC
- The type of client managed object configuration that
this path will reference.SS
- The type of server managed object configuration that
this path will reference.nd
- The new managed object definition.
public <M extends ConfigurationClient,N extends Configuration> ManagedObjectPath<M,N> child(InstantiableRelationDefinition<? super M,? super N> r, AbstractManagedObjectDefinition<M,N> d, java.lang.String name) throws java.lang.IllegalArgumentException
M
- The type of client managed object configuration that the
child path references.N
- The type of server managed object configuration that the
child path references.r
- The instantiable relation referencing the child.d
- The managed object definition associated with the child
(must be a sub-type of the relation).name
- The relative name of the child managed object.
java.lang.IllegalArgumentException
- If the provided name is empty or blank.public <M extends ConfigurationClient,N extends Configuration> ManagedObjectPath<M,N> child(InstantiableRelationDefinition<M,N> r, java.lang.String name) throws java.lang.IllegalArgumentException
M
- The type of client managed object configuration that the
child path references.N
- The type of server managed object configuration that the
child path references.r
- The instantiable relation referencing the child.name
- The relative name of the child managed object.
java.lang.IllegalArgumentException
- If the provided name is empty or blank.public <M extends ConfigurationClient,N extends Configuration> ManagedObjectPath<M,N> child(OptionalRelationDefinition<? super M,? super N> r, AbstractManagedObjectDefinition<M,N> d)
M
- The type of client managed object configuration that the
child path references.N
- The type of server managed object configuration that the
child path references.r
- The optional relation referencing the child.d
- The managed object definition associated with the child
(must be a sub-type of the relation).
public <M extends ConfigurationClient,N extends Configuration> ManagedObjectPath<M,N> child(OptionalRelationDefinition<M,N> r)
M
- The type of client managed object configuration that the
child path references.N
- The type of server managed object configuration that the
child path references.r
- The optional relation referencing the child.
public <M extends ConfigurationClient,N extends Configuration> ManagedObjectPath<M,N> child(SingletonRelationDefinition<? super M,? super N> r, AbstractManagedObjectDefinition<M,N> d)
M
- The type of client managed object configuration that the
child path references.N
- The type of server managed object configuration that the
child path references.r
- The singleton relation referencing the child.d
- The managed object definition associated with the child
(must be a sub-type of the relation).
public <M extends ConfigurationClient,N extends Configuration> ManagedObjectPath<M,N> child(SingletonRelationDefinition<M,N> r)
M
- The type of client managed object configuration that the
child path references.N
- The type of server managed object configuration that the
child path references.r
- The singleton relation referencing the child.
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public AbstractManagedObjectDefinition<C,S> getManagedObjectDefinition()
When the path is empty, the RootCfgDefn
is returned.
RootCfgDefn
if the path is
empty.public java.lang.String getName()
If there path does not refer to an instantiable managed object
null
is returned.
null
if the managed object
does not have a name.public RelationDefinition<? super C,? super S> getRelationDefinition()
When the path is empty, the null
is returned.
null
if
the path is empty.public int hashCode()
hashCode
in class java.lang.Object
public boolean isEmpty()
true
if this path does not contain
any path elements.public boolean matches(ManagedObjectPath<?,?> other)
This method differs from equals
in that it ignores
sub-type definitions.
other
- The managed object path to be compared.
true
if this managed object path
references the same location as the provided managed
object path.public ManagedObjectPath<?,?> parent() throws java.lang.IllegalArgumentException
parent(1)
.
java.lang.IllegalArgumentException
- If this path does not have a parent (i.e. it is the
empty path).public ManagedObjectPath<?,?> parent(int offset) throws java.lang.IllegalArgumentException
offset
- The number of path elements (0 - means no offset, 1
means the parent, and 2 means the grand-parent).
java.lang.IllegalArgumentException
- If the offset is less than 0, or greater than the
number of path elements in this path.public ManagedObjectPath<C,S> rename(java.lang.String newName) throws java.lang.IllegalStateException
newName
- The new name of the final path element.
java.lang.IllegalStateException
- If this managed object path is empty or if its final
path element does not comprise of an instantiable
relation.public void serialize(ManagedObjectPathSerializer serializer)
The path elements will be passed to the serializer in big-endian order: starting from the root element and proceeding down to the leaf.
serializer
- The managed object path serialization strategy.public int size()
public DN toDN()
public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuilder builder)
builder
- Append the string representation to this builder.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |