Class DsapiUtils

java.lang.Object
com.isode.dsapi.internal.DsapiUtils

public class DsapiUtils extends Object
A utility class for DSAPI related functionality
Since:
15.1
  • Constructor Details

    • DsapiUtils

      public DsapiUtils()
  • Method Details

    • entryContainsObjectClass

      public static boolean entryContainsObjectClass(IsodeDirectorySession dirSession, DN entryDN, String... objectClasses)
      Determine if the entry contains the given object classes
      Parameters:
      dirSession - directory session, should not be null
      entryDN - DN of the entry, should not be null
      objectClasses - the object classes to be checked, should not be null
      Returns:
      true if the object classes are found in the entry and false otherwise
      Since:
      15.1
    • entryContainsAttributeValue

      public static boolean entryContainsAttributeValue(IsodeDirectorySession dirSession, DN entryDN, AttributeType attrType, String value)
      Determine if the entry contains the given attribute value of given attribute type. This function does not do a case-sensitive search.
      Parameters:
      dirSession - directory session, should not be null
      entryDN - DN of the entry, should not be null
      attrType - the attribute type, should not be null
      value - value to be checked, should not be null
      Returns:
      true if the value is found in the entry's attribute type and false otherwise
      Since:
      15.2
    • isDSAReachable

      public static boolean isDSAReachable(BindProfileAddress bpa)
      Determine if DSA is reachable or not
      Parameters:
      bpa - bind profile address, not null
      Returns:
      true if DSA is reachable, false otherwise
      Since:
      16.4
    • isDSAReachable

      public static boolean isDSAReachable(String bpaString)
      Determine if DSA is reachable or not
      Parameters:
      bpaString - bind profile address, not null
      Returns:
      true if DSA is reachable, false otherwise
      Since:
      16.4
    • getCommonArgsWithoutVerify

      public static CommonArgs getCommonArgsWithoutVerify()
      Return a CommonArgs that contains default values for all flags with the exception of CommonArgs.setDisableVerification(boolean) which will be set to true. This is useful for UIs that want to make an anonymous connection to a DSA without risking the bind failing due to certificate verification issues
      Returns:
      common arguments without verification
      Since:
      16.4
    • getAttributeTypeSetFromArray

      public static Set<AttributeType> getAttributeTypeSetFromArray(AttributeType... values)
      Creates a set of AttributeType from an array or AttributeType
      Parameters:
      values - An array of AttributeType to convert to a Set, should not be null
      Returns:
      The Set of AttributeType containing all values that were in the array. Will not be null
      Since:
      17.0
    • getFirstRDNValue

      public static String getFirstRDNValue(String dnStr) throws DSAPIException
      Get the RDN value. It will return the first value from the first RDN.
      Parameters:
      dnStr - input DN string, not null
      Returns:
      string, not null
      Throws:
      DSAPIException - if the input string is invalid