1 57 58 package org.apache.wsif.util.jms; 59 60 import org.apache.wsif.WSIFCorrelationId; 61 62 68 public class WSIFJMSCorrelationId implements WSIFCorrelationId { 69 private static final long serialVersionUID = 1L; 70 71 private String id; 72 73 78 public WSIFJMSCorrelationId(String id) { 79 if (id.length() < 256) { 80 this.id = id; 81 } else { 82 throw new IllegalArgumentException ("id length must be less than 256 characters"); 83 } 84 } 85 86 91 public String getCorrelationId() { 92 return id; 93 } 94 95 100 public byte[] getCorrelationIdAsBytes() { 101 return id.getBytes(); 102 } 103 104 113 public boolean equals(Object cid) { 114 if (cid != null && cid instanceof WSIFCorrelationId) { 115 return this.id.equals(((WSIFCorrelationId) cid).getCorrelationId()); 116 } else { 117 return false; 118 } 119 } 120 121 126 public String toString() { 127 return id; 128 } 129 130 135 public int hashCode() { 136 return id.hashCode(); 137 } 138 } | Popular Tags |