Class AttributeUtil


  • public class AttributeUtil
    extends java.lang.Object
    Static utility methods for Native LdapHelper
    • Constructor Summary

      Constructors 
      Constructor Description
      AttributeUtil()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LdapModifyResult addAttributeValue​(java.lang.String dn, java.lang.String attributeName, java.lang.Object value)
      This interface gives the user ability to add the attribute from the LDAP
      LdapContextCreateResult createSubContext​(java.lang.String dn, javax.naming.directory.Attributes attrs)
      This method is to give the user ability to create the sub context
      LdapAttributeGetResult getAttributeValue​(java.lang.String dn, java.lang.String[] attributeNames)
      This interface gives the user ability to get the attribute from LDAP
      void init​(LdapServerConnection ldapConn, java.lang.String serverConnName, java.lang.String baseDN)
      This method is to initiate with the server connection name and baseDN
      void init​(java.lang.String ldapConn, java.lang.String baseDN)
      This method is to initiate with server connection name and baseDN
      void initWithParameters​(java.lang.String serverConnName, java.lang.String connectionTimeout, java.lang.String idleTimeout, java.lang.String poolSize, java.lang.String hostname, boolean isSsl, int port, java.lang.String bindDN, java.lang.String bindDnPWD, java.lang.String keystoreStr, java.lang.String labelStr, java.lang.String baseDN)
      This method is to initiate with the detailed LDAP connection parameters
      AttributeUtil.AttributeGetResult ldapAttributeGetResultToAttributeGetResult​(java.lang.String attributeName, LdapAttributeGetResult lagr)
      Transform the attribute GET result
      LdapModifyResult removeAttribute​(java.lang.String dn, java.lang.String attributeName, java.lang.String attributeValue)
      This interface gives the user ability to update the attribute from LDAP
      LdapSearchResult search​(java.lang.String dn, java.lang.String filter)
      This method gives the user ability to search LDAP for the given filter in the specific dn
      LdapModifyResult setAttributeValue​(java.lang.String dn, java.lang.String attributeName, java.lang.Object value)
      This interface will give the user ability to update the attribute from the LDAP
      • Methods inherited from class java.lang.Object

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

      • AttributeUtil

        public AttributeUtil()
    • Method Detail

      • removeAttribute

        public LdapModifyResult removeAttribute​(java.lang.String dn,
                                                java.lang.String attributeName,
                                                java.lang.String attributeValue)
        This interface gives the user ability to update the attribute from LDAP
        Parameters:
        dn - , the distinguished name which operations against
        attributeName - , the attribute name to remove
        attributeValue - , the attribute value to remove
        Returns:
        LdapModifyResult, the result of ldap operations
      • ldapAttributeGetResultToAttributeGetResult

        public AttributeUtil.AttributeGetResult ldapAttributeGetResultToAttributeGetResult​(java.lang.String attributeName,
                                                                                           LdapAttributeGetResult lagr)
        Transform the attribute GET result
        Parameters:
        attributeName - , the attribute name
        Attributes - get result before transform
        Returns:
        Attributes get result before transform
      • getAttributeValue

        public LdapAttributeGetResult getAttributeValue​(java.lang.String dn,
                                                        java.lang.String[] attributeNames)
        This interface gives the user ability to get the attribute from LDAP
        Parameters:
        dn - , the distinguished name which operations against
        attributeNames - , the attribute name to retreive , if null, retrieve all the attributes
        Returns:
        LdapAttributeGetResult,the result for retrieved attributes
      • setAttributeValue

        public LdapModifyResult setAttributeValue​(java.lang.String dn,
                                                  java.lang.String attributeName,
                                                  java.lang.Object value)
        This interface will give the user ability to update the attribute from the LDAP
        Parameters:
        dn - , the distinguished name which operations against
        attributeName - , the attribute name to modify
        value - , the attribute value to modify
        Returns:
        LdapModifyResult, the result of modification for the attribute
      • addAttributeValue

        public LdapModifyResult addAttributeValue​(java.lang.String dn,
                                                  java.lang.String attributeName,
                                                  java.lang.Object value)
        This interface gives the user ability to add the attribute from the LDAP
        Parameters:
        dn - , the distinguished name which operations against
        attributeName - , the attribute name to add
        value - , the attribute value to add
        Returns:
        LdapModifyResult, the result of add for the attribute
      • init

        public void init​(java.lang.String ldapConn,
                         java.lang.String baseDN)
        This method is to initiate with server connection name and baseDN
        Parameters:
        ldapConn - , the connection from lmi server connections
        baseDN - , the base distinguished name
      • init

        public void init​(LdapServerConnection ldapConn,
                         java.lang.String serverConnName,
                         java.lang.String baseDN)
        This method is to initiate with the server connection name and baseDN
        Parameters:
        ldapConn - , the LdapServerConnection connection object
        serverConnName - , customer given unique server connection name
        baseDN - , the base distinguished name
      • initWithParameters

        public void initWithParameters​(java.lang.String serverConnName,
                                       java.lang.String connectionTimeout,
                                       java.lang.String idleTimeout,
                                       java.lang.String poolSize,
                                       java.lang.String hostname,
                                       boolean isSsl,
                                       int port,
                                       java.lang.String bindDN,
                                       java.lang.String bindDnPWD,
                                       java.lang.String keystoreStr,
                                       java.lang.String labelStr,
                                       java.lang.String baseDN)
        This method is to initiate with the detailed LDAP connection parameters
        Parameters:
        serverConnName - , the unique server connection name
        connectionTimeout - , the connection time out value
        idleTimeout - , the idle connect time out value
        poolSize - , the pool size
        hostname - , the host name
        isSsl - , boolean value whether this use ssl
        port - , the port number
        bindDN - , the userid / bindDN
        bindDnPWD - , the password
        keystoreStr - , the SSL keystore file location
        labelStr - , the ssl client certificate label
        baseDN - , the base distinguished name
      • search

        public LdapSearchResult search​(java.lang.String dn,
                                       java.lang.String filter)
        This method gives the user ability to search LDAP for the given filter in the specific dn
        Parameters:
        dn - , the distinguished name which operations against
        filter - , the search filter
        Returns:
        the search result for the name research
      • createSubContext

        public LdapContextCreateResult createSubContext​(java.lang.String dn,
                                                        javax.naming.directory.Attributes attrs)
        This method is to give the user ability to create the sub context
        Parameters:
        dn - the distinguished name which operations against
        attrs - , the attributes which is created in the new sub context
        Returns:
        LdapContextCreateResult, return the result for sub context creation