Package org.forgerock.opendj.rest2ldap
Class JsonPropertyMapper
java.lang.Object
org.forgerock.opendj.rest2ldap.PropertyMapper
org.forgerock.opendj.rest2ldap.JsonPropertyMapper
A property mapper which provides a mapping from a JSON value to an LDAP attribute having the JSON syntax.
-
Method Summary
Modifier and TypeMethodDescriptiondefaultJsonValue
(Object defaultValue) Sets the default JSON value which should be substituted when the LDAP attribute is not found in the LDAP entry.defaultJsonValues
(Collection<?> defaultValues) Sets the default JSON values which should be substituted when the LDAP attribute is not found in the LDAP entry.extensibleJsonOrderingMatchingRule
(String extensibleJsonOrderingMatchingRule) Sets the JSON ordering matching rule name that should be used for comparing JSON attributes in LDAP.final JsonPropertyMapper
isMultiValued
(boolean isMultiValued) Indicates that the LDAP attribute is multi-valued and should be represented in JSON using an array of values.final JsonPropertyMapper
isRequired
(boolean isRequired) Indicates that the LDAP attribute is mandatory and must be provided during create requests.jsonQueryEqualityMatchingRule
(String jsonQueryEqualityMatchingRule) Sets the JSON query matching rule name that should be used for matching JSON attributes in LDAP.jsonSchema
(JsonValue jsonSchema) Sets the JSON schema corresponding to this simple property mapper.static void
putWritabilityProperties
(WritabilityPolicy writabilityPolicy, JsonValue jsonSchema) toString()
useServerSideSort
(boolean useServerSideSort) Specifies whether a sort directive involving this property mapper should be forwarded to the LDAP server or if it should be performed locally by this Rest2Ldap server.final JsonPropertyMapper
writability
(WritabilityPolicy policy) Indicates whether the LDAP attribute supports updates.
-
Method Details
-
jsonQueryEqualityMatchingRule
Sets the JSON query matching rule name that should be used for matching JSON attributes in LDAP. The matching rule must be built usingJsonSchema.newJsonQueryEqualityMatchingRuleImpl(String, Options)
.By default JSON attributes will be matched using the
JsonSchema.getCaseIgnoreJsonQueryMatchingRule()
.- Parameters:
jsonQueryEqualityMatchingRule
- The name or OID of the JSON query matching rule.- Returns:
- This property mapper.
-
extensibleJsonOrderingMatchingRule
public JsonPropertyMapper extensibleJsonOrderingMatchingRule(String extensibleJsonOrderingMatchingRule) Sets the JSON ordering matching rule name that should be used for comparing JSON attributes in LDAP. The matching rule must be built usingJsonSchema.newJsonQueryEqualityMatchingRuleImpl(String, Options)
.By default JSON attributes will be matched using the
JsonSchema.getCaseIgnoreJsonQueryMatchingRule()
.- Parameters:
extensibleJsonOrderingMatchingRule
- The name or OID of the extensible JSON ordering matching rule.- Returns:
- This property mapper.
-
useServerSideSort
Specifies whether a sort directive involving this property mapper should be forwarded to the LDAP server or if it should be performed locally by this Rest2Ldap server.You want to set this setting to
false
if the LDAP server does not support the extensible matching rule concept.- Parameters:
useServerSideSort
-true
if the sort directive should be forwarded to the LDAP server,false
if the sort operation must be performed locally.- Returns:
- This property mapper.
- See Also:
-
extensibleJsonOrderingMatchingRule
-
defaultJsonValue
Sets the default JSON value which should be substituted when the LDAP attribute is not found in the LDAP entry.- Parameters:
defaultValue
- The default JSON value.- Returns:
- This property mapper.
-
defaultJsonValues
Sets the default JSON values which should be substituted when the LDAP attribute is not found in the LDAP entry.- Parameters:
defaultValues
- The default JSON values.- Returns:
- This property mapper.
-
jsonSchema
Sets the JSON schema corresponding to this simple property mapper. If notnull
, it will be returned bytoJsonSchema()
, otherwise a default JSON schema will be automatically generated with the information available in this property mapper.- Parameters:
jsonSchema
- the JSON schema corresponding to this simple property mapper. Can benull
- Returns:
- This property mapper.
-
toString
-
isRequired
Indicates that the LDAP attribute is mandatory and must be provided during create requests.- Parameters:
isRequired
-true
if this property is required.- Returns:
- This property mapper.
-
isMultiValued
Indicates that the LDAP attribute is multi-valued and should be represented in JSON using an array of values.- Parameters:
isMultiValued
-true
if this property is multi-valued.- Returns:
- This property mapper.
-
writability
Indicates whether the LDAP attribute supports updates. The default isWritabilityPolicy.READ_WRITE
.- Parameters:
policy
- The writability policy.- Returns:
- This property mapper.
-
putWritabilityProperties
public static void putWritabilityProperties(WritabilityPolicy writabilityPolicy, JsonValue jsonSchema)
-