|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.backends.jeb.JebFormat
public class JebFormat
Handles the disk representation of LDAP data.
| Field Summary | |
|---|---|
static byte |
FORMAT_VERSION
The format version used by this class to encode and decode a DatabaseEntry. |
static byte |
TAG_DATABASE_ENTRY
The ASN1 tag for the DatabaseEntry type. |
static byte |
TAG_DIRECTORY_SERVER_ENTRY
The ASN1 tag for the DirectoryServerEntry type. |
| Constructor Summary | |
|---|---|
JebFormat()
|
|
| Method Summary | |
|---|---|
static byte[] |
decodeDatabaseEntry(byte[] bytes)
Decode a DatabaseEntry. |
static byte[] |
encodeDatabaseEntry(byte[] bytes,
DataConfig dataConfig)
Encodes a DatabaseEntry. |
static Entry |
entryFromDatabase(byte[] bytes,
CompressedSchema compressedSchema)
Decodes an entry from its database representation. |
static long |
entryIDFromDatabase(byte[] bytes)
Decode an entry ID value from its database representation. |
static long[] |
entryIDListFromDatabase(byte[] bytes)
Decode an array of entry ID values from its database representation. |
static byte[] |
entryIDListToDatabase(long[] entryIDArray)
Encode an array of entry ID values to its database representation. |
static byte[] |
entryIDToDatabase(long id)
Encode an entry ID value to its database representation. |
static long |
entryIDUndefinedSizeFromDatabase(byte[] bytes)
Decode an entry ID count from its database representation. |
static byte[] |
entryIDUndefinedSizeToDatabase(long count)
Encode an entry ID set count to its database representation. |
static byte[] |
entryToDatabase(Entry entry)
Encodes an entry to the raw database format, without compression. |
static byte[] |
entryToDatabase(Entry entry,
DataConfig dataConfig)
Encodes an entry to the raw database format, with optional compression. |
static byte |
getEntryVersion(byte[] bytes)
Get the version number of the DatabaseEntry. |
static int[] |
intArrayFromDatabaseBytes(byte[] bytes)
Decode a integer array using the specified byte array read from DB. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte FORMAT_VERSION
public static final byte TAG_DATABASE_ENTRY
public static final byte TAG_DIRECTORY_SERVER_ENTRY
| Constructor Detail |
|---|
public JebFormat()
| Method Detail |
|---|
public static byte[] decodeDatabaseEntry(byte[] bytes)
throws ASN1Exception,
java.util.zip.DataFormatException
bytes - The encoded bytes of a DatabaseEntry.
ASN1Exception - If the data is not in the expected ASN.1 encoding
format.
java.util.zip.DataFormatException - If an error occurs while trying to decompress
compressed data.
public static Entry entryFromDatabase(byte[] bytes,
CompressedSchema compressedSchema)
throws DirectoryException,
ASN1Exception,
LDAPException,
java.util.zip.DataFormatException
An entry on disk is ASN1 encoded in this format:
DatabaseEntry ::= [APPLICATION 0] IMPLICIT SEQUENCE {
uncompressedSize INTEGER, -- A zero value means not compressed.
dataBytes OCTET STRING -- Optionally compressed encoding of
the data bytes.
}
ID2EntryValue ::= DatabaseEntry
-- Where dataBytes contains an encoding of DirectoryServerEntry.
DirectoryServerEntry ::= [APPLICATION 1] IMPLICIT SEQUENCE {
dn LDAPDN,
objectClasses SET OF LDAPString,
userAttributes AttributeList,
operationalAttributes AttributeList
}
bytes - A byte array containing the encoded database value.compressedSchema - The compressed schema manager to use when decoding.
ASN1Exception - If the data is not in the expected ASN.1 encoding
format.
LDAPException - If the data is not in the expected ASN.1 encoding
format.
java.util.zip.DataFormatException - If an error occurs while trying to decompress
compressed data.
DirectoryException - If a Directory Server error occurs.
public static byte[] encodeDatabaseEntry(byte[] bytes,
DataConfig dataConfig)
bytes - The bytes to encode.dataConfig - Compression and cryptographic options.
public static byte[] entryToDatabase(Entry entry,
DataConfig dataConfig)
throws DirectoryException
entry - The entry to encode.dataConfig - Compression and cryptographic options.
DirectoryException - If a problem occurs while attempting to encode
the entry.
public static byte[] entryToDatabase(Entry entry)
throws DirectoryException
entry - The entry to encode.
DirectoryException - If a problem occurs while attempting to encode
the entry.public static long entryIDFromDatabase(byte[] bytes)
bytes - The database value of the entry ID.
public static long entryIDUndefinedSizeFromDatabase(byte[] bytes)
bytes - The database value of the entry ID count.
public static long[] entryIDListFromDatabase(byte[] bytes)
bytes - The raw database value, null if there is no value and
hence no entry IDs. Note that this method will throw an
ArrayIndexOutOfBoundsException if the bytes array length is
not a multiple of 8.
public static int[] intArrayFromDatabaseBytes(byte[] bytes)
bytes - The byte array.
public static byte[] entryIDToDatabase(long id)
id - The entry ID value to be encoded.
public static byte[] entryIDUndefinedSizeToDatabase(long count)
count - The entry ID set count to be encoded.
public static byte[] entryIDListToDatabase(long[] entryIDArray)
entryIDArray - An array of entry ID values.
public static byte getEntryVersion(byte[] bytes)
bytes - The encoded bytes of a DatabaseEntry.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||