Class DefaultContextBuilder

  • All Implemented Interfaces:
    ContextBuilder

    @Singleton
    public class DefaultContextBuilder
    extends java.lang.Object
    implements ContextBuilder
    Default implementation of ContextBuilder.
    Since:
    1.0
    Author:
    James Kleeh
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.naming.directory.DirContext build​(ContextSettings contextSettings)  
      javax.naming.directory.DirContext build​(java.lang.String factory, java.lang.String server, java.lang.String user, java.lang.String password, boolean pooled)  
      void close​(javax.naming.directory.DirContext context)
      Closes the given context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultContextBuilder

        public DefaultContextBuilder()
    • Method Detail

      • build

        public javax.naming.directory.DirContext build​(ContextSettings contextSettings)
                                                throws javax.naming.NamingException
        Specified by:
        build in interface ContextBuilder
        Parameters:
        contextSettings - The settings to use to build the context
        Returns:
        The context
        Throws:
        javax.naming.NamingException - If an error occurs
      • build

        public javax.naming.directory.DirContext build​(java.lang.String factory,
                                                       java.lang.String server,
                                                       java.lang.String user,
                                                       java.lang.String password,
                                                       boolean pooled)
                                                throws javax.naming.NamingException
        Specified by:
        build in interface ContextBuilder
        Parameters:
        factory - The factory class
        server - The ldap server
        user - The user DN to bind
        password - The password to bind
        pooled - If the query should be pooled
        Returns:
        The context
        Throws:
        javax.naming.NamingException - If an error occurs
      • close

        public void close​(javax.naming.directory.DirContext context)
        Description copied from interface: ContextBuilder
        Closes the given context.
        Specified by:
        close in interface ContextBuilder
        Parameters:
        context - The context to close