@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class Schema extends Object
Schema under the hood.| Modifier and Type | Class and Description |
|---|---|
static interface |
Schema.SchemaUpdater
Interface to update a schema provided a schema builder.
|
| Constructor and Description |
|---|
Schema(org.forgerock.opendj.ldap.schema.Schema schemaNG)
Creates a new schema structure with all elements initialized but empty.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtraAttribute(String name,
Attribute attr)
Add a new extra Attribute for this schema.
|
static String |
addSchemaFileToElementDefinitionIfAbsent(String definition,
String schemaFile)
Adds the provided schema file to the provided schema element definition.
|
static void |
compareConcatenatedSchema(Set<String> oldElements,
Set<String> newElements,
org.forgerock.opendj.ldap.schema.AttributeType elementType,
List<Modification> mods)
Compares the provided sets of schema element definitions and
writes any differences found into the given list of
modifications.
|
void |
deregisterAttributeType(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
Deregisters the provided attribute type definition with this schema.
|
void |
deregisterDITContentRule(DITContentRule ditContentRule)
Deregisters the provided DIT content rule definition with this
schema.
|
void |
deregisterDITStructureRule(DITStructureRule ditStructureRule)
Deregisters the provided DIT structure rule definition with this
schema.
|
void |
deregisterLdapSyntaxDescription(LDAPSyntaxDescription syntaxDesc)
Deregisters the provided ldap syntax description with this schema.
|
void |
deregisterMatchingRule(org.forgerock.opendj.ldap.schema.MatchingRule matchingRule)
Deregisters the provided matching rule definition with this schema.
|
void |
deregisterMatchingRuleUse(MatchingRuleUse matchingRuleUse)
Deregisters the provided matching rule use definition with this
schema.
|
void |
deregisterNameForm(NameForm nameForm)
Deregisters the provided name form definition with this schema.
|
void |
deregisterObjectClass(ObjectClass objectClass)
Deregisters the provided objectclass definition with this schema.
|
void |
deregisterSyntax(org.forgerock.opendj.ldap.schema.Syntax syntax)
Deregisters the provided attribute syntax definition with this schema.
|
void |
destroy()
Destroys the structures maintained by the schema so that they are
no longer usable.
|
Schema |
duplicate()
Creates a new
Schema object that is a duplicate of this one. |
void |
exclusiveLock()
Takes an exclusive lock on the schema.
|
void |
exclusiveUnlock()
Releases an exclusive lock on the schema.
|
static void |
genConcatenatedSchema(Set<String> attributeTypes,
Set<String> objectClasses,
Set<String> nameForms,
Set<String> ditContentRules,
Set<String> ditStructureRules,
Set<String> matchingRuleUses,
Set<String> ldapSyntaxes)
Reads the files contained in the schema directory and generates a
concatenated view of their contents in the provided sets.
|
org.forgerock.opendj.ldap.schema.AttributeType |
getAttributeType(String nameOrOid)
Retrieves the attribute type definition with the specified name or OID.
|
org.forgerock.opendj.ldap.schema.AttributeType |
getAttributeType(String nameOrOid,
org.forgerock.opendj.ldap.schema.Syntax syntax)
Retrieves the attribute type definition with the specified name or OID.
|
Collection<org.forgerock.opendj.ldap.schema.AttributeType> |
getAttributeTypes()
Retrieves the attribute type definitions for this schema.
|
org.forgerock.opendj.ldap.schema.Syntax |
getDefaultSyntax()
Retrieves the default attribute syntax that should be used for attributes
that are not defined in the server schema.
|
DITContentRule |
getDITContentRule(ObjectClass objectClass)
Retrieves the DIT content rule definition for the specified
objectclass.
|
ConcurrentHashMap<ObjectClass,DITContentRule> |
getDITContentRules()
Retrieves the DIT content rule definitions for this schema, as a
mapping between the objectclass for the rule and the DIT content
rule itself.
|
DITStructureRule |
getDITStructureRule(int ruleID)
Retrieves the DIT structure rule definition with the provided
rule ID.
|
DITStructureRule |
getDITStructureRule(NameForm nameForm)
Retrieves the DIT structure rule definition for the provided name
form.
|
ConcurrentHashMap<Integer,DITStructureRule> |
getDITStructureRulesByID()
Retrieves the DIT structure rule definitions for this schema, as
a mapping between the rule ID for the rule and the DIT structure
rule itself.
|
ConcurrentHashMap<NameForm,DITStructureRule> |
getDITStructureRulesByNameForm()
Retrieves the DIT structure rule definitions for this schema, as
a mapping between the name form for the rule and the DIT
structure rule itself.
|
Map<String,Attribute> |
getExtraAttributes()
Get the extraAttributes stored in this schema.
|
LDAPSyntaxDescription |
getLdapSyntaxDescription(String lowerName)
Retrieves the ldap syntax definition with the OID.
|
ConcurrentHashMap<String,LDAPSyntaxDescription> |
getLdapSyntaxDescriptions()
Retrieves the ldap syntax definitions for this schema, as a
mapping between the OID for the syntax and the ldap syntax
definition itself.
|
org.forgerock.opendj.ldap.schema.MatchingRule |
getMatchingRule(String nameOrOid)
Retrieves the matching rule definition with the specified name or OID.
|
Collection<org.forgerock.opendj.ldap.schema.MatchingRule> |
getMatchingRules()
Retrieves all matching rule definitions for this schema.
|
MatchingRuleUse |
getMatchingRuleUse(org.forgerock.opendj.ldap.schema.MatchingRule matchingRule)
Retrieves the matching rule use definition for the specified
matching rule.
|
ConcurrentHashMap<org.forgerock.opendj.ldap.schema.MatchingRule,MatchingRuleUse> |
getMatchingRuleUses()
Retrieves the matching rule use definitions for this schema, as a
mapping between the matching rule for the matching rule use
definition and the matching rule use itself.
|
List<NameForm> |
getNameForm(ObjectClass objectClass)
Retrieves the name forms definition for the specified
objectclass.
|
NameForm |
getNameForm(String lowerName)
Retrieves the name form definition with the provided name or OID.
|
ConcurrentHashMap<String,NameForm> |
getNameFormsByNameOrOID()
Retrieves the name form definitions for this schema, as a mapping
between the names/OID for the name form and the name form itself.
|
ConcurrentHashMap<ObjectClass,List<NameForm>> |
getNameFormsByObjectClass()
Retrieves the name form definitions for this schema, as a mapping
between the objectclass for the name forms and the name forms
themselves.
|
ObjectClass |
getObjectClass(String lowerName)
Retrieves the objectclass definition with the specified name or
OID.
|
ConcurrentHashMap<String,ObjectClass> |
getObjectClasses()
Retrieves the objectclass definitions for this schema, as a
mapping between the lowercase names and OIDs for the objectclass
and the objectclass itself.
|
long |
getOldestModificationTime()
Retrieves the modification timestamp for the file in the schema
configuration directory with the oldest last modified time.
|
org.forgerock.opendj.ldap.schema.Schema |
getSchemaNG()
Returns the SDK schema.
|
List<org.forgerock.opendj.ldap.schema.AttributeType> |
getSubTypes(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
Retrieves the set of subtypes registered for the given attribute
type.
|
org.forgerock.opendj.ldap.schema.Syntax |
getSyntax(String oid)
Retrieves the attribute syntax definition with the OID.
|
Collection<org.forgerock.opendj.ldap.schema.Syntax> |
getSyntaxes()
Retrieves the attribute syntax definitions for this schema.
|
long |
getYoungestModificationTime()
Retrieves the modification timestamp for the file in the schema
configuration directory with the youngest last modified time.
|
boolean |
hasAttributeType(String nameOrOid)
Indicates whether this schema definition includes an attribute
type with the provided name or OID.
|
boolean |
hasMatchingRule(String nameOrOid)
Indicates whether this schema definition includes a matching rule
with the provided name or OID.
|
boolean |
hasNameForm(String lowerName)
Indicates whether this schema definition includes a name form
with the specified name or OID.
|
boolean |
hasObjectClass(String lowerName)
Indicates whether this schema definition includes an objectclass
with the provided name or OID.
|
boolean |
hasSyntax(String oid)
Indicates whether this schema definition includes an attribute
syntax with the provided OID.
|
org.forgerock.opendj.ldap.schema.AttributeType |
parseAttributeType(String definition)
Parses an attribute type from its provided definition.
|
static String |
parseOID(String definition,
org.forgerock.opendj.ldap.ResultCode parsingErrorResultCode,
LocalizableMessageDescriptor.Arg0 parsingErrorMsg)
Returns the OID from the provided attribute type definition, assuming the
definition is valid.
|
static void |
readConcatenatedSchema(String concatSchemaFile,
Set<String> attributeTypes,
Set<String> objectClasses,
Set<String> nameForms,
Set<String> ditContentRules,
Set<String> ditStructureRules,
Set<String> matchingRuleUses,
Set<String> ldapSyntaxes)
Reads data from the specified concatenated schema file into the
provided sets.
|
void |
rebuildDependentElements(SchemaFileElement element)
Recursively rebuilds all schema elements that are dependent upon
the provided element.
|
void |
registerAttributeType(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
boolean overwriteExisting)
Registers the provided attribute type definition with this schema.
|
void |
registerAttributeType(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
String schemaFile,
boolean overwriteExisting)
Registers the provided attribute type definition with this schema.
|
void |
registerAttributeType(String definition,
String schemaFile,
boolean overwrite)
Registers an attribute type from its provided definition.
|
void |
registerAttributeTypes(List<String> definitions,
String schemaFile,
boolean overwrite)
Registers a list of attribute types from their provided definitions.
|
void |
registerDITContentRule(DITContentRule ditContentRule,
boolean overwriteExisting)
Registers the provided DIT content rule definition with this
schema.
|
void |
registerDITStructureRule(DITStructureRule ditStructureRule,
boolean overwriteExisting)
Registers the provided DIT structure rule definition with this
schema.
|
void |
registerLdapSyntaxDescription(String definition,
boolean overwriteExisting)
Registers the provided ldap syntax description with this schema.
|
void |
registerMatchingRule(org.forgerock.opendj.ldap.schema.MatchingRule matchingRule,
boolean overwriteExisting)
Registers the provided matching rule definition with this schema.
|
void |
registerMatchingRuleUse(MatchingRuleUse matchingRuleUse,
boolean overwriteExisting)
Registers the provided matching rule use definition with this
schema.
|
void |
registerNameForm(NameForm nameForm,
boolean overwriteExisting)
Registers the provided name form definition with this schema.
|
void |
registerObjectClass(ObjectClass objectClass,
boolean overwriteExisting)
Registers the provided objectclass definition with this schema.
|
void |
registerSyntax(org.forgerock.opendj.ldap.schema.Syntax syntax,
boolean overwriteExisting)
Registers the provided attribute syntax definition with this
schema.
|
void |
setOldestModificationTime(long oldestModificationTime)
Sets the modification timestamp for the oldest file in the schema
configuration directory.
|
void |
setYoungestModificationTime(long youngestModificationTime)
Sets the modification timestamp for the youngest file in the
schema configuration directory.
|
void |
updateSchema(Schema.SchemaUpdater updater)
Update the schema using the provided schema updater.
|
<T> void |
updateSchemaOption(org.forgerock.util.Option<T> option,
T newValue)
Updates the schema option if the new value differs from the old value.
|
static void |
writeConcatenatedSchema()
Writes a single file containing all schema element definitions,
which can be used on startup to determine whether the schema
files were edited with the server offline.
|
public Schema(org.forgerock.opendj.ldap.schema.Schema schemaNG) throws DirectoryException
schemaNG - The SDK schemaDirectoryException - if the schema has warningspublic org.forgerock.opendj.ldap.schema.Schema getSchemaNG()
public Collection<org.forgerock.opendj.ldap.schema.AttributeType> getAttributeTypes()
public boolean hasAttributeType(String nameOrOid)
nameOrOid - The name or OID for which to make the determination, ignoring case considerationstrue if this schema contains an attribute type
with the provided name or OID, or false if not.public org.forgerock.opendj.ldap.schema.AttributeType getAttributeType(String nameOrOid)
nameOrOid - The name or OID of the attribute type to retrieve, ignoring case considerationspublic org.forgerock.opendj.ldap.schema.AttributeType getAttributeType(String nameOrOid, org.forgerock.opendj.ldap.schema.Syntax syntax)
nameOrOid - The name or OID of the attribute type to retrieve, ignoring case considerationssyntax - The syntax to use when creating the temporary "place-holder" attribute type.public org.forgerock.opendj.ldap.schema.AttributeType parseAttributeType(String definition) throws DirectoryException
definition - The definition of the attribute typeDirectoryException - If an error occurspublic void registerAttributeTypes(List<String> definitions, String schemaFile, boolean overwrite) throws DirectoryException
This method allows to do only one schema change for multiple definitions, thus avoiding the cost (and the issue of stale schema references) of rebuilding a new schema for each definition.
definitions - The definitions of the attribute typesschemaFile - The schema file where these definitions belong, can be nulloverwrite - Indicates whether to overwrite the attribute
type if it already exists based on OID or nameDirectoryException - If an error occurspublic void registerAttributeType(String definition, String schemaFile, boolean overwrite) throws DirectoryException
definition - The definition of the attribute typeschemaFile - The schema file where this definition belongs,
maybe nulloverwrite - Indicates whether to overwrite the attribute
type if it already exists based on OID or nameDirectoryException - If an error occurspublic void registerAttributeType(org.forgerock.opendj.ldap.schema.AttributeType attributeType, boolean overwriteExisting) throws DirectoryException
attributeType - The attribute type to register with this schema.overwriteExisting - Indicates whether to overwrite an existing mapping if there are
any conflicts (i.e., another attribute type with the same OID or
name).DirectoryException - If a conflict is encountered and the
overwriteExisting flag is set to falsepublic void registerAttributeType(org.forgerock.opendj.ldap.schema.AttributeType attributeType, String schemaFile, boolean overwriteExisting) throws DirectoryException
attributeType - The attribute type to register with this schema.schemaFile - The schema file where this definition belongs, maybe nulloverwriteExisting - Indicates whether to overwrite an existing mapping if there are
any conflicts (i.e., another attribute type with the same OID or
name).DirectoryException - If a conflict is encountered and the
overwriteExisting flag is set to falsepublic static String parseOID(String definition, org.forgerock.opendj.ldap.ResultCode parsingErrorResultCode, LocalizableMessageDescriptor.Arg0 parsingErrorMsg) throws DirectoryException
This method does not perform any check.
definition - The definition, assumed to be validparsingErrorResultCode - the result code to use if a problem occurs while parsing the definitionparsingErrorMsg - the message to use if a problem occurs while parsing the definitionnullDirectoryException - If a problem occurs while parsing the definitionpublic void deregisterAttributeType(org.forgerock.opendj.ldap.schema.AttributeType attributeType) throws DirectoryException
attributeType - The attribute type to deregister with this schema.DirectoryException - If the attribute type is referenced by another schema element.public List<org.forgerock.opendj.ldap.schema.AttributeType> getSubTypes(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
attributeType - The attribute type for which to retrieve
the set of registered subtypes.public ConcurrentHashMap<String,ObjectClass> getObjectClasses()
public boolean hasObjectClass(String lowerName)
lowerName - The name or OID for which to make the
determination, formatted in all lowercase
characters.true if this schema contains an objectclass with
the provided name or OID, or false if not.public ObjectClass getObjectClass(String lowerName)
lowerName - The name or OID of the objectclass to
retrieve, formatted in all lowercase
characters.null if no
class is registered with the provided name or OID.public void registerObjectClass(ObjectClass objectClass, boolean overwriteExisting) throws DirectoryException
objectClass - The objectclass to register with this
schema.overwriteExisting - Indicates whether to overwrite an
existing mapping if there are any
conflicts (i.e., another objectclass
with the same OID or name).DirectoryException - If a conflict is encountered and the
overwriteExisting flag
is set to false.public void deregisterObjectClass(ObjectClass objectClass)
objectClass - The objectclass to deregister with this
schema.public Collection<org.forgerock.opendj.ldap.schema.Syntax> getSyntaxes()
public boolean hasSyntax(String oid)
oid - The OID for which to make the determinationtrue if this schema contains an attribute syntax
with the provided OID, or false if not.public org.forgerock.opendj.ldap.schema.Syntax getSyntax(String oid)
oid - The OID of the attribute syntax to retrieve.null if no syntax is registered with the provided OID.public org.forgerock.opendj.ldap.schema.Syntax getDefaultSyntax()
public void registerSyntax(org.forgerock.opendj.ldap.schema.Syntax syntax, boolean overwriteExisting) throws DirectoryException
syntax - The attribute syntax to register with
this schema.overwriteExisting - Indicates whether to overwrite an
existing mapping if there are any
conflicts (i.e., another attribute
syntax with the same OID).DirectoryException - If a conflict is encountered and the
overwriteExisting flag
is set to falsepublic void deregisterSyntax(org.forgerock.opendj.ldap.schema.Syntax syntax) throws DirectoryException
syntax - The attribute syntax to deregister with this schema.DirectoryException - If the LDAP syntax is referenced by another schema element.public ConcurrentHashMap<String,LDAPSyntaxDescription> getLdapSyntaxDescriptions()
public LDAPSyntaxDescription getLdapSyntaxDescription(String lowerName)
lowerName - The OID of the ldap syntax to retrieve,
formatted in all lowercase characters.null if
no syntax is registered with the provided OID.public void registerLdapSyntaxDescription(String definition, boolean overwriteExisting) throws DirectoryException
definition - The ldap syntax definition to register with this schema.overwriteExisting - Indicates whether to overwrite an existing mapping if there are
any conflicts (i.e., another ldap syntax with the same OID).DirectoryException - If a conflict is encountered and overwriteExisting
flag is set to falsepublic void deregisterLdapSyntaxDescription(LDAPSyntaxDescription syntaxDesc) throws DirectoryException
syntaxDesc - The ldap syntax to deregister with this schema.DirectoryException - If the LDAP syntax is referenced by another schema element.public Collection<org.forgerock.opendj.ldap.schema.MatchingRule> getMatchingRules()
public boolean hasMatchingRule(String nameOrOid)
nameOrOid - The name or OID for which to make the determination, ignoring case considerationstrue if this schema contains a matching rule
with the provided name or OID, or false if not.public org.forgerock.opendj.ldap.schema.MatchingRule getMatchingRule(String nameOrOid)
nameOrOid - The name or OID of the matching rule to retrieve, ignoring case considerationsnull if no rule is registered with the provided name or OID.public void registerMatchingRule(org.forgerock.opendj.ldap.schema.MatchingRule matchingRule, boolean overwriteExisting) throws DirectoryException
matchingRule - The matching rule to register with this schema.overwriteExisting - Indicates whether to overwrite an existing mapping if there are
any conflicts (i.e., another matching rule with the same OID or
name).DirectoryException - If a conflict is encountered and the
overwriteExisting flag is set to falsepublic void deregisterMatchingRule(org.forgerock.opendj.ldap.schema.MatchingRule matchingRule) throws DirectoryException
matchingRule - The matching rule to deregister with this schema.DirectoryException - If the matching rule is referenced by another schema element.public ConcurrentHashMap<org.forgerock.opendj.ldap.schema.MatchingRule,MatchingRuleUse> getMatchingRuleUses()
public MatchingRuleUse getMatchingRuleUse(org.forgerock.opendj.ldap.schema.MatchingRule matchingRule)
matchingRule - The matching rule for which to retrieve the
matching rule use definition.null
if none exists for the specified matching rule.public void registerMatchingRuleUse(MatchingRuleUse matchingRuleUse, boolean overwriteExisting) throws DirectoryException
matchingRuleUse - The matching rule use definition to
register.overwriteExisting - Indicates whether to overwrite an
existing mapping if there are any
conflicts (i.e., another matching rule
use with the same matching rule).DirectoryException - If a conflict is encountered and the
overwriteExisting flag
is set to falsepublic void deregisterMatchingRuleUse(MatchingRuleUse matchingRuleUse)
matchingRuleUse - The matching rule use to deregister with
this schema.public ConcurrentHashMap<ObjectClass,DITContentRule> getDITContentRules()
public DITContentRule getDITContentRule(ObjectClass objectClass)
objectClass - The objectclass for the DIT content rule to
retrieve.null if
no DIT content rule is registered with the provided
objectclass.public void registerDITContentRule(DITContentRule ditContentRule, boolean overwriteExisting) throws DirectoryException
ditContentRule - The DIT content rule to register.overwriteExisting - Indicates whether to overwrite an
existing mapping if there are any
conflicts (i.e., another DIT content
rule with the same objectclass).DirectoryException - If a conflict is encountered and the
overwriteExisting flag
is set to falsepublic void deregisterDITContentRule(DITContentRule ditContentRule)
ditContentRule - The DIT content rule to deregister with
this schema.public ConcurrentHashMap<Integer,DITStructureRule> getDITStructureRulesByID()
public ConcurrentHashMap<NameForm,DITStructureRule> getDITStructureRulesByNameForm()
public DITStructureRule getDITStructureRule(int ruleID)
ruleID - The rule ID for the DIT structure rule to
retrieve.null
if no DIT structure rule is registered with the provided
rule ID.public DITStructureRule getDITStructureRule(NameForm nameForm)
nameForm - The name form for the DIT structure rule to
retrieve.null
if no DIT structure rule is registered with the provided
name form.public void registerDITStructureRule(DITStructureRule ditStructureRule, boolean overwriteExisting) throws DirectoryException
ditStructureRule - The DIT structure rule to register.overwriteExisting - Indicates whether to overwrite an
existing mapping if there are any
conflicts (i.e., another DIT structure
rule with the same name form).DirectoryException - If a conflict is encountered and the
overwriteExisting flag
is set to falsepublic void deregisterDITStructureRule(DITStructureRule ditStructureRule)
ditStructureRule - The DIT structure rule to deregister
with this schema.public ConcurrentHashMap<ObjectClass,List<NameForm>> getNameFormsByObjectClass()
public ConcurrentHashMap<String,NameForm> getNameFormsByNameOrOID()
public boolean hasNameForm(String lowerName)
lowerName - The name or OID for which to make the
determination, formatted in all lowercase
characters.true if this schema contains a name form with
the provided name or OID, or false if not.public List<NameForm> getNameForm(ObjectClass objectClass)
objectClass - The objectclass for the name form to
retrieve.null if no
name forms are registered with the provided
objectClass.public NameForm getNameForm(String lowerName)
lowerName - The name or OID of the name form to retrieve,
formatted in all lowercase characters.null if no name
form is registered with the provided name or OID.public void registerNameForm(NameForm nameForm, boolean overwriteExisting) throws DirectoryException
nameForm - The name form definition to register.overwriteExisting - Indicates whether to overwrite an
existing mapping if there are any
conflicts (i.e., another name form
with the same objectclass).DirectoryException - If a conflict is encountered and the
overwriteExisting flag
is set to falsepublic void deregisterNameForm(NameForm nameForm)
nameForm - The name form definition to deregister.public long getOldestModificationTime()
public void setOldestModificationTime(long oldestModificationTime)
oldestModificationTime - The modification timestamp for
the oldest file in the schema
configuration directory.public long getYoungestModificationTime()
public void setYoungestModificationTime(long youngestModificationTime)
youngestModificationTime - The modification timestamp for
the youngest file in the schema
configuration directory.public void rebuildDependentElements(SchemaFileElement element) throws DirectoryException
element - The element for which to recursively rebuild all
dependent elements.DirectoryException - If a problem occurs while rebuilding
any of the schema elements.public Schema duplicate()
Schema object that is a duplicate of this one. It elements may be added
and removed from the duplicate without impacting this version.Schema object that is a duplicate of this one.public Map<String,Attribute> getExtraAttributes()
public void addExtraAttribute(String name, Attribute attr)
name - The identifier of the extra Attribute.attr - The extra attribute that must be added to
this Schema.public static void writeConcatenatedSchema()
public static void genConcatenatedSchema(Set<String> attributeTypes, Set<String> objectClasses, Set<String> nameForms, Set<String> ditContentRules, Set<String> ditStructureRules, Set<String> matchingRuleUses, Set<String> ldapSyntaxes) throws IOException
attributeTypes - The set into which to place the
attribute types read from the schema
files.objectClasses - The set into which to place the object
classes read from the schema files.nameForms - The set into which to place the name
forms read from the schema files.ditContentRules - The set into which to place the DIT
content rules read from the schema
files.ditStructureRules - The set into which to place the DIT
structure rules read from the schema
files.matchingRuleUses - The set into which to place the
matching rule uses read from the
schema files.ldapSyntaxes - The set into which to place the
ldap syntaxes read from the
schema files.IOException - If a problem occurs while reading the
schema file elements.public static void readConcatenatedSchema(String concatSchemaFile, Set<String> attributeTypes, Set<String> objectClasses, Set<String> nameForms, Set<String> ditContentRules, Set<String> ditStructureRules, Set<String> matchingRuleUses, Set<String> ldapSyntaxes) throws IOException
concatSchemaFile - The path to the concatenated schema
file to be read.attributeTypes - The set into which to place the
attribute types read from the
concatenated schema file.objectClasses - The set into which to place the object
classes read from the concatenated
schema file.nameForms - The set into which to place the name
forms read from the concatenated
schema file.ditContentRules - The set into which to place the DIT
content rules read from the
concatenated schema file.ditStructureRules - The set into which to place the DIT
structure rules read from the
concatenated schema file.matchingRuleUses - The set into which to place the
matching rule uses read from the
concatenated schema file.ldapSyntaxes - The set into which to place the
ldap syntaxes read from the
concatenated schema file.IOException - If a problem occurs while reading the
schema file elements.public static void compareConcatenatedSchema(Set<String> oldElements, Set<String> newElements, org.forgerock.opendj.ldap.schema.AttributeType elementType, List<Modification> mods)
oldElements - The set of elements of the specified type
read from the previous concatenated schema
files.newElements - The set of elements of the specified type
read from the server's current schema.elementType - The attribute type associated with the
schema element being compared.mods - The list of modifications into which any
identified differences should be written.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public void destroy()
public void updateSchema(Schema.SchemaUpdater updater) throws DirectoryException
An implicit lock is performed, so it is in general not necessary
to call the {code lock()} and {code unlock() methods.
However, these method should be used if/when the SchemaBuilder passed
as an argument to the updater is not used to return the schema
(see for example usage in CoreSchemaProvider class). This
case should remain exceptional.
updater - the updater that returns a new schemaDirectoryException - if there is any problem updating the schemapublic <T> void updateSchemaOption(org.forgerock.util.Option<T> option, T newValue) throws DirectoryException
T - the schema option's typeoption - the schema option to updatenewValue - the new value for the schema optionDirectoryException - if there is any problem updating the schemapublic void exclusiveLock()
public void exclusiveUnlock()
public static String addSchemaFileToElementDefinitionIfAbsent(String definition, String schemaFile)
definition - The schema element definitionschemaFile - The name of the schema file to include in the definitionCopyright © 2010-2018 ForgeRock AS. All Rights Reserved.