public boolean matches(ActiveMQDestination destination) { for (int i = 0; i < filters.length; i++) { if (filters[i].matches(destination)) { return true; } } return false; }
@Override public boolean matches(ActiveMQDestination destination) { return destinationFilter.matches(destination); }
public Object evaluate(MessageEvaluationContext message) throws JMSException { return matches(message) ? Boolean.TRUE : Boolean.FALSE; }
public Message[] browse(ActiveMQDestination destination) throws Exception { List<Message> result = new ArrayList<Message>(); ArrayList<TimestampWrapper> copy = new ArrayList<TimestampWrapper>(buffer); DestinationFilter filter = DestinationFilter.parseFilter(destination); for (Iterator<TimestampWrapper> iter = copy.iterator(); iter.hasNext();) { TimestampWrapper timestampWrapper = iter.next(); MessageReference ref = timestampWrapper.message; Message message = ref.getMessage(); if (filter.matches(message.getDestination())) { result.add(message); } } return result.toArray(new Message[result.size()]); }
public Message[] browse(ActiveMQDestination destination) { List<Message> result = new ArrayList<Message>(); DestinationFilter filter = DestinationFilter.parseFilter(destination); synchronized (lock) { for (Iterator<MessageReference> i = list.iterator(); i.hasNext();) { MessageReference ref = i.next(); Message msg; msg = ref.getMessage(); if (filter.matches(msg.getDestination())) { result.add(msg); } } } return result.toArray(new Message[result.size()]); }
/** * Return true if this subscription matches the given destination * * @param destination the destination to compare against * @return true if this subscription matches the given destination */ public boolean matchesDestination(ActiveMQDestination destination) { ActiveMQDestination subscriptionDestination = subscription.getActiveMQDestination(); DestinationFilter filter = DestinationFilter.parseFilter(subscriptionDestination); return filter.matches(destination); }
public Message[] browse(ActiveMQDestination destination) throws Exception { List<Message> result = new ArrayList<Message>(); if (lastImage != null) { DestinationFilter filter = DestinationFilter.parseFilter(destination); if (filter.matches(lastImage.getMessage().getDestination())) { result.add(lastImage.getMessage()); } } return result.toArray(new Message[result.size()]); }
protected boolean doesConsumerExist(ActiveMQDestination dest) { DestinationFilter filter = DestinationFilter.parseFilter(dest); for (DemandSubscription ds : subscriptionMapByLocalId.values()) { if (filter.matches(ds.getLocalInfo().getDestination())) { return true; } } return false; } }
public synchronized Message[] browse(ActiveMQDestination destination) throws Exception { List<Message> result = new ArrayList<Message>(); DestinationFilter filter = DestinationFilter.parseFilter(destination); int t = tail; if (messages[t] == null) { t = 0; } if (messages[t] != null) { do { MessageReference ref = messages[t]; Message message = ref.getMessage(); if (filter.matches(message.getDestination())) { result.add(message); } t++; if (t >= messages.length) { t = 0; } } while (t != tail); } return result.toArray(new Message[result.size()]); }
public Message[] browse(ActiveMQDestination destination) throws Exception { final List<Message> result = new ArrayList<Message>(); if (retainedMessage != null) { DestinationFilter filter = DestinationFilter.parseFilter(destination); if (filter.matches(retainedMessage.getMessage().getDestination())) { result.add(retainedMessage.getMessage()); } } Message[] messages = result.toArray(new Message[result.size()]); if (wrapped != null) { final Message[] wrappedMessages = wrapped.browse(destination); if (wrappedMessages != null && wrappedMessages.length > 0) { final int origLen = messages.length; messages = Arrays.copyOf(messages, origLen + wrappedMessages.length); System.arraycopy(wrappedMessages, 0, messages, origLen, wrappedMessages.length); } } return messages; }
@Override public boolean matches(VirtualDestination virtualDestination, ActiveMQDestination activeMQDest) { if (virtualDestination instanceof CompositeDestination) { DestinationFilter filter = DestinationFilter.parseFilter(virtualDestination.getMappedDestinations()); if (filter.matches(activeMQDest)) { return true; } } else if (virtualDestination instanceof VirtualTopic) { DestinationFilter filter = DestinationFilter.parseFilter(new ActiveMQQueue(((VirtualTopic) virtualDestination).getPrefix() + DestinationFilter.ANY_DESCENDENT)); if (filter.matches(activeMQDest)) { return true; } } return false; }
public static ActiveMQDestination findMatchingDestination(ActiveMQDestination[] dests, ActiveMQDestination destination) { if (dests != null && dests.length > 0) { for (ActiveMQDestination dest : dests) { DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest); if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) { return dest; } } } return null; }
public static boolean matchesDestinations(ActiveMQDestination[] dests, final ActiveMQDestination destination) { if (dests != null && dests.length > 0) { for (ActiveMQDestination dest : dests) { DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest); if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) { return true; } } } return false; }
public static boolean matchesNetworkConfig(final NetworkBridgeConfiguration config, ActiveMQDestination destination) { List<ActiveMQDestination> includedDests = config.getDynamicallyIncludedDestinations(); if (includedDests != null && includedDests.size() > 0) { for (ActiveMQDestination dest : includedDests) { DestinationFilter inclusionFilter = DestinationFilter.parseFilter(dest); if (dest != null && inclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) { return true; } } } return false; }
public boolean shouldRecordVirtualDestination(ActiveMQDestination destination) { return isUseVirtualTopics() && destination.isQueue() && getVirtualTopicConsumerDestinationFilter().matches(destination); }
protected void startVirtualConsumerDestinations() throws Exception { checkStartException(); ConnectionContext adminConnectionContext = getAdminConnectionContext(); Set<ActiveMQDestination> destinations = destinationFactory.getDestinations(); DestinationFilter filter = getVirtualTopicConsumerDestinationFilter(); if (!destinations.isEmpty()) { for (ActiveMQDestination destination : destinations) { if (filter.matches(destination) == true) { broker.addDestination(adminConnectionContext, destination, false); } } } }
public boolean matches(MessageEvaluationContext message) throws JMSException { try { if (message.isDropped()) { return false; } return matches(message.getMessage().getDestination()); } catch (IOException e) { throw JMSExceptionSupport.create(e); } }
@SuppressWarnings("rawtypes") //Used to filter out any child/unmatching entries private boolean isMatchOrParent(final ActiveMQDestination destination, final DestinationMapEntry entry) { //If destination not set then do not filter out if (entry.getDestination() == null) { return true; } final DestinationFilter filter = DestinationFilter.parseFilter(entry.getDestination()); return destination.equals(entry.getDestination()) || filter.matches(destination); }
@Override public void create(Broker broker, ConnectionContext context, ActiveMQDestination destination) throws Exception { if (destination.isQueue() && destination.isPattern()) { DestinationFilter filter = DestinationFilter.parseFilter(new ActiveMQQueue(prefix + DestinationFilter.ANY_DESCENDENT)); if (filter.matches(destination)) { broker.addDestination(context, destination, false); } } }