public class LDIFResultFormatter extends Object
See the related JSONResultFormatter
class for JSON result
formatting.
Modifier and Type | Method and Description |
---|---|
static String |
formatEntry(com.unboundid.ldap.sdk.Entry entry)
Formats an LDAP directory entry as an LDIF string.
|
static Map<String,Object> |
formatSearchResult(com.unboundid.ldap.sdk.SearchResult sr)
Formats an LDAP search result as a JSON object where the matches are
presented as an LDIF string.
|
public static String formatEntry(com.unboundid.ldap.sdk.Entry entry)
Format:
dn: entry-DN attribute-name-1: value-1 attribute-name-1: value-2 attribute-name-1: value-n ... attribute-name-2: value-1 ...
entry
- The directory entry.public static Map<String,Object> formatSearchResult(com.unboundid.ldap.sdk.SearchResult sr)
Format:
{ "matches" : "dn: result-entry-DN-1\n attribute-name-1: value-1\n attribute-name-1: value-2\n attribute-name-1: value-n\n ...\n attribute-name-2: value-1\n ...\n \n dn: result-entry-DN-2\n ...\n \n dn: result-entry-DN-3\n ...\n", "referrals" : ["url-1", "url-2", "url-3", ...], "page" : { "totalEntryCount" : n, "more" : true|false, "cookie" : "..." }, "vlv" : { "totalEntryCount" : n, "offset" : n, "cookie" : "..." } }
sr
- The search result.Copyright © 2015 Connect2id. All Rights Reserved.