public final class SchemaFactory extends Object
Schema
from an active directory schema search result. Active Directory does not adhere to
RFC 4512 to represent it's schema. Each schema element is represented with a separate LDAP entry. The factory parses
and sets the object classes and attribute types for the schema. The other properties on the schema object are not
available.Modifier and Type | Method and Description |
---|---|
protected static AttributeType |
createAttributeType(LdapEntry entry)
Creates an attribute type from the supplied ldap entry.
|
protected static ObjectClass |
createObjectClass(LdapEntry entry)
Creates an object class from the supplied ldap entry.
|
static Schema |
createSchema(ConnectionFactory factory,
String entryDn)
Creates a new schema.
|
static Schema |
createSchema(InputStream is)
Creates a new schema.
|
static Schema |
createSchema(SearchResult schemaResult)
Creates a new schema.
|
protected static SearchResult |
getSearchResult(ConnectionFactory factory,
String dn,
String filter,
String[] retAttrs)
Searches for the supplied dn and returns its ldap entry.
|
public static Schema createSchema(InputStream is) throws IOException
is
- containing the schema ldifIOException
- if an error occurs reading the input streampublic static Schema createSchema(ConnectionFactory factory, String entryDn) throws LdapException
factory
- to obtain an LDAP connection fromentryDn
- the schema entriesLdapException
- if the search failspublic static Schema createSchema(SearchResult schemaResult)
schemaResult
- containing the schema entriesprotected static SearchResult getSearchResult(ConnectionFactory factory, String dn, String filter, String[] retAttrs) throws LdapException
factory
- to obtain an LDAP connection fromdn
- to search forfilter
- to search withretAttrs
- attributes to returnLdapException
- if the search failsprotected static AttributeType createAttributeType(LdapEntry entry)
entry
- containing an attribute schemaprotected static ObjectClass createObjectClass(LdapEntry entry)
entry
- containing a class schemaCopyright © 2023. All rights reserved.