Interface ContextBuilder

  • All Known Implementing Classes:
    DefaultContextBuilder

    public interface ContextBuilder
    Contract for building and closing LDAP contexts.
    Since:
    1.0
    Author:
    James Kleeh
    • Method Summary

      All Methods Instance Methods Abstract 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.
    • Method Detail

      • build

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

        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
        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

        void close​(@Nullable
                   javax.naming.directory.DirContext context)
        Closes the given context.
        Parameters:
        context - The context to close