public class JSONResultFormatter extends Object
See the related LDIFResultFormatter
class for LDIF result
formatting.
Modifier and Type | Method | Description |
---|---|---|
static Map<String,Object> |
formatAttributeType(com.unboundid.ldap.sdk.schema.AttributeTypeDefinition def) |
Formats an attribute type defintion.
|
static Map<String,Object> |
formatEntry(com.unboundid.ldap.sdk.Entry entry,
Set<String> binary,
boolean normalize) |
Formats an LDAP directory entry as a JSON object.
|
static Map<String,Object> |
formatEntry(com.unboundid.ldap.sdk.Entry entry,
Set<String> binary,
boolean omitDN,
boolean normalize) |
Formats an LDAP directory entry as a JSON object.
|
static Map<String,Object> |
formatMatchingRule(com.unboundid.ldap.sdk.schema.MatchingRuleDefinition def) |
Formats a matching rule defintion.
|
static Map<String,Object> |
formatMatchingRuleUse(com.unboundid.ldap.sdk.schema.MatchingRuleUseDefinition def) |
Formats a matching rule use defintion.
|
static Map<String,Object> |
formatObjectClass(com.unboundid.ldap.sdk.schema.ObjectClassDefinition def) |
Formats an object class defintion.
|
static Map<String,Object> |
formatSearchResult(com.unboundid.ldap.sdk.SearchResult sr,
Set<String> binary,
boolean normalize) |
Formats a LDAP search result as a JSON object containing matches
and referrals.
|
static Map<String,Object> |
formatSyntax(com.unboundid.ldap.sdk.schema.AttributeSyntaxDefinition def) |
Formats an attribute syntax defintion.
|
public static Map<String,Object> formatEntry(com.unboundid.ldap.sdk.Entry entry, Set<String> binary, boolean omitDN, boolean normalize)
Format:
{ "DN" : "uid=user001,ou=people,dc=example,dc=com", "attribute-name-1" : [value-1, value-2, value-3, ...], "attribute-name-2" : [value-1, value-2, ...], "attribute-name-3" : [value-1, ...], ... }
entry
- The directory entry. Must not be null
.binary
- The name of the attributes to Base64 encode. Must
not be null
.omitDN
- If true
the DN will be omitted from the
returned map.normalize
- If true
attribute names will be converted
to lower case.public static Map<String,Object> formatEntry(com.unboundid.ldap.sdk.Entry entry, Set<String> binary, boolean normalize)
Format:
{ "DN" : "uid=user001,ou=people,dc=example,dc=com", "attribute-name-1" : [value-1, value-2, value-3, ...], "attribute-name-2" : [value-1, value-2, ...], "attribute-name-3" : [value-1, ...], ... }
entry
- The directory entry. Must not be null
.binary
- The name of the attributes to Base64 encode. Must
not be null
.normalize
- If true
attribute names will be converted
to lower case.public static Map<String,Object> formatSearchResult(com.unboundid.ldap.sdk.SearchResult sr, Set<String> binary, boolean normalize)
Format:
{ "matches" : [ { entry-1 }, { entry-2 }, { entry-3 }, ...], "referrals" : [ "url-1", "url-2", "url-3", ...], "page" : { "totalEntryCount" : n, "more" : true|false, "cookie" : "..." }, "vlv" : { "totalEntryCount" : n, "offset" : n, "cookie" : "..." } }where
entry-n
are formatted by the formatEntry(com.unboundid.ldap.sdk.Entry, java.util.Set<java.lang.String>, boolean, boolean)
method.sr
- The search result. Must not be null
.binary
- The name of the attributes to Base64 encode. Must
not be null
.normalize
- If true
attribute names will be converted
to lower case.public static Map<String,Object> formatObjectClass(com.unboundid.ldap.sdk.schema.ObjectClassDefinition def)
def
- The object class definition. Must not be null
.public static Map<String,Object> formatAttributeType(com.unboundid.ldap.sdk.schema.AttributeTypeDefinition def)
def
- The attribute type definition. Must not be null
.public static Map<String,Object> formatMatchingRule(com.unboundid.ldap.sdk.schema.MatchingRuleDefinition def)
def
- The matching rule definition. Must not be null
.public static Map<String,Object> formatMatchingRuleUse(com.unboundid.ldap.sdk.schema.MatchingRuleUseDefinition def)
def
- The matching rule use definition. Must not be
null
.public static Map<String,Object> formatSyntax(com.unboundid.ldap.sdk.schema.AttributeSyntaxDefinition def)
def
- The attribute syntax definition. Must not be
null
.Copyright © 2018 Connect2id. All rights reserved.