ActiveMQDestination convert(String dest) { int p = dest.indexOf(":"); if( p<0 ) { throw new IllegalArgumentException("Not in the valid destination format"); } int type = Integer.parseInt(dest.substring(0, p)); String name = dest.substring(p+1); switch( KahaDestination.DestinationType.valueOf(type) ) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQTempQueue(name); case TEMP_TOPIC: return new ActiveMQTempTopic(name); default: throw new IllegalArgumentException("Not in the valid destination format"); } }
public KahaDestination mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException { while (true) { int tag = input.readTag(); if ((tag & 0x07) == 4) { return this; } switch (tag) { case 0: return this; default: { break; } case 8: { int t = input.readEnum(); KahaDestination.DestinationType value = KahaDestination.DestinationType.valueOf(t); if( value !=null ) { setType(value); } } break; case 18: setName(input.readString()); break; } } } public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
public KahaDestination mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException { while (true) { int tag = input.readTag(); if ((tag & 0x07) == 4) { return this; } switch (tag) { case 0: return this; default: { break; } case 8: { int t = input.readEnum(); KahaDestination.DestinationType value = KahaDestination.DestinationType.valueOf(t); if( value !=null ) { setType(value); } } break; case 18: setName(input.readString()); break; } } } public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
public KahaDestination mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException { while (true) { int tag = input.readTag(); if ((tag & 0x07) == 4) { return this; } switch (tag) { case 0: return this; default: { break; } case 8: { int t = input.readEnum(); KahaDestination.DestinationType value = KahaDestination.DestinationType.valueOf(t); if( value !=null ) { setType(value); } } break; case 18: setName(input.readString()); break; } } } public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
public KahaDestination mergeUnframed(org.apache.activemq.protobuf.CodedInputStream input) throws java.io.IOException { while (true) { int tag = input.readTag(); if ((tag & 0x07) == 4) { return this; } switch (tag) { case 0: return this; default: { break; } case 8: { int t = input.readEnum(); KahaDestination.DestinationType value = KahaDestination.DestinationType.valueOf(t); if( value !=null ) { setType(value); } } break; case 18: setName(input.readString()); break; } } } public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException {
ActiveMQDestination convert(String dest) { int p = dest.indexOf(":"); if (p < 0) { throw new IllegalArgumentException("Not in the valid destination format"); } int type = Integer.parseInt(dest.substring(0, p)); String name = dest.substring(p + 1); switch (KahaDestination.DestinationType.valueOf(type)) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQTempQueue(name); case TEMP_TOPIC: return new ActiveMQTempTopic(name); default: throw new IllegalArgumentException("Not in the valid destination format"); } }
ActiveMQDestination convert(String dest) { int p = dest.indexOf(":"); if( p<0 ) { throw new IllegalArgumentException("Not in the valid destination format"); } int type = Integer.parseInt(dest.substring(0, p)); String name = dest.substring(p+1); switch( KahaDestination.DestinationType.valueOf(type) ) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQTempQueue(name); case TEMP_TOPIC: return new ActiveMQTempTopic(name); default: throw new IllegalArgumentException("Not in the valid destination format"); } }
ActiveMQDestination convert(String dest) { int p = dest.indexOf(":"); if( p<0 ) { throw new IllegalArgumentException("Not in the valid destination format"); } int type = Integer.parseInt(dest.substring(0, p)); String name = dest.substring(p+1); switch( KahaDestination.DestinationType.valueOf(type) ) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQTempQueue(name); case TEMP_TOPIC: return new ActiveMQTempTopic(name); default: throw new IllegalArgumentException("Not in the valid destination format"); } }
/** * Determine whether this Destination matches the DestinationType * * @param destination * @param type * @return */ protected boolean matchType(Destination destination, KahaDestination.DestinationType type) { if (destination instanceof Topic && type.equals(KahaDestination.DestinationType.TOPIC)) { return true; } else if (destination instanceof Queue && type.equals(KahaDestination.DestinationType.QUEUE)) { return true; } return false; }
ActiveMQDestination convert(String dest) { int p = dest.indexOf(":"); if( p<0 ) { throw new IllegalArgumentException("Not in the valid destination format"); } int type = Integer.parseInt(dest.substring(0, p)); String name = dest.substring(p+1); switch( KahaDestination.DestinationType.valueOf(type) ) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQTempQueue(name); case TEMP_TOPIC: return new ActiveMQTempTopic(name); default: throw new IllegalArgumentException("Not in the valid destination format"); } }
ActiveMQDestination convert(String dest) { int p = dest.indexOf(":"); if( p<0 ) { throw new IllegalArgumentException("Not in the valid destination format"); } int type = Integer.parseInt(dest.substring(0, p)); String name = dest.substring(p+1); switch( KahaDestination.DestinationType.valueOf(type) ) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQTempQueue(name); case TEMP_TOPIC: return new ActiveMQTempTopic(name); default: throw new IllegalArgumentException("Not in the valid destination format"); } }
/** * Determine whether this Destination matches the DestinationType * * @param destination * @param type * @return */ protected boolean matchType(Destination destination, KahaDestination.DestinationType type) { if (destination instanceof Topic && type.equals(KahaDestination.DestinationType.TOPIC)) { return true; } else if (destination instanceof Queue && type.equals(KahaDestination.DestinationType.QUEUE)) { return true; } return false; }
/** * Determine whether this Destination matches the DestinationType * * @param destination * @param type * @return */ protected boolean matchType(Destination destination, KahaDestination.DestinationType type) { if (destination instanceof Topic && type.equals(KahaDestination.DestinationType.TOPIC)) { return true; } else if (destination instanceof Queue && type.equals(KahaDestination.DestinationType.QUEUE)) { return true; } return false; }
protected String key(KahaDestination destination) { return destination.getType().getNumber() + ":" + destination.getName(); }
private String key(KahaDestination destination) { return destination.getType().getNumber() + ":" + destination.getName(); }
public int serializedSizeUnframed() { if (memoizedSerializedSize != -1) return memoizedSerializedSize; int size = 0; if (hasType()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeEnumSize(1, getType().getNumber()); } if (hasName()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getName()); } memoizedSerializedSize = size; return size; }
public int serializedSizeUnframed() { if (memoizedSerializedSize != -1) return memoizedSerializedSize; int size = 0; if (hasType()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeEnumSize(1, getType().getNumber()); } if (hasName()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(2, getName()); } memoizedSerializedSize = size; return size; }
private String key(KahaDestination destination) { return destination.getType().getNumber() + ":" + destination.getName(); }
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasType()) { output.writeEnum(1, getType().getNumber()); } if (hasName()) { output.writeString(2, getName()); } }
public boolean equals(KahaDestination obj) { if (hasType() ^ obj.hasType() ) return false; if (hasType() && ( !getType().equals(obj.getType()) )) return false; if (hasName() ^ obj.hasName() ) return false; if (hasName() && ( !getName().equals(obj.getName()) )) return false; return true; }