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 SessDenyRequest extends AbstractJmsRequest 35 { 36 37 private Vector ids; 38 39 private boolean queueMode; 40 41 private boolean doNotAck = false; 42 43 44 52 public SessDenyRequest(String targetName, Vector ids, boolean queueMode) 53 { 54 super(targetName); 55 this.ids = ids; 56 this.queueMode = queueMode; 57 } 58 59 69 public SessDenyRequest(String targetName, Vector ids, boolean queueMode, 70 boolean doNotAck) 71 { 72 super(targetName); 73 this.ids = ids; 74 this.queueMode = queueMode; 75 this.doNotAck = doNotAck; 76 } 77 78 81 public SessDenyRequest() 82 {} 83 84 85 86 public void setIds(Vector ids) 87 { 88 this.ids = ids; 89 } 90 91 public void addId(String id) { 92 if (ids == null) 93 ids = new Vector (); 94 ids.addElement(id); 95 } 96 97 98 public void setQueueMode(boolean queueMode) 99 { 100 this.queueMode = queueMode; 101 } 102 103 104 public void setDoNotAck(boolean doNotAck) 105 { 106 this.doNotAck = doNotAck; 107 } 108 109 110 public Vector getIds() 111 { 112 return ids; 113 } 114 115 116 public boolean getQueueMode() 117 { 118 return queueMode; 119 } 120 121 125 public boolean getDoNotAck() 126 { 127 return doNotAck; 128 } 129 130 public Hashtable soapCode() { 131 Hashtable h = super.soapCode(); 132 h.put("queueMode",new Boolean (queueMode)); 133 h.put("doNotAck",new Boolean (doNotAck)); 134 int size = ids.size(); 136 if (size > 0) { 137 Vector arrayId = new Vector (); 138 for (int i = 0; i<size; i++) { 139 arrayId.insertElementAt((String ) ids.elementAt(0),i); 140 ids.removeElementAt(0); 141 } 142 if (arrayId != null) 143 h.put("arrayId",arrayId); 144 } 145 return h; 146 } 147 148 public static Object soapDecode(Hashtable h) { 149 SessDenyRequest req = new SessDenyRequest(); 150 req.setRequestId(((Integer ) h.get("requestId")).intValue()); 151 req.setTarget((String ) h.get("target")); 152 req.setQueueMode(((Boolean ) h.get("queueMode")).booleanValue()); 153 req.setDoNotAck(((Boolean ) h.get("doNotAck")).booleanValue()); 154 Vector arrayId = (Vector ) h.get("arrayId"); 155 if (arrayId != null) { 156 for (int i = 0; i<arrayId.size(); i++) 157 req.addId((String ) arrayId.elementAt(i)); 158 } 159 return req; 160 } 161 } 162 | Popular Tags |