KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > dna > api > DNA


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.dna.api;
5
6 import com.tc.object.ObjectID;
7
8 /**
9  * Represents the data of an object. Implementations of this interface are used to extract data from and apply
10  * (new/updated) data to objects. It's like serialization data, but it allows deltas to be extracted and applied.
11  *
12  * @author Orion Letizi
13  */

14 public interface DNA {
15   public static final int NULL_ARRAY_SIZE = -1;
16   public static final int NULL_VERSION = -1;
17
18   public long getVersion();
19
20   public boolean hasLength();
21
22   public int getArraySize();
23
24   /**
25    * returns true if the DNA represents a change of an object and
26    * returns false if the DNA represents the entire object.
27    */

28   public boolean isDelta();
29
30   public String JavaDoc getTypeName();
31
32   /**
33    * Gets the id of the object represented by this DNA strand. The id is globally unique.
34    * <p>
35    * TODO: Potentially change the type from long to something which can be a composite key. We want to be able to
36    * generate new ids in the local VM without making a round trip to the object service.
37    *
38    * @return The id in question
39    * @throws DNAException Exception thrown if the id cannot be resolved from the DNA strand.
40    */

41   public ObjectID getObjectID() throws DNAException;
42
43   public ObjectID getParentObjectID() throws DNAException;
44
45   /**
46    * Gets a DNACursor to spin through the field values.
47    *
48    * @return
49    */

50   public DNACursor getCursor();
51
52   public String JavaDoc getDefiningLoaderDescription();
53 }
Popular Tags