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.tx;
006:
007: import com.tc.exception.ImplementMe;
008: import com.tc.net.groups.NodeID;
009: import com.tc.object.dmi.DmiDescriptor;
010: import com.tc.object.dna.impl.ObjectStringSerializer;
011: import com.tc.object.gtx.GlobalTransactionID;
012: import com.tc.object.lockmanager.api.LockID;
013: import com.tc.object.tx.ServerTransactionID;
014: import com.tc.object.tx.TransactionID;
015: import com.tc.object.tx.TxnBatchID;
016: import com.tc.object.tx.TxnType;
017: import com.tc.util.SequenceID;
018:
019: import java.util.ArrayList;
020: import java.util.Collection;
021: import java.util.Collections;
022: import java.util.List;
023: import java.util.Map;
024: import java.util.Set;
025:
026: public final class TestServerTransaction implements ServerTransaction {
027:
028: public List changes = new ArrayList();
029: private ServerTransactionID sid;
030: private TxnBatchID bid;
031: private final GlobalTransactionID gtid;
032:
033: public TestServerTransaction(ServerTransactionID sid, TxnBatchID bid) {
034: this (sid, bid, null);
035: }
036:
037: public TestServerTransaction(ServerTransactionID sid,
038: TxnBatchID bid, GlobalTransactionID gtid) {
039: this .sid = sid;
040: this .bid = bid;
041: this .gtid = gtid;
042: }
043:
044: public ObjectStringSerializer getSerializer() {
045: throw new ImplementMe();
046: }
047:
048: public LockID[] getLockIDs() {
049: throw new ImplementMe();
050: }
051:
052: public NodeID getSourceID() {
053: return sid.getSourceID();
054: }
055:
056: public TransactionID getTransactionID() {
057: return sid.getClientTransactionID();
058: }
059:
060: public SequenceID getClientSequenceID() {
061: throw new ImplementMe();
062: }
063:
064: public List getChanges() {
065: return changes;
066: }
067:
068: public Map getNewRoots() {
069: return Collections.EMPTY_MAP;
070: }
071:
072: public TxnType getTransactionType() {
073: throw new ImplementMe();
074: }
075:
076: public Set getObjectIDs() {
077: throw new ImplementMe();
078: }
079:
080: public Collection getNotifies() {
081: return Collections.EMPTY_LIST;
082: }
083:
084: public ServerTransactionID getServerTransactionID() {
085: return sid;
086: }
087:
088: public TxnBatchID getBatchID() {
089: return bid;
090: }
091:
092: public DmiDescriptor[] getDmiDescriptors() {
093: throw new ImplementMe();
094: }
095:
096: public boolean isPassive() {
097: return false;
098: }
099:
100: public Set getNewObjectIDs() {
101: throw new ImplementMe();
102: }
103:
104: public GlobalTransactionID getGlobalTransactionID() {
105: if (gtid != null) {
106: return gtid;
107: }
108: throw new ImplementMe();
109: }
110:
111: public boolean needsBroadcast() {
112: return true;
113: }
114:
115: }
|