Package com.isode.dsapi.internal
Class DsapiUtils
java.lang.Object
com.isode.dsapi.internal.DsapiUtils
A utility class for DSAPI related functionality
- Since:
- 15.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
entryContainsAttributeValue
(IsodeDirectorySession dirSession, DN entryDN, AttributeType attrType, String value) Determine if the entry contains the given attribute value of given attribute type.static boolean
entryContainsObjectClass
(IsodeDirectorySession dirSession, DN entryDN, String... objectClasses) Determine if the entry contains the given object classesstatic Set<AttributeType>
getAttributeTypeSetFromArray
(AttributeType... values) Creates a set ofAttributeType
from an array orAttributeType
static CommonArgs
Return a CommonArgs that contains default values for all flags with the exception ofCommonArgs.setDisableVerification(boolean)
which will be set to true.static String
getFirstRDNValue
(String dnStr) Get the RDN value.static boolean
Determine if DSA is reachable or notstatic boolean
isDSAReachable
(String bpaString) Determine if DSA is reachable or not
-
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 nullentryDN
- DN of the entry, should not be nullobjectClasses
- 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 nullentryDN
- DN of the entry, should not be nullattrType
- the attribute type, should not be nullvalue
- 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
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
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
Return a CommonArgs that contains default values for all flags with the exception ofCommonArgs.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
Creates a set ofAttributeType
from an array orAttributeType
- Parameters:
values
- An array ofAttributeType
to convert to aSet
, should not benull
- Returns:
- The
Set
ofAttributeType
containing all values that were in the array. Will not benull
- Since:
- 17.0
-
getFirstRDNValue
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
-