public class SchemaEntityFactory extends 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 String[] |
EMPTY_ARRAY
The empty string array.
|
private static List<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(org.apache.directory.api.ldap.model.schema.SchemaObject description,
String schemaEntity)
Check that the Description is not null
|
private void |
checkEntry(org.apache.directory.api.ldap.model.entry.Entry entry,
String schemaEntity)
Check that the Entry is not null
|
private org.apache.directory.api.ldap.model.schema.LdapComparator<?> |
classLoadComparator(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
String oid,
String className,
org.apache.directory.api.ldap.model.entry.Attribute byteCode)
Class load a comparator instances
|
private org.apache.directory.api.ldap.model.schema.Normalizer |
classLoadNormalizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
String oid,
String className,
org.apache.directory.api.ldap.model.entry.Attribute byteCode)
Class load a normalizer instances
|
private org.apache.directory.api.ldap.model.schema.SyntaxChecker |
classLoadSyntaxChecker(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
String oid,
String className,
org.apache.directory.api.ldap.model.entry.Attribute byteCode)
Class load a SyntaxChecker instance
|
org.apache.directory.api.ldap.model.schema.AttributeType |
getAttributeType(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Construct an AttributeType from an entry representing an AttributeType.
|
private org.apache.directory.api.ldap.model.entry.Attribute |
getByteCode(org.apache.directory.api.ldap.model.schema.LoadableSchemaObject description,
String objectType)
Process the ByteCode attribute
|
private String |
getFqcn(org.apache.directory.api.ldap.model.entry.Entry entry,
String objectType)
Process the FQCN attribute
|
private String |
getFqcn(org.apache.directory.api.ldap.model.schema.LoadableSchemaObject description,
String objectType)
Process the FQCN attribute
|
org.apache.directory.api.ldap.model.schema.LdapComparator<?> |
getLdapComparator(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Retrieve and load a Comparator class from the DIT.
|
org.apache.directory.api.ldap.model.schema.LdapComparator<?> |
getLdapComparator(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.schema.parsers.LdapComparatorDescription comparatorDescription,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Construct a LdapComparator from a description of a comparator.
|
org.apache.directory.api.ldap.model.schema.MatchingRule |
getMatchingRule(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Construct an MatchingRule from an entry get from the Dit
|
org.apache.directory.api.ldap.model.schema.Normalizer |
getNormalizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Retrieve and load a Normalizer class from the DIT.
|
org.apache.directory.api.ldap.model.schema.Normalizer |
getNormalizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.schema.parsers.NormalizerDescription normalizerDescription,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Create a new instance of a Normalizer
|
org.apache.directory.api.ldap.model.schema.ObjectClass |
getObjectClass(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName) |
private String |
getOid(org.apache.directory.api.ldap.model.entry.Entry entry,
String objectType,
boolean strict)
Get an OID from an entry.
|
private String |
getOid(org.apache.directory.api.ldap.model.schema.SchemaObject description,
String objectType)
Get an OID from an entry.
|
org.apache.directory.api.ldap.model.schema.registries.Schema |
getSchema(org.apache.directory.api.ldap.model.entry.Entry entry)
Return an instance of the Schema associated to the entry
|
private org.apache.directory.api.ldap.model.schema.registries.Schema |
getSchema(String schemaName,
org.apache.directory.api.ldap.model.schema.registries.Registries registries)
Get the schema from its name.
|
private List<String> |
getStrings(org.apache.directory.api.ldap.model.entry.Attribute attr)
Create a list of string from a multivalued attribute's values
|
org.apache.directory.api.ldap.model.schema.LdapSyntax |
getSyntax(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName) |
org.apache.directory.api.ldap.model.schema.SyntaxChecker |
getSyntaxChecker(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Retrieve and load a syntaxChecker class from the DIT.
|
org.apache.directory.api.ldap.model.schema.SyntaxChecker |
getSyntaxChecker(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription syntaxCheckerDescription,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
Create a new instance of a SyntaxChecker
|
private void |
setSchemaObjectProperties(org.apache.directory.api.ldap.model.schema.SchemaObject schemaObject,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Schema schema)
Process the common attributes to all SchemaObjects :
- obsolete
- description
- names
- schemaName
- specification (if any)
- extensions
- isReadOnly
- isEnabled
|
private void |
setSchemaObjectProperties(org.apache.directory.api.ldap.model.schema.SchemaObject schemaObject,
org.apache.directory.api.ldap.model.schema.SchemaObject description,
org.apache.directory.api.ldap.model.schema.registries.Schema schema)
Process the common attributes to all SchemaObjects :
- obsolete
- description
- names
- schemaName
- specification (if any)
- extensions
- isEnabled
|
private static final org.slf4j.Logger LOG
private static final String[] EMPTY_ARRAY
private final AttributeClassLoader classLoader
public SchemaEntityFactory()
private String getOid(org.apache.directory.api.ldap.model.entry.Entry entry, String objectType, boolean strict) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
entry - The entry to processobjectType - The type of processed SchemaObjectstrict - If we want a strict control of the OIDorg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If the OID is not validprivate String getOid(org.apache.directory.api.ldap.model.schema.SchemaObject description, String objectType) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
description - The schemaObject descriptionobjectType - The type of SchemaObject being processedorg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If the OID is invalidprivate void checkEntry(org.apache.directory.api.ldap.model.entry.Entry entry,
String schemaEntity)
entry - The entry to checkschemaEntity - The message to log if the entry is invalidprivate void checkDescription(org.apache.directory.api.ldap.model.schema.SchemaObject description,
String schemaEntity)
description - description entry to checkschemaEntity - The message to log if the description is invalidprivate org.apache.directory.api.ldap.model.schema.registries.Schema getSchema(String schemaName, org.apache.directory.api.ldap.model.schema.registries.Registries registries)
schemaName - The schema name to fetchregistries - The registries where we get the schema frompublic org.apache.directory.api.ldap.model.schema.registries.Schema getSchema(org.apache.directory.api.ldap.model.entry.Entry entry)
throws org.apache.directory.api.ldap.model.exception.LdapException
getSchema in interface EntityFactoryentry - The Schema entryorg.apache.directory.api.ldap.model.exception.LdapException - If the instance can't be createdprivate org.apache.directory.api.ldap.model.schema.SyntaxChecker classLoadSyntaxChecker(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
String oid,
String className,
org.apache.directory.api.ldap.model.entry.Attribute byteCode)
throws org.apache.directory.api.ldap.model.exception.LdapException
schemaManager - The SchemaManageroid - The SyntaxChecker OIDclassName - The class name associated with the SyntaxCheckerbyteCode - The SyntaxChecker class bytecodeorg.apache.directory.api.ldap.model.exception.LdapException - If the SyntaxChecker cannot be loadedpublic org.apache.directory.api.ldap.model.schema.SyntaxChecker getSyntaxChecker(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapException - if anything fails during loadingpublic org.apache.directory.api.ldap.model.schema.SyntaxChecker getSyntaxChecker(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.schema.parsers.SyntaxCheckerDescription syntaxCheckerDescription,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.LdapException
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 oforg.apache.directory.api.ldap.model.exception.LdapException - If the creation has failedprivate org.apache.directory.api.ldap.model.schema.LdapComparator<?> classLoadComparator(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
String oid,
String className,
org.apache.directory.api.ldap.model.entry.Attribute byteCode)
throws org.apache.directory.api.ldap.model.exception.LdapException
schemaManager - The SchemaManageroid - The comparator OIDclassName - The class name associated with the comparatorbyteCode - The comparator class bytecodeorg.apache.directory.api.ldap.model.exception.LdapException - If the comparator cannot be loadedpublic org.apache.directory.api.ldap.model.schema.LdapComparator<?> getLdapComparator(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.schema.parsers.LdapComparatorDescription comparatorDescription,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.LdapException
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 oforg.apache.directory.api.ldap.model.exception.LdapException - If the creation has failedpublic org.apache.directory.api.ldap.model.schema.LdapComparator<?> getLdapComparator(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapException - if anything fails during loadingprivate org.apache.directory.api.ldap.model.schema.Normalizer classLoadNormalizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
String oid,
String className,
org.apache.directory.api.ldap.model.entry.Attribute byteCode)
throws org.apache.directory.api.ldap.model.exception.LdapException
schemaManager - The SchemaManageroid - The normalizer OIDclassName - The class name associated with the normalizerbyteCode - The normalizer class bytecodeorg.apache.directory.api.ldap.model.exception.LdapException - If the normalizer cannot be loadedpublic org.apache.directory.api.ldap.model.schema.Normalizer getNormalizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.schema.parsers.NormalizerDescription normalizerDescription,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.LdapException
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 oforg.apache.directory.api.ldap.model.exception.LdapException - If the creation has failedpublic org.apache.directory.api.ldap.model.schema.Normalizer getNormalizer(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapException - if anything fails during loadingpublic org.apache.directory.api.ldap.model.schema.LdapSyntax getSyntax(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException,
org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If the Syntax does not existorg.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException - If the schema is not loadedpublic org.apache.directory.api.ldap.model.schema.MatchingRule getMatchingRule(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException,
org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If the MatchingRule does not existorg.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException - If the schema is not loadedprivate List<String> getStrings(org.apache.directory.api.ldap.model.entry.Attribute attr)
attr - The Attribute to readpublic org.apache.directory.api.ldap.model.schema.ObjectClass getObjectClass(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapException - if anything fails during loadingpublic org.apache.directory.api.ldap.model.schema.AttributeType getAttributeType(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Registries targetRegistries,
String schemaName)
throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException,
org.apache.directory.api.ldap.model.exception.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 oforg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If the AttributeType does not existorg.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException - If the schema is not loadedprivate String getFqcn(org.apache.directory.api.ldap.model.entry.Entry entry, String objectType) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
entry - The entry to readobjectType - The type of schema objectorg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If the attribute does not contain a valid valueprivate String getFqcn(org.apache.directory.api.ldap.model.schema.LoadableSchemaObject description, String objectType)
description - The Schema Object descriptionobjectType - The SchemaObject typeprivate org.apache.directory.api.ldap.model.entry.Attribute getByteCode(org.apache.directory.api.ldap.model.schema.LoadableSchemaObject description,
String objectType)
description - The SchemaObject descriptionobjectType - The SchemaObject typeprivate void setSchemaObjectProperties(org.apache.directory.api.ldap.model.schema.SchemaObject schemaObject,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.registries.Schema schema)
throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException
schemaObject - The SchemaObject to setentry - The entry containing the SchemaObject propertiesschema - the updated Schemaorg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException - If some of the properties are invalidprivate void setSchemaObjectProperties(org.apache.directory.api.ldap.model.schema.SchemaObject schemaObject,
org.apache.directory.api.ldap.model.schema.SchemaObject description,
org.apache.directory.api.ldap.model.schema.registries.Schema schema)
schemaObject - The SchemaObject to setdescription - The SchemaObjetc descriptionschema - the updated SchemaCopyright © 2003–2023 The Apache Software Foundation. All rights reserved.