@Override protected boolean isEqual(final SimpleString entry, final ByteBuf byteBuf, final int offset, final int length) { if (entry == null) { return false; } return entry.equals(byteBuf, offset, length); }
@Override protected boolean isEqual(final StringValue entry, final ByteBuf byteBuf, final int offset, final int length) { if (entry == null || entry.val == null) { return false; } return entry.val.equals(byteBuf, offset, length); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ActiveMQDestination)) { return false; } ActiveMQDestination that = (ActiveMQDestination) o; return simpleAddress.equals(that.simpleAddress); }
/** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object o) { if (o == null || !this.getClass().equals(o.getClass())) { return false; } return name.equals(((PropertyExpression) o).name); }
if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (filterString == null) { if (other.filterString != null) return false; } else if (!filterString.equals(other.filterString)) return false; if (queueName == null) { if (other.queueName != null) return false; } else if (!queueName.equals(other.queueName)) return false; if (durable != other.durable)
if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (durable != other.durable) if (other.filterString != null) return false; } else if (!filterString.equals(other.filterString)) return false; if (queueName == null) { if (other.queueName != null) return false; } else if (!queueName.equals(other.queueName)) return false; if (requiresResponse != other.requiresResponse)
@Override public CoreMessage setAddress(SimpleString address) { if (address == null && this.address == null) { // no-op so just return return this; } if (validBuffer && (address == null || !address.equals(this.address))) { messageChanged(); } this.address = address; return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionCreateConsumerMessage)) return false; SessionCreateConsumerMessage other = (SessionCreateConsumerMessage) obj; if (browseOnly != other.browseOnly) return false; if (filterString == null) { if (other.filterString != null) return false; } else if (!filterString.equals(other.filterString)) return false; if (id != other.id) return false; if (queueName == null) { if (other.queueName != null) return false; } else if (!queueName.equals(other.queueName)) return false; if (requiresResponse != other.requiresResponse) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionDeleteQueueMessage)) return false; SessionDeleteQueueMessage other = (SessionDeleteQueueMessage) obj; if (queueName == null) { if (other.queueName != null) return false; } else if (!queueName.equals(other.queueName)) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionBindingQueryMessage)) return false; SessionBindingQueryMessage other = (SessionBindingQueryMessage) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionRequestProducerCreditsMessage)) return false; SessionRequestProducerCreditsMessage other = (SessionRequestProducerCreditsMessage) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (credits != other.credits) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionQueueQueryMessage)) return false; SessionQueueQueryMessage other = (SessionQueueQueryMessage) obj; if (queueName == null) { if (other.queueName != null) return false; } else if (!queueName.equals(other.queueName)) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionProducerCreditsFailMessage)) return false; SessionProducerCreditsFailMessage other = (SessionProducerCreditsFailMessage) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (credits != other.credits) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof SessionProducerCreditsMessage)) return false; SessionProducerCreditsMessage other = (SessionProducerCreditsMessage) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (credits != other.credits) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DisconnectMessage)) { return false; } DisconnectMessage other = (DisconnectMessage) obj; if (nodeID == null) { if (other.nodeID != null) { return false; } } else if (!nodeID.equals(other.nodeID)) { return false; } return true; } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof DisconnectMessage_V2)) { return false; } DisconnectMessage_V2 other = (DisconnectMessage_V2) obj; if (scaleDownNodeID == null) { if (other.scaleDownNodeID != null) { return false; } } else if (!scaleDownNodeID.equals(other.scaleDownNodeID)) { return false; } return true; } }
public static Set<String> getPropertyNames(Message message) { HashSet<String> set = new HashSet<>(); for (SimpleString propName : message.getPropertyNames()) { if (propName.equals(Message.HDR_GROUP_ID)) { set.add(MessageUtil.JMSXGROUPID); } else if (propName.equals(Message.HDR_VALIDATED_USER)) { set.add(MessageUtil.JMSXUSERID); } else if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.startsWith(CONNECTION_ID_PROPERTY_NAME) && !propName.equals(Message.HDR_ROUTING_TYPE) && !propName.startsWith(Message.HDR_ROUTE_TO_IDS)) { set.add(propName.toString()); } } set.add(JMSXDELIVERYCOUNT); return set; }
@Override public void cleanupInternalProperties() { if (properties.hasInternalProperties()) { LinkedList<SimpleString> valuesToRemove = null; for (SimpleString name : getPropertyNames()) { // We use properties to establish routing context on clustering. // However if the client resends the message after receiving, it needs to be removed if ((name.startsWith(Message.HDR_ROUTE_TO_IDS) && !name.equals(Message.HDR_ROUTE_TO_IDS)) || (name.startsWith(Message.HDR_ROUTE_TO_ACK_IDS) && !name.equals(Message.HDR_ROUTE_TO_ACK_IDS))) { if (valuesToRemove == null) { valuesToRemove = new LinkedList<>(); } valuesToRemove.add(name); } } if (valuesToRemove != null) { for (SimpleString removal : valuesToRemove) { this.removeProperty(removal); } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof CreateAddressMessage)) return false; CreateAddressMessage other = (CreateAddressMessage) obj; if (address == null) { if (other.address != null) return false; } else if (!address.equals(other.address)) return false; if (routingTypes == null) { if (other.routingTypes != null) return false; } else if (!routingTypes.equals(other.routingTypes)) return false; if (autoCreated != other.autoCreated) return false; if (requiresResponse != other.requiresResponse) return false; return true; } }
public static void clearProperties(Message message) { /** * JavaDoc for this method states: * Clears a message's properties. * The message's header fields and body are not cleared. * * Since the {@code Message.HDR_ROUTING_TYPE} is used for the JMSDestination header it isn't cleared */ List<SimpleString> toRemove = new ArrayList<>(); for (SimpleString propName : message.getPropertyNames()) { if ((!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) && !propName.equals(Message.HDR_ROUTING_TYPE)) { toRemove.add(propName); } } for (SimpleString propName : toRemove) { message.removeProperty(propName); } }