/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2009 Sun Microsystems, Inc.
* Portions copyright 2013 ForgeRock AS.
*/
/**
* This class defines a data structure that contains configuration
* information about how an entry should be encoded.
*/
mayInstantiate=true,
mayExtend=false,
mayInvoke=true)
public final class EntryEncodeConfig
{
/**
* The encode mask value that can be used to indicate that the
* encoded entry should not contain a DN.
*/
/**
* The encode mask value that can be used that the encoded
* representation should compress the set of object classes.
*/
/**
* The encode mask value that can be used that the encoded
* representation should compress the set of attribute descriptions
* to conserve space and improve performance.
*/
/**
* A reference to an entry encode configuration with all the default
* settings.
*/
public static final EntryEncodeConfig
// Indicates whether to compress the attribute descriptions.
private final boolean compressAttrDescriptions;
// Indicates whether to compress the object class sets.
private final boolean compressObjectClassSets;
// Indicates whether to exclude the DN.
private final boolean excludeDN;
// The encoded representation of this encode configuration.
private final byte encodedRepresentation;
// The compressed schema handler for this encode configuration.
/**
* Creates a new encoded entry configuration with the default
* settings.
*/
public EntryEncodeConfig()
{
excludeDN = false;
compressAttrDescriptions = false;
compressObjectClassSets = false;
encodedRepresentation = 0x00;
}
/**
* Creates a new encoded entry configuration with the specified
* settings.
*
* @param excludeDN Indicates whether to exclude
* the DN from the encoded entry.
* @param compressAttrDescriptions Indicates whether to compress
* attribute descriptions.
* @param compressObjectClassSets Indicates whether to compress
* object class sets.
*/
boolean compressAttrDescriptions,
boolean compressObjectClassSets)
{
byte flagByte = 0x00;
if (excludeDN)
{
}
{
}
{
}
}
/**
* Creates a new encoded entry configuration with the specified
* settings.
*
* @param excludeDN Indicates whether to exclude
* the DN from the encoded entry.
* @param compressAttrDescriptions Indicates whether to compress
* attribute descriptions.
* @param compressObjectClassSets Indicates whether to compress
* object class sets.
* @param compressedSchema The compressed schema manager
* for this encode config.
*/
boolean compressAttrDescriptions,
boolean compressObjectClassSets,
{
this.compressedSchema = compressedSchema;
byte flagByte = 0x00;
if (excludeDN)
{
}
{
}
{
}
}
/**
* Indicates whether the encoded entry should exclude the DN.
*
* @return {@code true} if the encoded entry should exclude the DN,
* or {@code false} if not.
*/
public boolean excludeDN()
{
return excludeDN;
}
/**
* Indicates whether the encoded entry should use compressed
* attribute descriptions.
*
* @return {@code true} if the encoded entry should use compressed
* attribute descriptions, or {@code false} if not.
*/
public boolean compressAttributeDescriptions()
{
return compressAttrDescriptions;
}
/**
* Indicates whether the encoded entry should use compressed object
* class sets.
*
* @return {@code true} if the encoded entry should use compressed
* object class sets, or {@code false} if not.
*/
public boolean compressObjectClassSets()
{
return compressObjectClassSets;
}
/**
* Retrieves the compressed schema manager that may be used to
* generate compact schema encodings with this entry encode
* configuration.
*
* @return The compressed schema manager that may be used to
* generate compact schema encodings with this entry encode
* configuration.
*/
{
return compressedSchema;
}
/**
* Encodes this entry encode configuration into a byte array
* suitable for inclusion in the encoded entry.
*
* @param buffer The buffer to encode this configuration to.
*/
{
}
/**
* Decodes the entry encode configuration from current position and
* length of the given byte array.
*
* @param buffer The byte array containing the encoded
* entry.
* @param length The number of bytes contained in the
* encode configuration.
* @param compressedSchema The compressed schema manager to use
* when decoding.
*
* @return The decoded configuration.
*
* @throws DirectoryException If the configuration cannot be
* properly decoded.
*/
public static EntryEncodeConfig
throws DirectoryException
{
if (length != 1)
{
throw new DirectoryException(
message);
}
boolean excludeDN = false;
if ((b & ENCODE_FLAG_EXCLUDE_DN) == ENCODE_FLAG_EXCLUDE_DN)
{
excludeDN = true;
}
boolean compressAttrDescriptions = false;
if ((b & ENCODE_FLAG_COMPRESS_ADS) == ENCODE_FLAG_COMPRESS_ADS)
{
compressAttrDescriptions = true;
}
boolean compressObjectClassSets = false;
if ((b & ENCODE_FLAG_COMPRESS_OCS) == ENCODE_FLAG_COMPRESS_OCS)
{
compressObjectClassSets = true;
}
}
/**
* Retrieves a string representation of this entry encode
* configuration.
*
* @return A string representation of this entry encode
* configuration.
*/
{
}
/**
* Appends a string representation of this entry encode
* configuration to the provided buffer.
*
* @param buffer The buffer to which the information should be
* appended.
*/
{
}
}