001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.objectserver.core.api;
006:
007: import com.tc.object.ObjectID; // import com.tc.object.TCObject;
008: import com.tc.object.dna.api.DNA;
009: import com.tc.object.dna.api.DNACursor;
010: import com.tc.object.dna.api.DNAException;
011:
012: /**
013: * @author steve
014: */
015: public class TestDNA implements DNA {
016: public DNACursor cursor;
017: public ObjectID objectID;
018: public long version;
019: public String typeName = "SomeClassName";
020: public ObjectID parentObjectID = ObjectID.NULL_ID;
021: public boolean isDelta;
022: public String loaderDesc = "system.loader";
023:
024: public TestDNA(DNACursor cursor) {
025: this .cursor = cursor;
026: }
027:
028: public TestDNA(DNACursor cursor, String className) {
029: this .cursor = cursor;
030: this .typeName = className;
031: }
032:
033: public TestDNA(ObjectID oid) {
034: this .objectID = oid;
035:
036: }
037:
038: public TestDNA(ObjectID id, boolean isDelta) {
039: this .objectID = id;
040: this .isDelta = isDelta;
041: }
042:
043: /*
044: * public void setObject(TCObject object) throws DNAException { return; }
045: */
046:
047: public String getTypeName() {
048: return typeName;
049: }
050:
051: public ObjectID getObjectID() throws DNAException {
052: return objectID;
053: }
054:
055: public DNACursor getCursor() {
056: return cursor;
057: }
058:
059: public boolean hasLength() {
060: return false;
061: }
062:
063: public int getArraySize() {
064: return 0;
065: }
066:
067: public String getDefiningLoaderDescription() {
068: return loaderDesc;
069: }
070:
071: public ObjectID getParentObjectID() throws DNAException {
072: return parentObjectID;
073: }
074:
075: public void setHeaderInformation(ObjectID id, ObjectID parentID,
076: String type, int length, long version) throws DNAException {
077: return;
078: }
079:
080: public void addPhysicalAction(String field, Object value)
081: throws DNAException {
082: return;
083: }
084:
085: public void addLogicalAction(int method, Object[] parameters) {
086: return;
087: }
088:
089: public long getVersion() {
090: return this .version;
091: }
092:
093: public boolean isDelta() {
094: return isDelta;
095: }
096:
097: public String toString() {
098: return "TestDNA(" + objectID + ", version = " + version + ")";
099: }
100: }
|