001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.activemq.web; 018 019import java.util.Collection; 020 021import org.apache.activemq.broker.jmx.*; 022import org.apache.activemq.command.ActiveMQDestination; 023 024/** 025 * A facade for either a local in JVM broker or a remote broker over JMX 026 * 027 * 028 * 029 */ 030public interface BrokerFacade { 031 032 /** 033 * The name of the active broker (f.e. 'localhost' or 'my broker'). 034 * 035 * @return not <code>null</code> 036 * @throws Exception 037 */ 038 String getBrokerName() throws Exception; 039 040 /** 041 * Admin view of the broker. 042 * 043 * @return not <code>null</code> 044 * @throws Exception 045 */ 046 BrokerViewMBean getBrokerAdmin() throws Exception; 047 048 /** 049 * All queues known to the broker. 050 * 051 * @return not <code>null</code> 052 * @throws Exception 053 */ 054 Collection<QueueViewMBean> getQueues() throws Exception; 055 056 /** 057 * All topics known to the broker. 058 * 059 * @return not <code>null</code> 060 * @throws Exception 061 */ 062 Collection<TopicViewMBean> getTopics() throws Exception; 063 064 /** 065 * All active consumers of a queue. 066 * 067 * @param queueName 068 * the name of the queue, not <code>null</code> 069 * @return not <code>null</code> 070 * @throws Exception 071 */ 072 Collection<SubscriptionViewMBean> getQueueConsumers(String queueName) 073 throws Exception; 074 075 /** 076 * All active producers to a queue. 077 * 078 * @param queueName 079 * the name of the queue, not <code>null</code> 080 * @return not <code>null</code> 081 * @throws Exception 082 */ 083 Collection<ProducerViewMBean> getQueueProducers(String queueName) 084 throws Exception; 085 086 /** 087 * All active producers to a topic. 088 * 089 * @param queueName 090 * the name of the topic, not <code>null</code> 091 * @return not <code>null</code> 092 * @throws Exception 093 */ 094 Collection<ProducerViewMBean> getTopicProducers(String queueName) 095 throws Exception; 096 097 /** 098 * All active non-durable subscribers to a topic. 099 * 100 * @param topicName 101 * the name of the topic, not <code>null</code> 102 * @return not <code>null</code> 103 * @throws Exception 104 */ 105 public Collection<SubscriptionViewMBean> getTopicSubscribers(String topicName) 106 throws Exception; 107 108 /** 109 * All active non-durable subscribers to a topic. 110 * 111 * @return not <code>null</code> 112 * @throws Exception 113 */ 114 public Collection<SubscriptionViewMBean> getNonDurableTopicSubscribers() 115 throws Exception; 116 117 /** 118 * Active durable subscribers to topics of the broker. 119 * 120 * @return not <code>null</code> 121 * @throws Exception 122 */ 123 Collection<DurableSubscriptionViewMBean> getDurableTopicSubscribers() 124 throws Exception; 125 126 127 /** 128 * Inactive durable subscribers to topics of the broker. 129 * 130 * @return not <code>null</code> 131 * @throws Exception 132 */ 133 Collection<DurableSubscriptionViewMBean> getInactiveDurableTopicSubscribers() 134 throws Exception; 135 136 /** 137 * The names of all transport connectors of the broker (f.e. openwire, ssl) 138 * 139 * @return not <code>null</code> 140 * @throws Exception 141 */ 142 Collection<String> getConnectors() throws Exception; 143 144 /** 145 * A transport connectors. 146 * 147 * @param name 148 * name of the connector (f.e. openwire) 149 * @return <code>null</code> if not found 150 * @throws Exception 151 */ 152 ConnectorViewMBean getConnector(String name) throws Exception; 153 154 /** 155 * All connections to all transport connectors of the broker. 156 * 157 * @return not <code>null</code> 158 * @throws Exception 159 */ 160 Collection<ConnectionViewMBean> getConnections() throws Exception; 161 162 /** 163 * The names of all connections to a specific transport connectors of the 164 * broker. 165 * 166 * @see #getConnection(String) 167 * @param connectorName 168 * not <code>null</code> 169 * @return not <code>null</code> 170 * @throws Exception 171 */ 172 Collection<String> getConnections(String connectorName) throws Exception; 173 174 /** 175 * A specific connection to the broker. 176 * 177 * @param connectionName 178 * the name of the connection, not <code>null</code> 179 * @return not <code>null</code> 180 * @throws Exception 181 */ 182 ConnectionViewMBean getConnection(String connectionName) throws Exception; 183 /** 184 * Returns all consumers of a connection. 185 * 186 * @param connectionName 187 * the name of the connection, not <code>null</code> 188 * @return not <code>null</code> 189 * @throws Exception 190 */ 191 Collection<SubscriptionViewMBean> getConsumersOnConnection( 192 String connectionName) throws Exception; 193 /** 194 * The brokers network connectors. 195 * 196 * @return not <code>null</code> 197 * @throws Exception 198 */ 199 Collection<NetworkConnectorViewMBean> getNetworkConnectors() 200 throws Exception; 201 202 203 /** 204 * The brokers network bridges. 205 * 206 * @return not <code>null</code> 207 * @throws Exception 208 */ 209 Collection<NetworkBridgeViewMBean> getNetworkBridges() 210 throws Exception; 211 212 /** 213 * Purges the given destination 214 * 215 * @param destination 216 * @throws Exception 217 */ 218 void purgeQueue(ActiveMQDestination destination) throws Exception; 219 /** 220 * Get the view of the queue with the specified name. 221 * 222 * @param name 223 * not <code>null</code> 224 * @return <code>null</code> if no queue with this name exists 225 * @throws Exception 226 */ 227 QueueViewMBean getQueue(String name) throws Exception; 228 /** 229 * Get the view of the topic with the specified name. 230 * 231 * @param name 232 * not <code>null</code> 233 * @return <code>null</code> if no topic with this name exists 234 * @throws Exception 235 */ 236 TopicViewMBean getTopic(String name) throws Exception; 237 238 /** 239 * Get the JobScheduler MBean 240 * @return the jobScheduler or null if not configured 241 * @throws Exception 242 */ 243 JobSchedulerViewMBean getJobScheduler() throws Exception; 244 245 /** 246 * Get the JobScheduler MBean 247 * @return the jobScheduler or null if not configured 248 * @throws Exception 249 */ 250 Collection<JobFacade> getScheduledJobs() throws Exception; 251 252 boolean isJobSchedulerStarted(); 253 254}