public PutCommand[] getRequests() {
   final List<PutCommand> list = new ArrayList<PutCommand>(this.operations.size() * 2);
   for (final Map.Entry<MessageStore, Queue<TxOperation>> entry : this.operations.entrySet()) {
     for (final TxOperation op : entry.getValue()) {
       if (op.getType() == TxOperation.ADD_OP) {
         list.add(((AddMsgOperation) op).putCmd);
       }
     }
   }
   final PutCommand[] rt = new PutCommand[list.size()];
   return list.toArray(rt);
 }
 public Map<MessageStore, List<Long>> getMsgIds() {
   final Map<MessageStore, List<Long>> rt = new LinkedHashMap<MessageStore, List<Long>>();
   for (final Map.Entry<MessageStore, Queue<TxOperation>> entry : this.operations.entrySet()) {
     final MessageStore store = entry.getKey();
     final Queue<TxOperation> opQueue = entry.getValue();
     final List<Long> ids = new ArrayList<Long>();
     rt.put(store, ids);
     for (final TxOperation to : opQueue) {
       if (to.getType() == TxOperation.ADD_OP) {
         ids.add(((AddMsgOperation) to).msgId);
       }
     }
   }
   return rt;
 }
Esempio n. 3
0
 public String toString() {
   return "("
       + txTime
       + " - "
       + "Acct#: "
       + account.getId()
       + " "
       + operation.toString()
       + ": "
       + amount
       + ")";
 }