@Override public Set<ActiveMQDestination> getDestinations() { return persistenceAdapter.getDestinations(); }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> results = new HashSet<ActiveMQDestination>(); for (PersistenceAdapter persistenceAdapter : adapters) { results.addAll(persistenceAdapter.getDestinations()); } return results; }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> destinations = new HashSet<ActiveMQDestination>(longTermPersistence.getDestinations()); destinations.addAll(queues.keySet()); destinations.addAll(topics.keySet()); return destinations; }
private void registerExistingAdapter(FilteredKahaDBPersistenceAdapter filteredAdapter, File candidate) throws IOException { PersistenceAdapter adapter = adapterFromTemplate(filteredAdapter, candidate.getName()); startAdapter(adapter, candidate.getName()); Set<ActiveMQDestination> destinations = adapter.getDestinations(); if (destinations.size() != 0) { registerAdapter(filteredAdapter, adapter, destinations.toArray(new ActiveMQDestination[]{})[0]); } else { stopAdapter(adapter, candidate.getName()); } }
/** * Provides a means of querying the persistence adapter for a list of ActiveMQQueue instances * that match some given search criteria. * * @param adapter * the persistence adapter instance to query. * @param matcher * the DestinationMatcher instance used to find the target destinations. * * @return a List<ActiveMQQeue> with all the matching destinations. * * @throws IOException if an error occurs while reading the destinations. */ static public List<ActiveMQQueue> listQueues(PersistenceAdapter adapter, DestinationMatcher matcher) throws IOException { ArrayList<ActiveMQQueue> rc = new ArrayList<ActiveMQQueue>(); for (ActiveMQDestination destination : adapter.getDestinations()) { if (destination.isQueue() && matcher.matches(destination)) { rc.add((ActiveMQQueue) destination); } } return rc; }
/** * Provides a means of querying the persistence adapter for a list of ActiveMQTopic instances * that match some given search criteria. * * @param adapter * the persistence adapter instance to query. * @param matcher * the DestinationMatcher instance used to find the target destinations. * * @return a List<ActiveMQTopic> with all the matching destinations. * * @throws IOException if an error occurs while reading the destinations. */ static public List<ActiveMQTopic> listTopics(PersistenceAdapter adapter, DestinationMatcher matcher) throws IOException { ArrayList<ActiveMQTopic> rc = new ArrayList<ActiveMQTopic>(); for (ActiveMQDestination destination : adapter.getDestinations()) { if (destination.isTopic() && matcher.matches(destination)) { rc.add((ActiveMQTopic) destination); } } return rc; }
@Override public void removeQueueMessageStore(ActiveMQQueue destination) { PersistenceAdapter adapter = null; try { adapter = getMatchingPersistenceAdapter(destination); } catch (IOException e) { throw new RuntimeException(e); } if (adapter instanceof PersistenceAdapter && adapter.getDestinations().isEmpty()) { adapter.removeQueueMessageStore(destination); removeMessageStore(adapter, destination); destinationMap.remove(destination, adapter); } }
@Override public void removeTopicMessageStore(ActiveMQTopic destination) { PersistenceAdapter adapter = null; try { adapter = getMatchingPersistenceAdapter(destination); } catch (IOException e) { throw new RuntimeException(e); } if (adapter instanceof PersistenceAdapter && adapter.getDestinations().isEmpty()) { adapter.removeTopicMessageStore(destination); removeMessageStore(adapter, destination); destinationMap.remove(destination, adapter); } }
/** * Searches the set of subscriptions from the given persistence adapter and returns all those * that belong to the given ClientId value. * * @param adapter * the persistence adapter instance to search within. * @param clientId * the client ID value used to filter the subscription set. * * @return a list of all subscriptions belonging to the given client. * * @throws IOException if an error occurs while listing the stored subscriptions. */ static public List<SubscriptionInfo> listSubscriptions(PersistenceAdapter adapter, String clientId) throws IOException { ArrayList<SubscriptionInfo> rc = new ArrayList<SubscriptionInfo>(); for (ActiveMQDestination destination : adapter.getDestinations()) { if (destination.isTopic()) { TopicMessageStore store = adapter.createTopicMessageStore((ActiveMQTopic) destination); for (SubscriptionInfo sub : store.getAllSubscriptions()) { if (clientId == sub.getClientId() || clientId.equals(sub.getClientId())) { rc.add(sub); } } } } return rc; }
public void testAddRemoveConsumerDest() throws Exception { ActiveMQQueue consumerQ = new ActiveMQQueue("Consumer.A.VirtualTopicTest"); MessageStore ms = pa.createQueueMessageStore(consumerQ); pa.removeQueueMessageStore(consumerQ); assertFalse(pa.getDestinations().contains(consumerQ)); }
@Override public Set<ActiveMQDestination> getDestinations() { return persistenceAdapter.getDestinations(); }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> results = new HashSet<ActiveMQDestination>(); for (PersistenceAdapter persistenceAdapter : adapters) { results.addAll(persistenceAdapter.getDestinations()); } return results; }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> results = new HashSet<ActiveMQDestination>(); for (PersistenceAdapter persistenceAdapter : adapters) { results.addAll(persistenceAdapter.getDestinations()); } return results; }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> destinations = new HashSet<ActiveMQDestination>(longTermPersistence.getDestinations()); destinations.addAll(queues.keySet()); destinations.addAll(topics.keySet()); return destinations; }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> destinations = new HashSet<ActiveMQDestination>(longTermPersistence.getDestinations()); destinations.addAll(queues.keySet()); destinations.addAll(topics.keySet()); return destinations; }
@Override public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> destinations = new HashSet<ActiveMQDestination>(longTermPersistence.getDestinations()); destinations.addAll(queues.keySet()); destinations.addAll(topics.keySet()); return destinations; }
public Set<ActiveMQDestination> getDestinations() { Set<ActiveMQDestination> destinations = new HashSet<ActiveMQDestination>(longTermPersistence.getDestinations()); destinations.addAll(queues.keySet()); destinations.addAll(topics.keySet()); return destinations; }
private void registerExistingAdapter(FilteredKahaDBPersistenceAdapter filteredAdapter, File candidate) throws IOException { PersistenceAdapter adapter = adapterFromTemplate(filteredAdapter, candidate.getName()); startAdapter(adapter, candidate.getName()); Set<ActiveMQDestination> destinations = adapter.getDestinations(); if (destinations.size() != 0) { registerAdapter(filteredAdapter, adapter, destinations.toArray(new ActiveMQDestination[]{})[0]); } else { stopAdapter(adapter, candidate.getName()); } }
private void registerExistingAdapter(FilteredKahaDBPersistenceAdapter filteredAdapter, File candidate) throws IOException { PersistenceAdapter adapter = adapterFromTemplate(filteredAdapter, candidate.getName()); startAdapter(adapter, candidate.getName()); Set<ActiveMQDestination> destinations = adapter.getDestinations(); if (destinations.size() != 0) { registerAdapter(filteredAdapter, adapter, destinations.toArray(new ActiveMQDestination[]{})[0]); } else { stopAdapter(adapter, candidate.getName()); } }
private void registerExistingAdapter(FilteredKahaDBPersistenceAdapter filteredAdapter, File candidate) throws IOException { PersistenceAdapter adapter = adapterFromTemplate(filteredAdapter, candidate.getName()); startAdapter(adapter, candidate.getName()); Set<ActiveMQDestination> destinations = adapter.getDestinations(); if (destinations.size() != 0) { registerAdapter(filteredAdapter, adapter, destinations.toArray(new ActiveMQDestination[]{})[0]); } else { stopAdapter(adapter, candidate.getName()); } }