Package com.nimbusds.common.ldap
Class AttributesForRetrieval
- java.lang.Object
-
- com.nimbusds.common.ldap.AttributesForRetrieval
-
public class AttributesForRetrieval extends Object
Specifies a set of directory attributes for retrieval. They are grouped into two subsets:- Attributes treated as text and encoded as UTF-8.
- Attributes treated as binary and encoded in Base64.
-
-
Constructor Summary
Constructors Constructor Description AttributesForRetrieval()
Creates a default specification of attributes for retrieval which is retrieve all user attributes as UTF-8 text.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getBinaryAttributes()
Gets the names of the attributes to retrieve as binary (Base64 encoded).String[]
getSpec()
Retrieves the specification of the attributes (UTF-8 text and binary) for retrieval for an LDAP get entry/search request.void
parse(com.thetransactioncompany.jsonrpc2.util.NamedParamsRetriever params)
Parses an "attributes" and a "binaryAttributes" specification from the given named JSON-RPC parameters.static String[]
parseValues(String paramName, com.thetransactioncompany.jsonrpc2.util.NamedParamsRetriever params)
Parses a JSON-RPC 2.0 parameter representing a set of string values.
-
-
-
Constructor Detail
-
AttributesForRetrieval
public AttributesForRetrieval()
Creates a default specification of attributes for retrieval which is retrieve all user attributes as UTF-8 text.
-
-
Method Detail
-
getBinaryAttributes
public Set<String> getBinaryAttributes()
Gets the names of the attributes to retrieve as binary (Base64 encoded).- Returns:
- The names (normalised to lower case) of the attributes to retrieve as binary, empty set if none.
-
getSpec
public String[] getSpec()
Retrieves the specification of the attributes (UTF-8 text and binary) for retrieval for an LDAP get entry/search request.- Returns:
- The attributes for retrieval,
null
for all.
-
parseValues
public static String[] parseValues(String paramName, com.thetransactioncompany.jsonrpc2.util.NamedParamsRetriever params) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
Parses a JSON-RPC 2.0 parameter representing a set of string values. This can be a space/comma delimited JSON string, a JSON array of strings or undefined to signify no specific parameters.- Parameters:
paramName
- The parameter name. Must not benull
.params
- The named parameters to parse. Must not benull
.- Returns:
- The values, empty array if none/undefined.
- Throws:
com.thetransactioncompany.jsonrpc2.JSONRPC2Error
- If parsing failed (INVALID_PARAMS).
-
parse
public void parse(com.thetransactioncompany.jsonrpc2.util.NamedParamsRetriever params) throws com.thetransactioncompany.jsonrpc2.JSONRPC2Error
Parses an "attributes" and a "binaryAttributes" specification from the given named JSON-RPC parameters.- Parameters:
params
- The named parameters to parse. Must not benull
.- Throws:
com.thetransactioncompany.jsonrpc2.JSONRPC2Error
- If parsing failed (INVALID_PARAMS).
-
-