destination = new ActiveMQTemporaryTopic(address, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null);
/** * Static helper method for working with destinations. */ public static ActiveMQDestination createDestination(String name, TYPE defaultType) { if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true); } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true); } switch (defaultType) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQQueue(name, true); case TEMP_TOPIC: return new ActiveMQTopic(name, true); case DESTINATION: return new ActiveMQDestination(name, TYPE.DESTINATION, null); default: throw new IllegalArgumentException("Invalid default destination type: " + defaultType); } }
public static Destination fromPrefixedName(final String addr, final String name) { ActiveMQDestination destination; if (addr.startsWith(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX)) { String address = addr.substring(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX.length()); destination = createQueue(address); } else if (addr.startsWith(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX)) { String address = addr.substring(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX.length()); destination = createTopic(address); } else if (addr.startsWith(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX)) { String address = addr.substring(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX.length()); destination = new ActiveMQTemporaryQueue(address, null); } else if (addr.startsWith(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX)) { String address = addr.substring(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX.length()); destination = new ActiveMQTemporaryTopic(address, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null); } String unprefixedName = name; if (name.startsWith(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX.length()); } else if (name.startsWith(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX.length()); } else if (name.startsWith(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX.length()); } else if (name.startsWith(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX.length()); } destination.setName(unprefixedName); return destination; }
public static Destination fromPrefixedName(final String addr, final String name) { ActiveMQDestination destination; if (addr.startsWith(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX)) { String address = addr.substring(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX.length()); destination = createQueue(address); } else if (addr.startsWith(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX)) { String address = addr.substring(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX.length()); destination = createTopic(address); } else if (addr.startsWith(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX)) { String address = addr.substring(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX.length()); destination = new ActiveMQTemporaryQueue(address, null); } else if (addr.startsWith(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX)) { String address = addr.substring(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX.length()); destination = new ActiveMQTemporaryTopic(address, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null); } String unprefixedName = name; if (name.startsWith(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.QUEUE_QUALIFIED_PREFIX.length()); } else if (name.startsWith(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.TOPIC_QUALIFIED_PREFIX.length()); } else if (name.startsWith(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.TEMP_QUEUE_QUALIFED_PREFIX.length()); } else if (name.startsWith(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX)) { unprefixedName = name.substring(ActiveMQDestination.TEMP_TOPIC_QUALIFED_PREFIX.length()); } destination.setName(unprefixedName); return destination; }
/** * Static helper method for working with destinations. */ public static ActiveMQDestination createDestination(String name, TYPE defaultType) { if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true); } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true); } switch (defaultType) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQQueue(name, true); case TEMP_TOPIC: return new ActiveMQTopic(name, true); case DESTINATION: return new ActiveMQDestination(name, TYPE.DESTINATION, null); default: throw new IllegalArgumentException("Invalid default destination type: " + defaultType); } }
destination = new ActiveMQTemporaryTopic(address, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null);
/** * Static helper method for working with destinations. */ public static ActiveMQDestination createDestination(String name, TYPE defaultType) { if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true); } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true); } switch (defaultType) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQQueue(name, true); case TEMP_TOPIC: return new ActiveMQTopic(name, true); case DESTINATION: return new ActiveMQDestination(name, TYPE.DESTINATION, null); default: throw new IllegalArgumentException("Invalid default destination type: " + defaultType); } }
/** * Static helper method for working with destinations. */ public static ActiveMQDestination createDestination(String name, TYPE defaultType) { if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true); } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true); } switch (defaultType) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQQueue(name, true); case TEMP_TOPIC: return new ActiveMQTopic(name, true); case DESTINATION: return new ActiveMQDestination(name, TYPE.DESTINATION, null); default: throw new IllegalArgumentException("Invalid default destination type: " + defaultType); } }
/** * Static helper method for working with destinations. */ public static ActiveMQDestination createDestination(String name, TYPE defaultType) { if (name.startsWith(QUEUE_QUALIFIED_PREFIX)) { return new ActiveMQQueue(name.substring(QUEUE_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TOPIC_QUALIFIED_PREFIX)) { return new ActiveMQTopic(name.substring(TOPIC_QUALIFIED_PREFIX.length())); } else if (name.startsWith(TEMP_QUEUE_QUALIFED_PREFIX)) { return new ActiveMQQueue(name.substring(TEMP_QUEUE_QUALIFED_PREFIX.length()), true); } else if (name.startsWith(TEMP_TOPIC_QUALIFED_PREFIX)) { return new ActiveMQTopic(name.substring(TEMP_TOPIC_QUALIFED_PREFIX.length()), true); } switch (defaultType) { case QUEUE: return new ActiveMQQueue(name); case TOPIC: return new ActiveMQTopic(name); case TEMP_QUEUE: return new ActiveMQQueue(name, true); case TEMP_TOPIC: return new ActiveMQTopic(name, true); case DESTINATION: return new ActiveMQDestination(name, TYPE.DESTINATION, null); default: throw new IllegalArgumentException("Invalid default destination type: " + defaultType); } }
destination = new ActiveMQTemporaryTopic(address, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null);
public static Destination fromPrefixed1XName(final String addr, final String name) { ActiveMQDestination destination; if (addr.startsWith(PacketImpl.OLD_QUEUE_PREFIX.toString())) { destination = createQueue(addr); } else if (addr.startsWith(PacketImpl.OLD_TOPIC_PREFIX.toString())) { destination = createTopic(addr); } else if (addr.startsWith(PacketImpl.OLD_TEMP_QUEUE_PREFIX.toString())) { destination = new ActiveMQTemporaryQueue(addr, null); } else if (addr.startsWith(PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString())) { destination = new ActiveMQTemporaryTopic(addr, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null); } String unprefixedName = name; if (name.startsWith(PacketImpl.OLD_QUEUE_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_QUEUE_PREFIX.length()); } else if (name.startsWith(PacketImpl.OLD_TOPIC_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_TOPIC_PREFIX.length()); } else if (name.startsWith(PacketImpl.OLD_TEMP_QUEUE_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_TEMP_QUEUE_PREFIX.length()); } else if (name.startsWith(PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_TEMP_TOPIC_PREFIX.length()); } destination.setName(unprefixedName); return destination; }
public static Destination fromPrefixed1XName(final String addr, final String name) { ActiveMQDestination destination; if (addr.startsWith(PacketImpl.OLD_QUEUE_PREFIX.toString())) { destination = createQueue(addr); } else if (addr.startsWith(PacketImpl.OLD_TOPIC_PREFIX.toString())) { destination = createTopic(addr); } else if (addr.startsWith(PacketImpl.OLD_TEMP_QUEUE_PREFIX.toString())) { destination = new ActiveMQTemporaryQueue(addr, null); } else if (addr.startsWith(PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString())) { destination = new ActiveMQTemporaryTopic(addr, null); } else { destination = new ActiveMQDestination(addr, TYPE.DESTINATION, null); } String unprefixedName = name; if (name.startsWith(PacketImpl.OLD_QUEUE_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_QUEUE_PREFIX.length()); } else if (name.startsWith(PacketImpl.OLD_TOPIC_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_TOPIC_PREFIX.length()); } else if (name.startsWith(PacketImpl.OLD_TEMP_QUEUE_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_TEMP_QUEUE_PREFIX.length()); } else if (name.startsWith(PacketImpl.OLD_TEMP_TOPIC_PREFIX.toString())) { unprefixedName = name.substring(PacketImpl.OLD_TEMP_TOPIC_PREFIX.length()); } destination.setName(unprefixedName); return destination; }