Class UtilsLDAP


  • public final class UtilsLDAP
    extends java.lang.Object

    Utilities class relating to connections and LDAP protocol.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.3, 19/09/2022.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String extractFirstComponentFromURIldap​(java.lang.String uriLdapString)
      Gets the first component value from a URI LDAP.
      static java.security.cert.X509CRL getCRLfromLDAP​(java.lang.String urlServer, java.lang.String user, java.lang.String password, java.lang.String pathLDAP, java.lang.String searchFilter, java.lang.String[] attributes, int connectionTimeout, int readTimeout, boolean directLDAP)
      Method that obtains the CRL from the LDAP.
      static boolean isUriOfSchemeLDAP​(java.lang.String uriString)
      This method determines whether a given URI scheme is LDAP.
      static boolean isUriOfSchemeLDAP​(java.net.URI uri)
      This method determines whether a given URI scheme is LDAP.
      • Methods inherited from class java.lang.Object

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

      • getCRLfromLDAP

        public static java.security.cert.X509CRL getCRLfromLDAP​(java.lang.String urlServer,
                                                                java.lang.String user,
                                                                java.lang.String password,
                                                                java.lang.String pathLDAP,
                                                                java.lang.String searchFilter,
                                                                java.lang.String[] attributes,
                                                                int connectionTimeout,
                                                                int readTimeout,
                                                                boolean directLDAP)
                                                         throws CommonUtilsException
        Method that obtains the CRL from the LDAP.
        Parameters:
        urlServer - Parameter that represents the URL of the LDAP server (with the port, in another case the port is 389).
        user - Parameter that represents the user for the authentication.
        password - Parameter that represents the password for the authentication.
        pathLDAP - Parameter that represents the path to follow in the LDAP server.
        searchFilter - Parameter that represents the filter to use in the LDAP server.
        attributes - Parameter that represents the list of attributes for including in the search.
        connectionTimeout - Parameter that represents the number of milliseconds for the connection timeout.
        readTimeout - Parameter that represents the number of milliseconds for the reading timeout.
        directLDAP - Parameter that indicates whether the connection by LDAP is direct (true) or segmented (false).
        Returns:
        a X509CRL object that represents the CRL.
        Throws:
        CommonUtilsException - In case of some error working with the LDAP connection o getting the CRL from this.
      • isUriOfSchemeLDAP

        public static boolean isUriOfSchemeLDAP​(java.lang.String uriString)
        This method determines whether a given URI scheme is LDAP.
        Parameters:
        uriString - String representation of the URI to analyze.
        Returns:
        true if the scheme of the URI is LDAP, otherwise false.
      • isUriOfSchemeLDAP

        public static boolean isUriOfSchemeLDAP​(java.net.URI uri)
        This method determines whether a given URI scheme is LDAP.
        Parameters:
        uri - Representation of the URI to analyze.
        Returns:
        true if the scheme of the URI is LDAP, otherwise false.
      • extractFirstComponentFromURIldap

        public static java.lang.String extractFirstComponentFromURIldap​(java.lang.String uriLdapString)
        Gets the first component value from a URI LDAP.
        Parameters:
        uriLdapString - URI LDAP.
        Returns:
        the first component value from a URI LDAP, or null if was not possible to extract.