ManagedBroker.java
01 /*
02  *
03  * Licensed to the Apache Software Foundation (ASF) under one
04  * or more contributor license agreements.  See the NOTICE file
05  * distributed with this work for additional information
06  * regarding copyright ownership.  The ASF licenses this file
07  * to you under the Apache License, Version 2.0 (the
08  * "License"); you may not use this file except in compliance
09  * with the License.  You may obtain a copy of the License at
10  
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  */
21 
22 package org.apache.qpid.server.management;
23 
24 import java.io.IOException;
25 
26 import javax.management.JMException;
27 import javax.management.MBeanOperationInfo;
28 
29 import org.apache.qpid.server.exchange.ManagedExchange;
30 import org.apache.qpid.server.queue.ManagedQueue;
31 
32 /**
33  * The ManagedBroker is the management interface to expose management
34  * features of the Broker.
35  *
36  @author   Bhupendra Bhardwaj
37  @version  0.1
38  */
39 public interface ManagedBroker
40 {
41     static final String TYPE = "VirtualHostManager";
42 
43     /**
44      * Creates a new Exchange.
45      @param name
46      @param type
47      @param durable
48      @param passive
49      @throws IOException
50      @throws JMException
51      */
52     @MBeanOperation(name="createNewExchange", description="Creates a new Exchange", impact= MBeanOperationInfo.ACTION)
53     void createNewExchange(@MBeanOperationParameter(name="name", description="Name of the new exchange")String name,
54                            @MBeanOperationParameter(name="ExchangeType", description="Type of the exchange")String type,
55                            @MBeanOperationParameter(name="durable", description="true if the Exchang should be durable")boolean durable)
56         throws IOException, JMException;
57 
58     /**
59      * unregisters all the channels, queuebindings etc and unregisters
60      * this exchange from managed objects.
61      @param exchange
62      @throws IOException
63      @throws JMException
64      */
65     @MBeanOperation(name="unregisterExchange",
66                     description="Unregisters all the related channels and queuebindings of this exchange",
67                     impact= MBeanOperationInfo.ACTION)
68     void unregisterExchange(@MBeanOperationParameter(name= ManagedExchange.TYPE, description="Exchange Name")String exchange)
69         throws IOException, JMException;
70 
71     /**
72      * Create a new Queue on the Broker server
73      @param queueName
74      @param durable
75      @param owner
76      @param autoDelete
77      @throws IOException
78      @throws JMException
79      */
80     @MBeanOperation(name="createNewQueue", description="Create a new Queue on the Broker server", impact= MBeanOperationInfo.ACTION)
81     void createNewQueue(@MBeanOperationParameter(name="queue name", description="Name of the new queue")String queueName,
82                         @MBeanOperationParameter(name="owner", description="Owner name")String owner,
83                         @MBeanOperationParameter(name="durable", description="true if the queue should be durable")boolean durable)
84         throws IOException, JMException;
85 
86     /**
87      * Unregisters the Queue bindings, removes the subscriptions and unregisters
88      * from the managed objects.
89      @param queueName
90      @throws IOException
91      @throws JMException
92      */
93     @MBeanOperation(name="deleteQueue",
94                          description="Unregisters the Queue bindings, removes the subscriptions and deletes the queue",
95                          impact= MBeanOperationInfo.ACTION)
96     void deleteQueue(@MBeanOperationParameter(name= ManagedQueue.TYPE, description="Queue Name")String queueName)
97         throws IOException, JMException;
98 }