org.ldaptive.schema
Class SchemaFactory

java.lang.Object
  extended by org.ldaptive.schema.SchemaFactory

public final class SchemaFactory
extends Object

Factory to create Schema objects from an LDAP entry.

Version:
$Revision: 2940 $ $Date: 2014-03-31 11:10:46 -0400 (Mon, 31 Mar 2014) $
Author:
Middleware Services

Method Summary
static Schema createSchema(ConnectionFactory factory)
          Creates a new schema.
static Schema createSchema(ConnectionFactory factory, String entryDn)
          Creates a new schema.
static Schema createSchema(InputStream is)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSchema

public static Schema createSchema(InputStream is)
                           throws IOException
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

public static Schema createSchema(ConnectionFactory factory)
                           throws LdapException
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

public static Schema createSchema(ConnectionFactory factory,
                                  String entryDn)
                           throws LdapException
Creates a new schema. The entryDn is searched to obtain the schema.

Parameters:
factory - to obtain an LDAP connection from
entryDn - the subschema entry
Returns:
schema created from the connection factory
Throws:
LdapException - if the search fails

createSchema

public static Schema createSchema(LdapEntry schemaEntry)
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 from
dn - to search for
filter - search filter
retAttrs - attributes to return
Returns:
ldap entry
Throws:
LdapException - if the search fails


Copyright © 2003-2015 Virginia Tech. All Rights Reserved.