public CompositeDestinationFilter(ActiveMQDestination destination) { ActiveMQDestination[] destinations = destination.getCompositeDestinations(); filters = new DestinationFilter[destinations.length]; for (int i = 0; i < destinations.length; i++) { ActiveMQDestination childDestination = destinations[i]; filters[i] = DestinationFilter.parseFilter(childDestination); } }
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 AbstractSubscription(Broker broker,ConnectionContext context, ConsumerInfo info) throws InvalidSelectorException { this.broker = broker; this.context = context; this.info = info; this.destinationFilter = DestinationFilter.parseFilter(info.getDestination()); this.selectorExpression = parseSelector(info); this.lastAckTime = System.currentTimeMillis(); }
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 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 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 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; }
private DestinationFilter getVirtualTopicConsumerDestinationFilter() { // created at startup, so no sync needed if (virtualConsumerDestinationFilter == null) { Set <ActiveMQQueue> consumerDestinations = new HashSet<>(); if (destinationInterceptors != null) { for (DestinationInterceptor interceptor : destinationInterceptors) { if (interceptor instanceof VirtualDestinationInterceptor) { VirtualDestinationInterceptor virtualDestinationInterceptor = (VirtualDestinationInterceptor) interceptor; for (VirtualDestination virtualDestination: virtualDestinationInterceptor.getVirtualDestinations()) { if (virtualDestination instanceof VirtualTopic) { consumerDestinations.add(new ActiveMQQueue(((VirtualTopic) virtualDestination).getPrefix() + DestinationFilter.ANY_DESCENDENT)); } if (isUseVirtualDestSubs()) { try { broker.virtualDestinationAdded(getAdminConnectionContext(), virtualDestination); LOG.debug("Adding virtual destination: {}", virtualDestination); } catch (Exception e) { LOG.warn("Could not fire virtual destination consumer advisory", e); } } } } } } ActiveMQQueue filter = new ActiveMQQueue(); filter.setCompositeDestinations(consumerDestinations.toArray(new ActiveMQDestination[]{})); virtualConsumerDestinationFilter = DestinationFilter.parseFilter(filter); } return virtualConsumerDestinationFilter; }
@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); } } }
DestinationFilter.parseFilter(info.getDestination());
if (dests != null && dests.length > 0) { for (ActiveMQDestination dest : dests) { DestinationFilter exclusionFilter = DestinationFilter.parseFilter(dest); if (dest != null && exclusionFilter.matches(destination) && dest.getDestinationType() == destination.getDestinationType()) { return false; 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; 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;
DestinationFilter filter = DestinationFilter.parseFilter(destination); if (filter.matches(destination2)) { return 1; DestinationFilter filter = DestinationFilter.parseFilter(destination2); if (filter.matches(destination)) { return -1;
DestinationFilter filter = DestinationFilter.parseFilter(ds.getLocalInfo().getDestination()); if (canConduit(ds) && filter.matches(info.getDestination())) { LOG.debug("{} {} with ids {} matched (add interest) {}", new Object[]{