|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.types.CommonSchemaElements
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public abstract class CommonSchemaElements
An abstract base class for LDAP schema definitions which contain an OID, optional names, description, an obsolete flag, and an optional set of extra properties.
This class defines common properties and behaviour of the various types of schema definitions (e.g. object class definitions, and attribute type definitions).
Any methods which accesses the set of names associated with this
definition, will retrieve the primary name as the first name,
regardless of whether or not it was contained in the original set
of names
passed to the constructor.
Where ordered sets of names, or extra properties are provided, the
ordering will be preserved when the associated fields are accessed
via their getters or via the toString()
methods.
Note that these schema elements are not completely immutable, as the set of extra properties for the schema element may be altered after the element is created. Among other things, this allows the associated schema file to be edited so that an element created over protocol may be associated with a particular schema file.
Constructor Summary | |
---|---|
protected |
CommonSchemaElements(java.lang.String primaryName,
java.util.Collection<java.lang.String> names,
java.lang.String oid,
java.lang.String description,
boolean isObsolete,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> extraProperties)
Creates a new definition with the provided information. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this attribute type. |
java.lang.String |
getDescription()
Retrieves the description for this schema definition. |
java.lang.Iterable<java.lang.String> |
getExtraProperty(java.lang.String name)
Retrieves an iterable over the value(s) of the specified "extra" property for this schema definition. |
java.lang.Iterable<java.lang.String> |
getExtraPropertyNames()
Retrieves an iterable over the names of "extra" properties associated with this schema definition. |
java.lang.String |
getNameOrOID()
Retrieves the name or OID for this schema definition. |
java.lang.Iterable<java.lang.String> |
getNormalizedNames()
Retrieves an iterable over the set of normalized names that may be used to reference this schema definition. |
java.lang.String |
getNormalizedPrimaryName()
Retrieve the normalized primary name for this schema definition. |
java.lang.String |
getOID()
Retrieves the OID for this schema definition. |
java.lang.String |
getPrimaryName()
Retrieves the primary name for this schema definition. |
java.lang.String |
getSchemaFile()
Retrieves the name of the schema file that contains the definition for this schema definition. |
java.lang.Iterable<java.lang.String> |
getUserDefinedNames()
Retrieves an iterable over the set of user-defined names that may be used to reference this schema definition. |
int |
hashCode()
Retrieves the hash code for this schema definition. |
boolean |
hasName(java.lang.String lowerName)
Indicates whether this schema definition has the specified name. |
boolean |
hasNameOrOID(java.lang.String lowerValue)
Indicates whether this schema definition has the specified name or OID. |
boolean |
isObsolete()
Indicates whether this schema definition is declared "obsolete". |
void |
setExtraProperty(java.lang.String name,
java.util.List<java.lang.String> values)
Sets the values for an "extra" property for this schema element. |
void |
setExtraProperty(java.lang.String name,
java.lang.String value)
Sets the value for an "extra" property for this schema element. |
void |
setSchemaFile(java.lang.String schemaFile)
Specifies the name of the schema file that contains the definition for this schema element. |
java.lang.String |
toString()
Retrieves the string representation of this schema definition in the form specified in RFC 2252. |
void |
toString(java.lang.StringBuilder buffer,
boolean includeFileElement)
Appends a string representation of this schema definition in the form specified in RFC 2252 to the provided buffer. |
protected abstract void |
toStringContent(java.lang.StringBuilder buffer)
Appends a string representation of this schema definition's non-generic properties to the provided buffer. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CommonSchemaElements(java.lang.String primaryName, java.util.Collection<java.lang.String> names, java.lang.String oid, java.lang.String description, boolean isObsolete, java.util.Map<java.lang.String,java.util.List<java.lang.String>> extraProperties) throws java.lang.NullPointerException
If no primaryName
is specified, but a set of
names
is specified, then the first name retrieved
from the set of names
will be used as the primary
name.
primaryName
- The primary name for this definition, or
null
if there is no primary name.names
- The full set of names for this definition, or
null
if there are no names.oid
- The OID for this definition (must not be
null
).description
- The description for the definition, or null
if there is no description.isObsolete
- Indicates whether this definition is declared
"obsolete".extraProperties
- A set of extra properties for this definition, or
null
if there are no extra properties.
java.lang.NullPointerException
- If the provided OID was null
.Method Detail |
---|
public final java.lang.String getPrimaryName()
null
if there is no primary name.public final java.lang.String getNormalizedPrimaryName()
null
if there is no primary name.public final java.lang.Iterable<java.lang.String> getNormalizedNames()
public final java.lang.Iterable<java.lang.String> getUserDefinedNames()
public final boolean hasName(java.lang.String lowerName)
lowerName
- The lowercase name for which to make the determination.
true
if the specified name is assigned to
this schema definition, or false
if not.public final java.lang.String getOID()
public final java.lang.String getNameOrOID()
public final boolean hasNameOrOID(java.lang.String lowerValue)
lowerValue
- The lowercase value for which to make the determination.
true
if the provided value matches the OID
or one of the names assigned to this schema definition,
or false
if not.public final java.lang.String getSchemaFile()
null
if it
is not known or if it is not stored in any schema file.public final void setSchemaFile(java.lang.String schemaFile)
null
,
then any existing schema file definition will be removed.
schemaFile
- The name of the schema file that contains the
definition for this schema element.public final java.lang.String getDescription()
null
if there is no description.public final boolean isObsolete()
true
if this schema definition is declared
"obsolete", or false
if not.public final java.lang.Iterable<java.lang.String> getExtraPropertyNames()
public final java.lang.Iterable<java.lang.String> getExtraProperty(java.lang.String name)
name
- The name of the "extra" property for which to retrieve
the value(s).
null
if no such property is defined.public final void setExtraProperty(java.lang.String name, java.lang.String value)
null
, then any
existing property with the given name will be removed.
name
- The name for the "extra" property. It must not be
null
.value
- The value for the "extra" property. If it is
null
, then any existing definition will be
removed.public final void setExtraProperty(java.lang.String name, java.util.List<java.lang.String> values)
null
or
empty, then any existing property with the given name will be
removed.
name
- The name for the "extra" property. It must not
be null
.values
- The set of values for the "extra" property. If
it is null
or empty, then any existing
definition will be removed.public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object for which to make the determination.
true
if the provided object is equal to
this schema definition, or false
if not.public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
public final void toString(java.lang.StringBuilder buffer, boolean includeFileElement)
buffer
- The buffer to which the information should be appended.includeFileElement
- Indicates whether to include an "extra" property that
specifies the path to the schema file from which this
schema definition was loaded.protected abstract void toStringContent(java.lang.StringBuilder buffer)
buffer
- The buffer to which the information should be appended.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |