Method from org.apache.activemq.command.MessageId Detail: |
public int compareTo(MessageId other) {
int result = -1;
if (other != null) {
result = this.toString().compareTo(other.toString());
}
return result;
}
|
public MessageId copy() {
MessageId copy = new MessageId(producerId, producerSequenceId);
copy.key = key;
copy.brokerSequenceId = brokerSequenceId;
return copy;
}
|
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || o.getClass() != getClass()) {
return false;
}
MessageId id = (MessageId)o;
return producerSequenceId == id.producerSequenceId && producerId.equals(id.producerId);
}
|
public long getBrokerSequenceId() {
return brokerSequenceId;
}
|
public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE;
}
|
public ProducerId getProducerId() {
return producerId;
}
|
public long getProducerSequenceId() {
return producerSequenceId;
}
|
public int hashCode() {
if (hashCode == 0) {
hashCode = producerId.hashCode() ^ (int)producerSequenceId;
}
return hashCode;
}
|
public boolean isMarshallAware() {
return false;
}
|
public void setBrokerSequenceId(long brokerSequenceId) {
this.brokerSequenceId = brokerSequenceId;
}
|
public void setProducerId(ProducerId producerId) {
this.producerId = producerId;
}
|
public void setProducerSequenceId(long producerSequenceId) {
this.producerSequenceId = producerSequenceId;
}
|
public void setTextView(String key) {
this.key = key;
}
Sets the transient text view of the message which will be ignored if the
message is marshaled on a transport; so is only for in-JVM changes to
accommodate foreign JMS message IDs |
public void setValue(String messageKey) {
key = messageKey;
// Parse off the sequenceId
int p = messageKey.lastIndexOf(":");
if (p >= 0) {
producerSequenceId = Long.parseLong(messageKey.substring(p + 1));
messageKey = messageKey.substring(0, p);
}
producerId = new ProducerId(messageKey);
}
Sets the value as a String |
public String toString() {
if (key == null) {
key = producerId.toString() + ":" + producerSequenceId;
}
return key;
}
|