1 24 package com.scalagent.kjoram.jms; 25 26 import java.util.Hashtable ; 27 import java.util.Enumeration ; 28 import java.util.Vector ; 29 30 34 public class SessAckRequest extends AbstractJmsRequest 35 { 36 37 private Vector ids; 38 39 private boolean queueMode; 40 41 49 public SessAckRequest(String targetName, Vector ids, boolean queueMode) 50 { 51 super(targetName); 52 this.ids = ids; 53 this.queueMode = queueMode; 54 } 55 56 59 public SessAckRequest() { 60 ids = new Vector (); 61 } 62 63 64 public void setIds(Vector ids) 65 { 66 this.ids = ids; 67 } 68 69 public void addId(String id) { 70 ids.addElement(id); 71 } 72 73 74 public void setQueueMode(boolean queueMode) 75 { 76 this.queueMode = queueMode; 77 } 78 79 80 public Vector getIds() 81 { 82 return ids; 83 } 84 85 86 public boolean getQueueMode() 87 { 88 return queueMode; 89 } 90 91 public Hashtable soapCode() { 92 Hashtable h = super.soapCode(); 93 h.put("queueMode",new Boolean (queueMode)); 94 int size = ids.size(); 96 if (size > 0) { 97 Vector arrayId = new Vector (); 98 for (int i = 0; i<size; i++) { 99 arrayId.insertElementAt((String ) ids.elementAt(0),i); 100 ids.removeElementAt(0); 101 } 102 if (arrayId != null) 103 h.put("arrayId",arrayId); 104 } 105 return h; 106 } 107 108 public static Object soapDecode(Hashtable h) { 109 SessAckRequest req = new SessAckRequest(); 110 req.setRequestId(((Integer ) h.get("requestId")).intValue()); 111 req.setTarget((String ) h.get("target")); 112 req.setQueueMode(((Boolean ) h.get("queueMode")).booleanValue()); 113 Vector arrayId = (Vector ) h.get("arrayId"); 114 if (arrayId != null) { 115 for (int i = 0; i<arrayId.size(); i++) 116 req.addId((String ) arrayId.elementAt(i)); 117 } 118 return req; 119 } 120 } 121 | Popular Tags |