com.tc.object.dna.api
Interface DNA


public interface DNA

Represents the data of an object. Implementations of this interface are used to extract data from and apply (new/updated) data to objects. It's like serialization data, but it allows deltas to be extracted and applied.


Nested Class Summary
static class DNA.DNAType
           
 
Field Summary
static byte HAS_ARRAY_LENGTH
           
static byte HAS_PARENT_ID
           
static byte HAS_VERSION
           
static byte IS_DELTA
           
static int NULL_ARRAY_SIZE
          Array size constant indicating no array size
static long NULL_VERSION
          Version constant indicating no version
 
Method Summary
 int getArraySize()
          Get length of the array in the DNA or NULL_ARRAY_SIZE if it has no array length.
 DNACursor getCursor()
          Gets a DNACursor to spin through the field values.
 java.lang.String getDefiningLoaderDescription()
          Get defining classloader name
 ObjectID getObjectID()
          Gets the id of the object represented by this DNA strand.
 ObjectID getParentObjectID()
          If this object is an inner class, get the parent object identifier
 java.lang.String getTypeName()
          Get the class name of the type for this piece of DNA
 long getVersion()
          Get the version of this DNA based on the global transaction ID, may be NULL_VERSION.
 boolean hasLength()
          Determine whether this DNA has an array length
 boolean isDelta()
          Determine whether this DNA is a whole object or just a delta
 

Field Detail

NULL_ARRAY_SIZE

static final int NULL_ARRAY_SIZE
Array size constant indicating no array size

See Also:
Constant Field Values

NULL_VERSION

static final long NULL_VERSION
Version constant indicating no version

See Also:
Constant Field Values

HAS_ARRAY_LENGTH

static final byte HAS_ARRAY_LENGTH
See Also:
Constant Field Values

HAS_PARENT_ID

static final byte HAS_PARENT_ID
See Also:
Constant Field Values

IS_DELTA

static final byte IS_DELTA
See Also:
Constant Field Values

HAS_VERSION

static final byte HAS_VERSION
See Also:
Constant Field Values
Method Detail

getVersion

long getVersion()
Get the version of this DNA based on the global transaction ID, may be NULL_VERSION.


hasLength

boolean hasLength()
Determine whether this DNA has an array length

Returns:
True if has length

getArraySize

int getArraySize()
Get length of the array in the DNA or NULL_ARRAY_SIZE if it has no array length.

Returns:
Array length or NULL_ARRAY_SIZE

isDelta

boolean isDelta()
Determine whether this DNA is a whole object or just a delta

Returns:
true if the DNA represents a change of an object and false if the DNA represents the entire object.

getTypeName

java.lang.String getTypeName()
Get the class name of the type for this piece of DNA

Returns:
Class name

getObjectID

ObjectID getObjectID()
                     throws DNAException
Gets the id of the object represented by this DNA strand. The id is globally unique.

TODO: Potentially change the type from long to something which can be a composite key. We want to be able to generate new ids in the local VM without making a round trip to the object service.

Returns:
The id in question
Throws:
DNAException - Exception thrown if the id cannot be resolved from the DNA strand.

getParentObjectID

ObjectID getParentObjectID()
                           throws DNAException
If this object is an inner class, get the parent object identifier

Returns:
The parent object if one exists
Throws:
DNAException - Exception thrown if the id cannot be resolved

getCursor

DNACursor getCursor()
Gets a DNACursor to spin through the field values.

Returns:
The cursor

getDefiningLoaderDescription

java.lang.String getDefiningLoaderDescription()
Get defining classloader name

Returns:
Classloader name


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.