|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.schema.AbstractSchemaObject
public abstract class AbstractSchemaObject
Most schema objects have some common attributes. This class
contains the minimum set of properties exposed by a SchemaObject.
We have 11 types of SchemaObjects :
Field Summary | |
---|---|
protected java.lang.String |
description
A short description of this SchemaObject |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
extensions
A map containing the list of supported extensions |
protected boolean |
isEnabled
Whether or not this SchemaObject is enabled |
protected boolean |
isObsolete
Whether or not this SchemaObject is obsolete |
protected boolean |
isReadOnly
Whether or not this SchemaObject can be modified |
protected boolean |
locked
A locked to avoid modifications when set to true |
protected java.util.List<java.lang.String> |
names
The optional names for this SchemaObject |
protected SchemaObjectType |
objectType
The SchemaObjectType |
protected java.lang.String |
oid
The SchemaObject numeric OID |
protected java.lang.String |
schemaName
The name of the schema this object is associated with |
static long |
serialVersionUID
The serialVersionUID |
protected java.lang.String |
specification
The SchemaObject specification |
Constructor Summary | |
---|---|
protected |
AbstractSchemaObject(SchemaObjectType objectType)
Constructor used when a generic reusable SchemaObject is assigned an OID after being instantiated. |
protected |
AbstractSchemaObject(SchemaObjectType objectType,
java.lang.String oid)
A constructor for a SchemaObject instance. |
Method Summary | |
---|---|
void |
addExtension(java.lang.String key,
java.util.List<java.lang.String> values)
Add an extension with its values |
void |
addName(java.lang.String... names)
Add a new name to the list of names for this SchemaObject. |
void |
addToRegistries(java.util.List<java.lang.Throwable> errors,
Registries registries)
Inject this SchemaObject to the given registries, updating the references to other SchemaObject |
void |
clear()
Clear the current SchemaObject : remove all the references to other objects, and all the Maps. |
protected boolean |
compareOid(java.lang.String oid1,
java.lang.String oid2)
Compare two oids, and return true if they are both null or equals |
abstract SchemaObject |
copy()
Copy the current SchemaObject on place |
SchemaObject |
copy(SchemaObject original)
Copy a SchemaObject. |
boolean |
equals(java.lang.Object o1)
|
java.lang.String |
getDescription()
Gets a short description about this SchemaObject. |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getExtensions()
|
java.lang.String |
getName()
Gets the first name in the set of short names for this SchemaObject if any exists for it. |
java.util.List<java.lang.String> |
getNames()
Gets short names for this SchemaObject if any exists for it, otherwise, returns an empty list. |
SchemaObjectType |
getObjectType()
The SchemaObject type : AttributeType DitCOntentRule DitStructureRule LdapComparator (specific to ADS) LdapSyntaxe MatchingRule MatchingRuleUse NameForm Normalizer (specific to ADS) ObjectClass SyntaxChecker (specific to ADS) |
java.lang.String |
getOid()
Gets usually what is the numeric object identifier assigned to this SchemaObject. |
java.lang.String |
getSchemaName()
Gets the name of the schema this SchemaObject is associated with. |
java.lang.String |
getSpecification()
Gets the SchemaObject specification. |
int |
hashCode()
|
boolean |
isDisabled()
Tells if this SchemaObject is disabled. |
boolean |
isEnabled()
Tells if this SchemaObject is enabled. |
boolean |
isObsolete()
Gets whether or not this SchemaObject has been inactivated. |
boolean |
isReadOnly()
Tells if this SchemaObject is ReadOnly. |
void |
lock()
Transform the SchemaObject to an immutable object TODO locked. |
void |
registerOid(SchemaObject schemaObject,
Registries registries)
Register the given SchemaObject into the given registries' globalOidRegistry |
void |
removeFromRegistries(java.util.List<java.lang.Throwable> errors,
Registries registries)
Remove this SchemaObject from the given registries, updating the references to other SchemaObject |
void |
setDescription(java.lang.String description)
Sets the SchemaObject's description |
void |
setEnabled(boolean enabled)
Sets the SchemaObject state, either enabled or disabled. |
void |
setExtensions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensions)
Add an extensions with their values. |
void |
setNames(java.util.List<java.lang.String> names)
Sets the list of names for this SchemaObject. |
void |
setNames(java.lang.String... names)
Sets the list of names for this SchemaObject. |
void |
setObsolete(boolean obsolete)
Sets the Obsolete flag. |
void |
setOid(java.lang.String oid)
A special method used when renaming an SchemaObject: we may have to change it's OID |
void |
setReadOnly(boolean isReadOnly)
Sets the SchemaObject readOnly flag |
void |
setRegistries(Registries registries)
Inject the Registries into the SchemaObject |
void |
setSchemaName(java.lang.String schemaName)
Sets the name of the schema this SchemaObject is associated with. |
void |
setSpecification(java.lang.String specification)
Sets the SchemaObject's specification |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
protected java.lang.String oid
protected java.util.List<java.lang.String> names
protected boolean isEnabled
protected boolean isReadOnly
protected boolean isObsolete
protected java.lang.String description
protected java.lang.String specification
protected java.lang.String schemaName
protected SchemaObjectType objectType
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensions
protected volatile boolean locked
Constructor Detail |
---|
protected AbstractSchemaObject(SchemaObjectType objectType, java.lang.String oid)
objectType
- The SchemaObjectType to createprotected AbstractSchemaObject(SchemaObjectType objectType)
objectType
- The SchemaObjectType to createMethod Detail |
---|
public java.lang.String getOid()
getOid
in interface SchemaObject
public void setOid(java.lang.String oid)
setOid
in interface SchemaObject
oid
- The new OIDpublic java.util.List<java.lang.String> getNames()
getNames
in interface SchemaObject
public java.lang.String getName()
getName
in interface SchemaObject
public void addToRegistries(java.util.List<java.lang.Throwable> errors, Registries registries) throws LdapException
addToRegistries
in interface SchemaObject
errors
- The errors we gotregistries
- The Registries
LdapException
public void removeFromRegistries(java.util.List<java.lang.Throwable> errors, Registries registries) throws LdapException
removeFromRegistries
in interface SchemaObject
errors
- The errors we gotregistries
- The Registries
LdapException
public void setRegistries(Registries registries)
setRegistries
in interface SchemaObject
registries
- The Registriespublic void addName(java.lang.String... names)
addName
in interface SchemaObject
names
- The names to addpublic void setNames(java.util.List<java.lang.String> names)
setNames
in interface SchemaObject
names
- The list of names. Can be emptypublic void setNames(java.lang.String... names)
names
- The list of names.public java.lang.String getDescription()
getDescription
in interface SchemaObject
public void setDescription(java.lang.String description)
setDescription
in interface SchemaObject
description
- The SchemaObject's descriptionpublic java.lang.String getSpecification()
getSpecification
in interface SchemaObject
public void setSpecification(java.lang.String specification)
setSpecification
in interface SchemaObject
specification
- The SchemaObject's specificationpublic boolean isEnabled()
isEnabled
in interface SchemaObject
schemaEnabled
- the associated schema status
public boolean isDisabled()
isDisabled
in interface SchemaObject
public void setEnabled(boolean enabled)
setEnabled
in interface SchemaObject
enabled
- The current SchemaObject statepublic boolean isReadOnly()
isReadOnly
in interface SchemaObject
public void setReadOnly(boolean isReadOnly)
setReadOnly
in interface SchemaObject
enabled
- The current SchemaObject ReadOnly statuspublic boolean isObsolete()
isObsolete
in interface SchemaObject
public void setObsolete(boolean obsolete)
setObsolete
in interface SchemaObject
obsolete
- The Obsolete flag statepublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getExtensions()
getExtensions
in interface SchemaObject
public void addExtension(java.lang.String key, java.util.List<java.lang.String> values)
addExtension
in interface SchemaObject
key
- The extension keyvalues
- The associated valuespublic void setExtensions(java.util.Map<java.lang.String,java.util.List<java.lang.String>> extensions)
setExtensions
in interface SchemaObject
key
- The extension keyvalues
- The associated valuespublic SchemaObjectType getObjectType()
getObjectType
in interface SchemaObject
public java.lang.String getSchemaName()
getSchemaName
in interface SchemaObject
public void setSchemaName(java.lang.String schemaName)
setSchemaName
in interface SchemaObject
schemaName
- the new schema namepublic int hashCode()
hashCode
in interface SchemaObject
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object o1)
equals
in interface SchemaObject
equals
in class java.lang.Object
Object.equals(Object)
public void registerOid(SchemaObject schemaObject, Registries registries) throws LdapException
registerOid
in interface SchemaObject
schemaObject
- the SchemaObject we want to registerregistries
- The registries in which we want it to be stored
LdapException
- If the OID is invalidpublic abstract SchemaObject copy()
copy
in interface SchemaObject
protected boolean compareOid(java.lang.String oid1, java.lang.String oid2)
public SchemaObject copy(SchemaObject original)
copy
in interface SchemaObject
public void clear()
clear
in interface SchemaObject
public final void lock()
lock
in interface SchemaObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |