org.opends.server.types
Class EntryEncodeConfig

java.lang.Object
  extended by org.opends.server.types.EntryEncodeConfig

@PublicAPI(stability=VOLATILE,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class EntryEncodeConfig
extends java.lang.Object

This class defines a data structure that contains configuration information about how an entry should be encoded.


Field Summary
static EntryEncodeConfig DEFAULT_CONFIG
          A reference to an entry encode configuration with all the default settings.
 
Constructor Summary
EntryEncodeConfig()
          Creates a new encoded entry configuration wtih the default settings.
EntryEncodeConfig(boolean excludeDN, boolean compressAttrDescriptions, boolean compressObjectClassSets)
          Creates a new encoded entry configuration wtih the specified settings.
EntryEncodeConfig(boolean excludeDN, boolean compressAttrDescriptions, boolean compressObjectClassSets, CompressedSchema compressedSchema)
          Creates a new encoded entry configuration wtih the specified settings.
 
Method Summary
 boolean compressAttributeDescriptions()
          Indicates whether the encoded entry should use compressed attribute descriptions.
 boolean compressObjectClassSets()
          Indicates whether the encoded entry should use compressed object class sets.
static EntryEncodeConfig decode(byte[] encodedEntry, int startPos, int length, CompressedSchema compressedSchema)
          Decodes the entry encode configuration from the specified portion of the given byte array.
 byte[] encode()
          Encodes this entry encode configuration into a byte array suitable for inclusion in the encoded entry.
 boolean excludeDN()
          Indicates whether the encoded entry should exclude the DN.
 CompressedSchema getCompressedSchema()
          Retrieves the compressed schema manager that may be used to generate compact schema encodings with this entry encode configuration.
 java.lang.String toString()
          Retrieves a string representation of this entry encode configuration.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this entry encode configuration to the provided buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG

public static final EntryEncodeConfig DEFAULT_CONFIG
A reference to an entry encode configuration with all the default settings.

Constructor Detail

EntryEncodeConfig

public EntryEncodeConfig()
Creates a new encoded entry configuration wtih the default settings.


EntryEncodeConfig

public EntryEncodeConfig(boolean excludeDN,
                         boolean compressAttrDescriptions,
                         boolean compressObjectClassSets)
Creates a new encoded entry configuration wtih the specified settings.

Parameters:
excludeDN - Indicates whether to exclude the DN from the encoded entry.
compressAttrDescriptions - Indicates whether to compress attribute descriptions.
compressObjectClassSets - Indicates whether to compress object class sets.

EntryEncodeConfig

public EntryEncodeConfig(boolean excludeDN,
                         boolean compressAttrDescriptions,
                         boolean compressObjectClassSets,
                         CompressedSchema compressedSchema)
Creates a new encoded entry configuration wtih the specified settings.

Parameters:
excludeDN - Indicates whether to exclude the DN from the encoded entry.
compressAttrDescriptions - Indicates whether to compress attribute descriptions.
compressObjectClassSets - Indicates whether to compress object class sets.
compressedSchema - The compressed schema manager for this encode config.
Method Detail

excludeDN

public boolean excludeDN()
Indicates whether the encoded entry should exclude the DN.

Returns:
true if the encoded entry should exclude the DN, or false if not.

compressAttributeDescriptions

public boolean compressAttributeDescriptions()
Indicates whether the encoded entry should use compressed attribute descriptions.

Returns:
true if the encoded entry should use compressed attribute descriptions, or false if not.

compressObjectClassSets

public boolean compressObjectClassSets()
Indicates whether the encoded entry should use compressed object class sets.

Returns:
true if the encoded entry should use compressed object class sets, or false if not.

getCompressedSchema

public CompressedSchema getCompressedSchema()
Retrieves the compressed schema manager that may be used to generate compact schema encodings with this entry encode configuration.

Returns:
The compressed schema manager that may be used to generate compact schema encodings with this entry encode configuration.

encode

public byte[] encode()
Encodes this entry encode configuration into a byte array suitable for inclusion in the encoded entry.

Returns:
A byte array containing the encoded configuration.

decode

public static EntryEncodeConfig decode(byte[] encodedEntry,
                                       int startPos,
                                       int length,
                                       CompressedSchema compressedSchema)
                                throws DirectoryException
Decodes the entry encode configuration from the specified portion of the given byte array.

Parameters:
encodedEntry - The byte array containing the encoded entry.
startPos - The position at which to start decoding the encode configuration.
length - The number of bytes contained in the encode configuration.
compressedSchema - The compressed schema manager to use when decoding.
Returns:
The decoded configuration.
Throws:
DirectoryException - If the configuration cannot be properly decoded.

toString

public java.lang.String toString()
Retrieves a string representation of this entry encode configuration.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this entry encode configuration.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this entry encode configuration to the provided buffer.

Parameters:
buffer - The buffer to which the information should be appended.