public class LDAPDataUtil extends Object
Constructor and Description |
---|
LDAPDataUtil() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
getAttributeList(com.unboundid.ldap.sdk.LDAPConnection connection,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
com.unboundid.ldap.sdk.Filter filter,
String attribute)
Returns a list of values of the passed attribute.
|
static List<String> |
getDNResultList(com.unboundid.ldap.sdk.SearchResult res) |
static byte[] |
getObjectID(Map<String,Object> attributes) |
static byte[] |
getObjectID(com.unboundid.ldap.sdk.SearchResultEntry entry) |
static String |
getObjectIDAsString(com.unboundid.ldap.sdk.SearchResultEntry entry) |
static byte[] |
getObjectIDAttribute(Map<String,Object> attributes) |
static com.unboundid.ldap.sdk.Attribute |
getObjectIDAttribute(com.unboundid.ldap.sdk.SearchResultEntry entry) |
static int |
getTotalCount(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
com.unboundid.ldap.sdk.Filter filter,
String... attributes) |
static int |
getTotalCount(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
String filter,
String... attributes) |
static com.unboundid.ldap.sdk.Attribute |
getUserLoginAttribute(com.unboundid.ldap.sdk.SearchResultEntry entry) |
static List<com.unboundid.ldap.sdk.SearchResult> |
searchEntries(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
com.unboundid.ldap.sdk.Filter filter,
String... attributes)
Performs a query to an active directory and returns all results.
|
static List<com.unboundid.ldap.sdk.SearchResult> |
searchEntries(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
String filter,
String... attributes)
Performs a query to an active directory and returns all results.
|
static com.alibaba.fastjson.JSONArray |
searchJSON(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
com.unboundid.ldap.sdk.Filter filter,
String... attributes) |
static com.alibaba.fastjson.JSONArray |
searchJSON(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
String filter,
String... attributes) |
static List<LDAPBenutzer> |
searchLDAPBenutzer(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
com.unboundid.ldap.sdk.Filter filter,
String... attributes) |
static List<LDAPBenutzer> |
searchLDAPBenutzer(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
Integer pageSize,
String filter,
String... attributes) |
static List<String> |
searchLDAPGroups(LDAPGruppe gruppe,
MandantLdapData data) |
static com.alibaba.fastjson.JSONObject |
searchSingelJSON(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
com.unboundid.ldap.sdk.Filter filter,
String... attributes)
Performs a query to an active directory and returns the first result, converted to a JSON object.
|
static com.alibaba.fastjson.JSONObject |
searchSingelJSON(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
String filter,
String... attributes)
Performs a query to an active directory and returns the first result, converted to a JSON object.
|
static com.unboundid.ldap.sdk.SearchResultEntry |
searchSingleEntry(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
com.unboundid.ldap.sdk.Filter filter,
String... attributes)
Performs a query to an active directory and returns the first result.
|
static com.unboundid.ldap.sdk.SearchResultEntry |
searchSingleEntry(com.unboundid.ldap.sdk.LDAPConnection con,
String baseDN,
com.unboundid.ldap.sdk.SearchScope scope,
String filter,
String... attributes)
Performs a query to an active directory and returns the first result.
|
public static com.alibaba.fastjson.JSONArray searchJSON(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, String filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException, com.alibaba.fastjson.JSONException
com.unboundid.ldap.sdk.LDAPException
com.alibaba.fastjson.JSONException
public static com.alibaba.fastjson.JSONArray searchJSON(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, com.unboundid.ldap.sdk.Filter filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException, com.alibaba.fastjson.JSONException
com.unboundid.ldap.sdk.LDAPException
com.alibaba.fastjson.JSONException
public static List<com.unboundid.ldap.sdk.SearchResult> searchEntries(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, String filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
con
- Connection to the active directory.baseDN
- Base DN where to start the search.scope
- The scope for the search.filter
- A filter for limiting the search results.pageSize
- If null or less than or equal to 0
, no paging is applied and the returned list will contain
exactly one entry. Otherwise, results are retrieved in batches of the given page size, and the returned list will
contain {ceil(totalNumberOfResults/pageSize} entries.attributes
- An optional list of attributes that should be returned. If none are given, all attributes are
returned.null
when no result could be found.com.unboundid.ldap.sdk.LDAPException
- When the query could not be made, such as when the filter is invalid etc.com.alibaba.fastjson.JSONException
- When the result could not be converted to a JSON object.public static List<com.unboundid.ldap.sdk.SearchResult> searchEntries(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, com.unboundid.ldap.sdk.Filter filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
con
- Connection to the active directory.baseDN
- Base DN where to start the search.scope
- The scope for the search.filter
- A filter for limiting the search results.pageSize
- If null or less than or equal to 0
, no paging is applied and the returned list will contain
exactly one entry. Otherwise, results are retrieved in batches of the given page size, and the returned list will
contain {ceil(totalNumberOfResults/pageSize} entries.attributes
- An optional list of attributes that should be returned. If none are given, all attributes are
returned.null
when no result could be found.com.unboundid.ldap.sdk.LDAPException
- When the query could not be made, such as when the filter is invalid etc.com.alibaba.fastjson.JSONException
- When the result could not be converted to a JSON object.public static com.alibaba.fastjson.JSONObject searchSingelJSON(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, String filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException, com.alibaba.fastjson.JSONException
con
- Connection to the active directory.baseDN
- Base DN where to start the search.scope
- The scope for the search.filter
- A filter for limiting the search results.attributes
- An optional list of attributes that should be returned. If none are given, all attributes are
returned.null
when no result could be found.com.unboundid.ldap.sdk.LDAPException
- When the query could not be made, such as when the filter is invalid etc.com.alibaba.fastjson.JSONException
- When the result could not be converted to a JSON object.public static com.alibaba.fastjson.JSONObject searchSingelJSON(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, com.unboundid.ldap.sdk.Filter filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException, com.alibaba.fastjson.JSONException
con
- Connection to the active directory.baseDN
- Base DN where to start the search.scope
- The scope for the search.filter
- A filter for limiting the search results.attributes
- An optional list of attributes that should be returned. If none are given, all attributes are
returned.null
when no result could be found.com.unboundid.ldap.sdk.LDAPException
- When the query could not be made, such as when the filter is invalid etc.com.alibaba.fastjson.JSONException
- When the result could not be converted to a JSON object.public static com.unboundid.ldap.sdk.SearchResultEntry searchSingleEntry(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, String filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
con
- Connection to the active directory.baseDN
- Base DN where to start the search.scope
- The scope for the search.filter
- A filter for limiting the search results.attributes
- An optional list of attributes that should be returned. If none are given, all attributes are
returned.null
when no result could be found.com.unboundid.ldap.sdk.LDAPException
- When the query could not be made, such as when the filter is invalid etc.public static com.unboundid.ldap.sdk.SearchResultEntry searchSingleEntry(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, com.unboundid.ldap.sdk.Filter filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
con
- Connection to the active directory.baseDN
- Base DN where to start the search.scope
- The scope for the search.filter
- A filter for limiting the search results.attributes
- An optional list of attributes that should be returned. If none are given, all attributes are
returned.null
when no result could be found.com.unboundid.ldap.sdk.LDAPException
- When the query could not be made, such as when the filter is invalid etc.public static List<LDAPBenutzer> searchLDAPBenutzer(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, String filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
com.unboundid.ldap.sdk.LDAPException
public static List<LDAPBenutzer> searchLDAPBenutzer(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, com.unboundid.ldap.sdk.Filter filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
com.unboundid.ldap.sdk.LDAPException
public static List<String> getAttributeList(com.unboundid.ldap.sdk.LDAPConnection connection, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, com.unboundid.ldap.sdk.Filter filter, String attribute) throws com.unboundid.ldap.sdk.LDAPException
connection
- the current LDAPConnection
baseDN
- The base DN for the search request. It must not be null
.scope
- The scope that specifies the range of entries that should be examined for the search.pageSize
- Size of a pagefilter
- The string representation of the filter to use to identify matching entries. It must not be
null
.attribute
- The LDAP attribute to retrievecom.unboundid.ldap.sdk.LDAPException
- If the provided filter string cannot be parsed as an LDAP filter.public static List<String> searchLDAPGroups(LDAPGruppe gruppe, MandantLdapData data) throws com.unboundid.ldap.sdk.LDAPException, GeneralSecurityException
com.unboundid.ldap.sdk.LDAPException
GeneralSecurityException
public static com.unboundid.ldap.sdk.Attribute getUserLoginAttribute(com.unboundid.ldap.sdk.SearchResultEntry entry)
public static int getTotalCount(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, String filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
com.unboundid.ldap.sdk.LDAPException
public static int getTotalCount(com.unboundid.ldap.sdk.LDAPConnection con, String baseDN, com.unboundid.ldap.sdk.SearchScope scope, Integer pageSize, com.unboundid.ldap.sdk.Filter filter, String... attributes) throws com.unboundid.ldap.sdk.LDAPException
com.unboundid.ldap.sdk.LDAPException
public static String getObjectIDAsString(com.unboundid.ldap.sdk.SearchResultEntry entry)
public static com.unboundid.ldap.sdk.Attribute getObjectIDAttribute(com.unboundid.ldap.sdk.SearchResultEntry entry)
public static byte[] getObjectIDAttribute(Map<String,Object> attributes) throws ParseException
ParseException
public static byte[] getObjectID(com.unboundid.ldap.sdk.SearchResultEntry entry)
Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.