Class AttributeUtil

java.lang.Object
com.ibm.security.access.ldap.utils.AttributeUtil

public class AttributeUtil extends Object
Static utility methods for Native LdapHelper
  • Constructor Details

    • AttributeUtil

      public AttributeUtil()
  • Method Details

    • removeAttribute

      public LdapModifyResult removeAttribute(String dn, String attributeName, 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(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(String dn, 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(String dn, String attributeName, 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(String dn, String attributeName, 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(String ldapConn, 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, String serverConnName, 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(String serverConnName, String connectionTimeout, String idleTimeout, String poolSize, String hostname, boolean isSsl, int port, String bindDN, String bindDnPWD, String keystoreStr, String labelStr, 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(String dn, 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
    • search

      public LdapSearchResult search(String dn, String filter, SearchControls sc)
      This method gives the user ability to search LDAP for the given filter in the specific dn with specific control. If a search() method was invoked with a specified size limit of 'n'and the result consists of more than 'n' results, search() would first return a NamingEnumeration. When the n'th result has been returned by invoking next() on the NamingEnumeration, a SizeLimitExceedException would then thrown when hasMore() is invoked.
      Parameters:
      dn - , the distinguished name which operations against
      filter - , the search filter
      searchcontrols - , the search controls
      Returns:
      the search result for the name research
    • createSubContext

      public LdapContextCreateResult createSubContext(String dn, 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
    • close

      public void close()
      This method is to give the user ability to close the connection. Added for APAR IJ36891