Package org.ldaptive.schema
Class SchemaFactory
java.lang.Object
org.ldaptive.schema.SchemaFactory
Factory to create
Schema
objects from an LDAP entry.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
Attribute types attribute name on the subschema entry.private static final String
DIT content rules attribute name on the subschema entry.private static final String
DIT structure rules attribute name on the subschema entry.private static final String
LDAP syntaxes attribute name on the subschema entry.private static final String
Matching rule use attribute name on the subschema entry.private static final String
Matching rules attribute name on the subschema entry.private static final String
Name forms attribute name on the subschema entry.private static final String
Object classes attribute name on the subschema entry.private static final String
Attribute on the root DSE indicating the location of the subschema entry. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Schema
Creates a new schema.static Schema
createSchema
(ConnectionFactory factory) Creates a new schema.static Schema
createSchema
(ConnectionFactory factory, String entryDn) Creates a new schema.static Schema
createSchema
(LdapEntry schemaEntry) Creates a new schema.protected static LdapEntry
getLdapEntry
(ConnectionFactory factory, String dn, String filter, String... retAttrs) Searches for the supplied dn and returns its ldap entry.
-
Field Details
-
SUBSCHEMA_SUBENTRY_ATTR_NAME
Attribute on the root DSE indicating the location of the subschema entry.- See Also:
-
ATTRIBUTE_TYPES_ATTR_NAME
Attribute types attribute name on the subschema entry.- See Also:
-
DIT_CONTENT_RULES_ATTR_NAME
DIT content rules attribute name on the subschema entry.- See Also:
-
DIT_STRUCTURE_RULES_ATTR_NAME
DIT structure rules attribute name on the subschema entry.- See Also:
-
LDAP_SYNTAXES_ATTR_NAME
LDAP syntaxes attribute name on the subschema entry.- See Also:
-
MATCHING_RULES_ATTR_NAME
Matching rules attribute name on the subschema entry.- See Also:
-
MATCHING_RULE_USE_ATTR_NAME
Matching rule use attribute name on the subschema entry.- See Also:
-
NAME_FORMS_ATTR_NAME
Name forms attribute name on the subschema entry.- See Also:
-
OBJECT_CLASS_ATTR_NAME
Object classes attribute name on the subschema entry.- See Also:
-
-
Constructor Details
-
SchemaFactory
private SchemaFactory()Default constructor.
-
-
Method Details
-
createSchema
Creates a new schema. The input stream should contain the LDIF for the subschema entry.- Parameters:
is
- containing the schema ldif- Returns:
- schema created from the ldif
- Throws:
IOException
- if an error occurs reading the input stream
-
createSchema
Creates a new schema. The subschema subentry is searched for on the root DSE, followed by searching for the subschema entry itself.- Parameters:
factory
- to obtain an LDAP connection from- Returns:
- schema created from the connection factory
- Throws:
LdapException
- if the search fails
-
createSchema
Creates a new schema. The entryDn is searched to obtain the schema.- Parameters:
factory
- to obtain an LDAP connection fromentryDn
- the subschema entry- Returns:
- schema created from the connection factory
- Throws:
LdapException
- if the search fails
-
createSchema
Creates a new schema. The schema entry is parsed to obtain the schema.- Parameters:
schemaEntry
- containing the schema- Returns:
- schema created from the entry
-
getLdapEntry
protected static LdapEntry getLdapEntry(ConnectionFactory factory, String dn, String filter, String... retAttrs) throws LdapException Searches for the supplied dn and returns its ldap entry.- Parameters:
factory
- to obtain an LDAP connection fromdn
- to search forfilter
- search filterretAttrs
- attributes to return- Returns:
- ldap entry
- Throws:
LdapException
- if the search fails
-