1 5 package com.tc.l2.objectserver; 6 7 import com.tc.net.protocol.tcm.ChannelID; 8 import com.tc.object.dmi.DmiDescriptor; 9 import com.tc.object.dna.impl.ObjectStringSerializer; 10 import com.tc.object.lockmanager.api.LockID; 11 import com.tc.object.tx.ServerTransactionID; 12 import com.tc.object.tx.TransactionID; 13 import com.tc.object.tx.TxnBatchID; 14 import com.tc.object.tx.TxnType; 15 import com.tc.objectserver.tx.ServerTransaction; 16 import com.tc.util.Assert; 17 import com.tc.util.SequenceID; 18 19 import java.util.Collection ; 20 import java.util.List ; 21 import java.util.Map ; 22 import java.util.Set ; 23 24 public class ObjectSyncServerTransaction implements ServerTransaction { 25 26 private final TransactionID txnID; 27 private final Set oids; 28 private final List changes; 29 private final ObjectStringSerializer serializer; 30 private ServerTransactionID serverTxnID; 31 private final Map rootsMap; 32 33 public ObjectSyncServerTransaction(TransactionID txnID, Set oids, int dnaCount, ObjectStringSerializer serializer, 34 List changes, Map rootsMap) { 35 this.txnID = txnID; 36 this.oids = oids; 37 this.serializer = serializer; 38 this.changes = changes; 39 this.rootsMap = rootsMap; 40 this.serverTxnID = new ServerTransactionID(ChannelID.NULL_ID, txnID); 41 Assert.assertEquals(dnaCount, oids.size()); 42 Assert.assertEquals(dnaCount, changes.size()); 43 } 44 45 public Collection addNotifiesTo(List list) { 46 throw new UnsupportedOperationException (); 47 } 48 49 public TxnBatchID getBatchID() { 50 return TxnBatchID.NULL_BATCH_ID; 51 } 52 53 public List getChanges() { 54 return changes; 55 } 56 57 public ChannelID getChannelID() { 58 return ChannelID.NULL_ID; 59 } 60 61 public SequenceID getClientSequenceID() { 62 throw new UnsupportedOperationException (); 63 } 64 65 public DmiDescriptor[] getDmiDescriptors() { 66 throw new UnsupportedOperationException (); 67 } 68 69 public LockID[] getLockIDs() { 70 return new LockID[0]; 71 } 72 73 public Map getNewRoots() { 74 return rootsMap; 75 } 76 77 public Collection getObjectIDs() { 78 return oids; 79 } 80 81 84 public Set getNewObjectIDs() { 85 return oids; 86 } 87 88 public ObjectStringSerializer getSerializer() { 89 return serializer; 90 } 91 92 public ServerTransactionID getServerTransactionID() { 93 return serverTxnID; 94 } 95 96 public TransactionID getTransactionID() { 97 return txnID; 98 } 99 100 public TxnType getTransactionType() { 101 return TxnType.NORMAL; 102 } 103 104 public boolean isPassive() { 105 return true; 106 } 107 108 } 109 | Popular Tags |