public class Registries extends Object implements SchemaLoaderListener, Cloneable
Modifier and Type | Field and Description |
---|---|
static boolean |
RELAXED
The relaxed mode
|
static boolean |
STRICT
The strict mode
|
Constructor and Description |
---|
Registries()
Creates a new instance of Registries.
|
Modifier and Type | Method and Description |
---|---|
void |
add(SchemaObject schemaObject,
boolean check)
Applies the added SchemaObject to the given register
|
void |
addReference(SchemaObject base,
SchemaObject referenced)
Add an association between a SchemaObject an the SchemaObject it refers
|
Set<SchemaObjectWrapper> |
addSchema(String schemaName)
Create a new schema association with its content
|
void |
associateWithSchema(SchemaObject schemaObject)
Store the given SchemaObject in the Map associating SchemaObjetcs to their
related Schema.
|
void |
buildReference(SchemaObject schemaObject)
Build the SchemaObject references
|
void |
buildReferences()
Build the usedBy and using references from the stored elements.
|
boolean |
check()
Check the registries for invalid relations.
|
void |
checkRefInteg()
Attempts to resolve the dependent schema objects of all entities that
refer to other objects within the registries.
|
void |
clear()
Clear the registries from all its elements
|
Registries |
clone()
Clone the Registries.
|
boolean |
contains(SchemaObject schemaObject)
Tells if the given SchemaObject is present in one schema.
|
void |
delCrossReferences(AttributeType attributeType)
Add the SchemaObjectReferences.
|
void |
delCrossReferences(MatchingRule matchingRule)
Delete the MR references (using and usedBy) :
MR -> C
MR -> N
MR -> S
|
void |
delete(SchemaObject schemaObject)
Remove the given SchemaObject from the registries
|
void |
delReference(SchemaObject base,
SchemaObject referenced)
Delete an association between a SchemaObject an the SchemaObject it refers
|
void |
dissociateFromSchema(SchemaObject schemaObject)
Store the given SchemaObject in the Map associating SchemaObjetcs to their
related Schema.
|
String |
dumpUsedBy()
Dump the UsedBy data structure as a String
|
String |
dumpUsing()
Dump the Using data structure as a String
|
AttributeTypeRegistry |
getAttributeTypeRegistry() |
ComparatorRegistry |
getComparatorRegistry() |
DitContentRuleRegistry |
getDitContentRuleRegistry() |
DitStructureRuleRegistry |
getDitStructureRuleRegistry() |
SchemaErrorHandler |
getErrorHandler() |
OidRegistry<SchemaObject> |
getGlobalOidRegistry() |
LdapSyntaxRegistry |
getLdapSyntaxRegistry() |
Schema |
getLoadedSchema(String schemaName)
Gets a schema that has been loaded into these Registries.
|
Map<String,Schema> |
getLoadedSchemas()
Gets an unmodifiable Map of schema names to loaded Schema objects.
|
MatchingRuleRegistry |
getMatchingRuleRegistry() |
MatchingRuleUseRegistry |
getMatchingRuleUseRegistry() |
NameFormRegistry |
getNameFormRegistry() |
NormalizerRegistry |
getNormalizerRegistry() |
Map<String,Set<SchemaObjectWrapper>> |
getObjectBySchemaName() |
ObjectClassRegistry |
getObjectClassRegistry() |
String |
getOid(String name)
Get an OID from a name.
|
Set<SchemaObjectWrapper> |
getReferencing(SchemaObject schemaObject)
Check that we can remove a given SchemaObject without breaking some of its references.
|
SyntaxCheckerRegistry |
getSyntaxCheckerRegistry() |
Set<SchemaObjectWrapper> |
getUsedBy(SchemaObject schemaObject)
Gets the Set of SchemaObjects referencing the given SchemaObject
|
Set<SchemaObjectWrapper> |
getUsing(SchemaObject schemaObject)
Gets the Set of SchemaObjects referenced by the given SchemaObject
|
boolean |
isDisabledAccepted()
Tells if the Registries accept disabled elements.
|
boolean |
isReferenced(SchemaObject schemaObject)
Checks if a specific SchemaObject is referenced by any other SchemaObject.
|
boolean |
isRelaxed()
Tells if the Registries is permissive or if it must be checked
against inconsistencies.
|
boolean |
isSchemaLoaded(String schemaName)
Checks to see if a particular Schema is loaded.
|
boolean |
isStrict()
Tells if the Registries is strict.
|
void |
removeReference(SchemaObject schemaObject)
Unlink the SchemaObject references
|
void |
schemaLoaded(Schema schema)
Merely adds the schema to the set of loaded schemas.
|
void |
schemaUnloaded(Schema schema)
Merely removes the schema from the set of loaded schemas.
|
void |
setDisabledAccepted(boolean disabledAccepted)
Change the Registries behavior regarding disabled SchemaObject element.
|
void |
setErrorHandler(SchemaErrorHandler errorHandler) |
void |
setRelaxed()
Change the Registries to a relaxed mode, where invalid SchemaObjects
can be registered.
|
void |
setStrict()
Change the Registries to a strict mode, where invalid SchemaObjects
cannot be registered.
|
String |
toString() |
public static final boolean STRICT
public static final boolean RELAXED
public Registries()
public AttributeTypeRegistry getAttributeTypeRegistry()
public ComparatorRegistry getComparatorRegistry()
public DitContentRuleRegistry getDitContentRuleRegistry()
public DitStructureRuleRegistry getDitStructureRuleRegistry()
public MatchingRuleRegistry getMatchingRuleRegistry()
public MatchingRuleUseRegistry getMatchingRuleUseRegistry()
public NameFormRegistry getNameFormRegistry()
public NormalizerRegistry getNormalizerRegistry()
public ObjectClassRegistry getObjectClassRegistry()
public OidRegistry<SchemaObject> getGlobalOidRegistry()
public SyntaxCheckerRegistry getSyntaxCheckerRegistry()
public LdapSyntaxRegistry getLdapSyntaxRegistry()
public String getOid(String name)
name
- The name we are looking atpublic Schema getLoadedSchema(String schemaName)
schemaName
- the name of the schema to lookuppublic boolean isSchemaLoaded(String schemaName)
schemaName
- the name of the Schema to checkpublic void checkRefInteg()
public void delCrossReferences(AttributeType attributeType)
attributeType
- The AttributeType to removepublic void delCrossReferences(MatchingRule matchingRule)
matchingRule
- The MatchinRule refere ce to deletepublic void buildReference(SchemaObject schemaObject)
schemaObject
- The SchemaObject to addpublic void removeReference(SchemaObject schemaObject)
schemaObject
- The SchemaObject to removepublic void buildReferences()
public void add(SchemaObject schemaObject, boolean check) throws LdapException
schemaObject
- The SchemaObject to addcheck
- A flag set when we want the schema checks to be doneLdapException
- If we weren't able to add the SchemaObjectpublic void delete(SchemaObject schemaObject) throws LdapException
schemaObject
- The SchemaObject to deleteLdapException
- If the deletion failedpublic void schemaLoaded(Schema schema)
schemaLoaded
in interface SchemaLoaderListener
schema
- the Schema that was loadedpublic void schemaUnloaded(Schema schema)
schemaUnloaded
in interface SchemaLoaderListener
schema
- the Schema that was unloadedpublic Map<String,Schema> getLoadedSchemas()
public Map<String,Set<SchemaObjectWrapper>> getObjectBySchemaName()
public boolean contains(SchemaObject schemaObject)
schemaObject
- The schemaObject we are looking forpublic Set<SchemaObjectWrapper> addSchema(String schemaName)
schemaName
- The schema namepublic void associateWithSchema(SchemaObject schemaObject)
schemaObject
- The schemaObject to registerpublic void dissociateFromSchema(SchemaObject schemaObject) throws LdapException
schemaObject
- The schemaObject to registerLdapException
- If there is a problempublic boolean isReferenced(SchemaObject schemaObject)
schemaObject
- The SchemaObject we are looking forpublic Set<SchemaObjectWrapper> getUsedBy(SchemaObject schemaObject)
schemaObject
- The SchemaObject we are looking forpublic String dumpUsedBy()
public String dumpUsing()
public Set<SchemaObjectWrapper> getUsing(SchemaObject schemaObject)
schemaObject
- The SchemaObject we are looking forpublic void addReference(SchemaObject base, SchemaObject referenced)
base
- The base SchemaObjectreferenced
- The referenced SchemaObjectpublic void delReference(SchemaObject base, SchemaObject referenced)
base
- The base SchemaObjectreferenced
- The referenced SchemaObjectpublic boolean check()
public Registries clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public boolean isRelaxed()
public boolean isStrict()
public void setRelaxed()
public void setStrict()
public SchemaErrorHandler getErrorHandler()
public void setErrorHandler(SchemaErrorHandler errorHandler)
public boolean isDisabledAccepted()
public Set<SchemaObjectWrapper> getReferencing(SchemaObject schemaObject)
schemaObject
- The SchemaObject to removepublic void setDisabledAccepted(boolean disabledAccepted)
disabledAccepted
- If false
, then the Registries won't accept
disabled SchemaObject or enabled SchemaObject from disabled schemapublic void clear() throws LdapException
LdapException
- If something goes wrongpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.