Package org.forgerock.opendj.ldap
Class DecodeOptions
- java.lang.Object
-
- org.forgerock.opendj.ldap.DecodeOptions
-
public final class DecodeOptions extends Object
Decode options allow applications to control how requests and responses are decoded. In particular:- The strategy for selecting which
Schema
should be used for decoding distinguished names, attribute descriptions, and other objects which require a schema in order to be decoded. - The
Attribute
implementation which should be used when decoding attributes. - The
Entry
implementation which should be used when decoding entries or entry like objects.
- The strategy for selecting which
-
-
Constructor Summary
Constructors Constructor Description DecodeOptions()
Creates a new set of decode options which will always use the default schema returned bySchema.getDefaultSchema()
,LinkedAttribute
, andLinkedHashMapEntry
.DecodeOptions(DecodeOptions options)
Creates a new set of decode options having the same initial set of options as the provided set of decode options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<AttributeDescription,Attribute>
getAttributeFactory()
Returns the function which will be used for creating newAttribute
instances when decoding attributes.Function<Dn,Entry>
getEntryFactory()
Returns the function which will be used for creating newEntry
instances when decoding entries.SchemaResolver
getSchemaResolver()
Returns the strategy for selecting whichSchema
should be used for decoding distinguished names, attribute descriptions, and other objects which require aSchema
in order to be decoded.DecodeOptions
setAttributeFactory(Function<AttributeDescription,Attribute> factory)
Sets the function which will be used for creating newAttribute
instances when decoding attributes.DecodeOptions
setEntryFactory(Function<Dn,Entry> factory)
Sets the function which will be used for creating newEntry
instances when decoding entries.DecodeOptions
setSchema(Schema schema)
Sets theSchema
which will be used for decoding distinguished names, attribute descriptions, and other objects which require a schema in order to be decoded.DecodeOptions
setSchemaResolver(SchemaResolver resolver)
Sets the strategy for selecting whichSchema
should be used for decoding distinguished names, attribute descriptions, and other objects which require aSchema
in order to be decoded.
-
-
-
Constructor Detail
-
DecodeOptions
public DecodeOptions()
Creates a new set of decode options which will always use the default schema returned bySchema.getDefaultSchema()
,LinkedAttribute
, andLinkedHashMapEntry
.
-
DecodeOptions
public DecodeOptions(DecodeOptions options)
Creates a new set of decode options having the same initial set of options as the provided set of decode options.- Parameters:
options
- The set of decode options to be copied.
-
-
Method Detail
-
getAttributeFactory
public Function<AttributeDescription,Attribute> getAttributeFactory()
Returns the function which will be used for creating newAttribute
instances when decoding attributes.- Returns:
- The function which will be used for creating new
Attribute
instances when decoding attributes.
-
getEntryFactory
public Function<Dn,Entry> getEntryFactory()
Returns the function which will be used for creating newEntry
instances when decoding entries.- Returns:
- The function which will be used for creating new
Entry
instances when decoding entries.
-
getSchemaResolver
public SchemaResolver getSchemaResolver()
Returns the strategy for selecting whichSchema
should be used for decoding distinguished names, attribute descriptions, and other objects which require aSchema
in order to be decoded.- Returns:
- The schema resolver which will be used for decoding.
-
setAttributeFactory
public DecodeOptions setAttributeFactory(Function<AttributeDescription,Attribute> factory)
Sets the function which will be used for creating newAttribute
instances when decoding attributes.- Parameters:
factory
- The function which will be used for creating newAttribute
instances when decoding attributes.- Returns:
- A reference to this set of decode options.
- Throws:
NullPointerException
- Iffactory
wasnull
.
-
setEntryFactory
public DecodeOptions setEntryFactory(Function<Dn,Entry> factory)
Sets the function which will be used for creating newEntry
instances when decoding entries.- Parameters:
factory
- The function which will be used for creating newEntry
instances when decoding entries.- Returns:
- A reference to this set of decode options.
- Throws:
NullPointerException
- Iffactory
wasnull
.
-
setSchema
public DecodeOptions setSchema(Schema schema)
Sets theSchema
which will be used for decoding distinguished names, attribute descriptions, and other objects which require a schema in order to be decoded. This setting overrides the currently active schema resolver set usingsetSchemaResolver(org.forgerock.opendj.ldap.SchemaResolver)
.- Parameters:
schema
- TheSchema
which will be used for decoding.- Returns:
- A reference to this set of decode options.
- Throws:
NullPointerException
- Ifschema
wasnull
.
-
setSchemaResolver
public DecodeOptions setSchemaResolver(SchemaResolver resolver)
Sets the strategy for selecting whichSchema
should be used for decoding distinguished names, attribute descriptions, and other objects which require aSchema
in order to be decoded. This setting overrides the currently active schema set usingsetSchema(org.forgerock.opendj.ldap.schema.Schema)
.- Parameters:
resolver
- TheSchemaResolver
which will be used for decoding.- Returns:
- A reference to this set of decode options.
- Throws:
NullPointerException
- Ifresolver
wasnull
.
-
-