1 22 package org.jboss.mq; 23 24 import java.io.Externalizable ; 25 26 import javax.jms.Destination ; 27 28 39 public class AcknowledgementRequest implements Externalizable 40 { 41 43 44 private static final long serialVersionUID = -2227528634302168874L; 45 46 48 49 public boolean isAck; 50 51 public Destination destination = null; 52 53 public String messageID = null; 54 55 public int subscriberId; 56 57 59 61 public AcknowledgementRequest() 62 { 63 this(false); 64 } 65 66 public AcknowledgementRequest(boolean ack) 67 { 68 this.isAck = ack; 69 } 70 71 73 public boolean isAck() 74 { 75 return isAck; 76 } 77 78 80 public boolean equals(Object o) 81 { 82 83 if (!(o instanceof AcknowledgementRequest)) 84 { 85 return false; 86 } 87 88 return messageID.equals(((AcknowledgementRequest) o).messageID) 89 && destination.equals(((AcknowledgementRequest) o).destination) 90 && subscriberId == ((AcknowledgementRequest) o).subscriberId; 91 } 92 93 public int hashCode() 94 { 95 return messageID.hashCode(); 96 } 97 98 public String toString() 99 { 100 return "AcknowledgementRequest:" + 101 ((isAck) ? "ACK" : "NACK") + "," + destination + "," + messageID; 102 } 103 104 public void readExternal(java.io.ObjectInput in) throws java.io.IOException 105 { 106 isAck = in.readBoolean(); 107 destination = SpyDestination.readDest(in); 108 messageID = in.readUTF(); 109 subscriberId = in.readInt(); 110 } 111 112 114 public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException 115 { 116 out.writeBoolean(isAck); 117 SpyDestination.writeDest(out, destination); 118 out.writeUTF(messageID); 119 out.writeInt(subscriberId); 120 } 121 122 124 126 128 } 130 | Popular Tags |