public class SchemaEntityFactory extends java.lang.Object implements EntityFactory
| Modifier and Type | Field and Description |
|---|---|
private AttributeClassLoader |
classLoader
A special ClassLoader that loads a class from the bytecode attribute
|
private static java.lang.String[] |
EMPTY_ARRAY
The empty string array.
|
private static java.util.List<java.lang.String> |
EMPTY_LIST
The empty string list.
|
private static org.slf4j.Logger |
LOG
Slf4j logger
|
| Constructor and Description |
|---|
SchemaEntityFactory()
Instantiates a new schema entity factory.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkDescription(SchemaObject description,
java.lang.String schemaEntity)
Check that the Description is not null
|
private void |
checkEntry(Entry entry,
java.lang.String schemaEntity)
Check that the Entry is not null
|
private LdapComparator<?> |
classLoadComparator(SchemaManager schemaManager,
java.lang.String oid,
java.lang.String className,
Attribute byteCode)
Class load a comparator instances
|
private Normalizer |
classLoadNormalizer(SchemaManager schemaManager,
java.lang.String oid,
java.lang.String className,
Attribute byteCode)
Class load a normalizer instances
|
private SyntaxChecker |
classLoadSyntaxChecker(SchemaManager schemaManager,
java.lang.String oid,
java.lang.String className,
Attribute byteCode)
Class load a syntaxChecker instance
|
AttributeType |
getAttributeType(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName)
Construct an AttributeType from an entry representing an AttributeType.
|
private Attribute |
getByteCode(LoadableSchemaObject description,
java.lang.String objectType)
Process the ByteCode attribute
|
private java.lang.String |
getFqcn(Entry entry,
java.lang.String objectType)
Process the FQCN attribute
|
private java.lang.String |
getFqcn(LoadableSchemaObject description,
java.lang.String objectType)
Process the FQCN attribute
|
LdapComparator<?> |
getLdapComparator(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName)
Retrieve and load a Comparator class from the DIT.
|
LdapComparator<?> |
getLdapComparator(SchemaManager schemaManager,
LdapComparatorDescription comparatorDescription,
Registries targetRegistries,
java.lang.String schemaName)
Construct a LdapComparator from a description of a comparator.
|
MatchingRule |
getMatchingRule(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName)
Construct an MatchingRule from an entry get from the Dit
|
Normalizer |
getNormalizer(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName)
Retrieve and load a Normalizer class from the DIT.
|
Normalizer |
getNormalizer(SchemaManager schemaManager,
NormalizerDescription normalizerDescription,
Registries targetRegistries,
java.lang.String schemaName)
Create a new instance of a Normalizer
|
ObjectClass |
getObjectClass(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName) |
private java.lang.String |
getOid(Entry entry,
java.lang.String objectType,
boolean strict)
Get an OID from an entry.
|
private java.lang.String |
getOid(SchemaObject description,
java.lang.String objectType)
Get an OID from an entry.
|
Schema |
getSchema(Entry entry)
Return an instance of the Schema associated to the entry
|
private Schema |
getSchema(java.lang.String schemaName,
Registries registries)
Get the schema from its name.
|
private java.util.List<java.lang.String> |
getStrings(Attribute attr)
Create a list of string from a multivalued attribute's values
|
private java.lang.String |
getStringValue(Attribute attribute)
Return a String value, from teh given Valu, even if it's a binary value
|
LdapSyntax |
getSyntax(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName) |
SyntaxChecker |
getSyntaxChecker(SchemaManager schemaManager,
Entry entry,
Registries targetRegistries,
java.lang.String schemaName)
Retrieve and load a syntaxChecker class from the DIT.
|
SyntaxChecker |
getSyntaxChecker(SchemaManager schemaManager,
SyntaxCheckerDescription syntaxCheckerDescription,
Registries targetRegistries,
java.lang.String schemaName)
Create a new instance of a SyntaxChecker
|
private void |
setSchemaObjectProperties(SchemaObject schemaObject,
Entry entry,
Schema schema)
Process the common attributes to all SchemaObjects :
- obsolete
- description
- names
- schemaName
- specification (if any)
- extensions
- isReadOnly
- isEnabled
|
private void |
setSchemaObjectProperties(SchemaObject schemaObject,
SchemaObject description,
Schema schema)
Process the common attributes to all SchemaObjects :
- obsolete
- description
- names
- schemaName
- specification (if any)
- extensions
- isReadOnly
- isEnabled
|
private static final org.slf4j.Logger LOG
private static final java.util.List<java.lang.String> EMPTY_LIST
private static final java.lang.String[] EMPTY_ARRAY
private final AttributeClassLoader classLoader
public SchemaEntityFactory()
private java.lang.String getOid(Entry entry, java.lang.String objectType, boolean strict) throws LdapInvalidAttributeValueException
private java.lang.String getOid(SchemaObject description, java.lang.String objectType) throws LdapInvalidAttributeValueException
private void checkEntry(Entry entry, java.lang.String schemaEntity)
private void checkDescription(SchemaObject description, java.lang.String schemaEntity)
private Schema getSchema(java.lang.String schemaName, Registries registries)
public Schema getSchema(Entry entry) throws LdapException
getSchema in interface EntityFactoryentry - The Schema entryLdapExceptionprivate SyntaxChecker classLoadSyntaxChecker(SchemaManager schemaManager, java.lang.String oid, java.lang.String className, Attribute byteCode) throws java.lang.Exception
java.lang.Exceptionpublic SyntaxChecker getSyntaxChecker(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapException
getSyntaxChecker in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build a SyntaxCheckertargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapException - if anything fails during loadingpublic SyntaxChecker getSyntaxChecker(SchemaManager schemaManager, SyntaxCheckerDescription syntaxCheckerDescription, Registries targetRegistries, java.lang.String schemaName) throws java.lang.Exception
getSyntaxChecker in interface EntityFactoryschemaManager - The Schema ManagersyntaxCheckerDescription - The SyntaxChecker description objecttargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofjava.lang.Exception - If the creation has failedprivate LdapComparator<?> classLoadComparator(SchemaManager schemaManager, java.lang.String oid, java.lang.String className, Attribute byteCode) throws java.lang.Exception
java.lang.Exceptionpublic LdapComparator<?> getLdapComparator(SchemaManager schemaManager, LdapComparatorDescription comparatorDescription, Registries targetRegistries, java.lang.String schemaName) throws java.lang.Exception
getLdapComparator in interface EntityFactoryschemaManager - The Schema ManagercomparatorDescription - The LdapComparator description objecttargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofjava.lang.Exception - If the creation has failedpublic LdapComparator<?> getLdapComparator(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapException
getLdapComparator in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build a LdapComparatortargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapException - if anything fails during loadingprivate Normalizer classLoadNormalizer(SchemaManager schemaManager, java.lang.String oid, java.lang.String className, Attribute byteCode) throws java.lang.Exception
java.lang.Exceptionpublic Normalizer getNormalizer(SchemaManager schemaManager, NormalizerDescription normalizerDescription, Registries targetRegistries, java.lang.String schemaName) throws java.lang.Exception
getNormalizer in interface EntityFactoryschemaManager - The Schema ManagernormalizerDescription - The Normalizer description objecttargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofjava.lang.Exception - If the creation has failedpublic Normalizer getNormalizer(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapException
getNormalizer in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build a NormalizertargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapException - if anything fails during loadingpublic LdapSyntax getSyntax(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapInvalidAttributeValueException, LdapUnwillingToPerformException
getSyntax in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build a LdapSyntaxtargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapInvalidAttributeValueExceptionLdapUnwillingToPerformExceptionpublic MatchingRule getMatchingRule(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapUnwillingToPerformException, LdapInvalidAttributeValueException
getMatchingRule in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build a MatchingRuletargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapUnwillingToPerformExceptionLdapInvalidAttributeValueExceptionprivate java.util.List<java.lang.String> getStrings(Attribute attr)
public ObjectClass getObjectClass(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapException
getObjectClass in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build an ObjectClasstargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapExceptionpublic AttributeType getAttributeType(SchemaManager schemaManager, Entry entry, Registries targetRegistries, java.lang.String schemaName) throws LdapInvalidAttributeValueException, LdapUnwillingToPerformException
getAttributeType in interface EntityFactoryschemaManager - The Schema Managerentry - The entry containing all the informations to build an AttributeTypetargetRegistries - The registries containing all the enabled SchemaObjectsschemaName - The schema this SchemaObject will be part ofLdapInvalidAttributeValueExceptionLdapUnwillingToPerformExceptionprivate java.lang.String getFqcn(Entry entry, java.lang.String objectType) throws LdapInvalidAttributeValueException
private java.lang.String getFqcn(LoadableSchemaObject description, java.lang.String objectType)
private Attribute getByteCode(LoadableSchemaObject description, java.lang.String objectType)
private java.lang.String getStringValue(Attribute attribute)
private void setSchemaObjectProperties(SchemaObject schemaObject, Entry entry, Schema schema) throws LdapInvalidAttributeValueException
private void setSchemaObjectProperties(SchemaObject schemaObject, SchemaObject description, Schema schema)