KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > broker > jmx > QueueViewMBean


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.broker.jmx;
19
20 import javax.management.openmbean.CompositeData JavaDoc;
21 import javax.management.openmbean.OpenDataException JavaDoc;
22
23
24 public interface QueueViewMBean extends DestinationViewMBean {
25     
26     /**
27      * Retrieve a message from the destination's queue.
28      *
29      * @param messageId
30      * the message id of the message to retrieve
31      * @return A CompositeData object which is a JMX version of the messages
32      * @throws OpenDataException
33      */

34     public CompositeData JavaDoc getMessage(String JavaDoc messageId) throws OpenDataException JavaDoc;
35     
36     /**
37      * Removes a message from the queue. If the message has already been
38      * dispatched to another consumer, the message cannot be deleted and this
39      * method will return false.
40      *
41      * @param messageId
42      * @return true if the message was found and could be successfully deleted.
43      * @throws Exception
44      */

45     public boolean removeMessage(String JavaDoc messageId) throws Exception JavaDoc;
46
47     /**
48      * Removes the messages matching the given selector
49      *
50      * @return the number of messages removed
51      */

52     public int removeMatchingMessages(String JavaDoc selector) throws Exception JavaDoc;
53
54     /**
55      * Removes the messages matching the given selector up to the maximum number of matched messages
56      *
57      * @return the number of messages removed
58      */

59     public int removeMatchingMessages(String JavaDoc selector, int maximumMessages) throws Exception JavaDoc;
60
61
62     /**
63      * Removes all of the messages in the queue.
64      * @throws Exception
65      */

66     public void purge() throws Exception JavaDoc;
67     
68     /**
69      * Copies a given message to another destination.
70      *
71      * @param messageId
72      * @param destinationName
73      * @return true if the message was found and was successfully copied to the
74      * other destination.
75      * @throws Exception
76      */

77     public boolean copyMessageTo(String JavaDoc messageId, String JavaDoc destinationName) throws Exception JavaDoc;
78
79     /**
80      * Copies the messages matching the given selector
81      *
82      * @return the number of messages copied
83      */

84     public int copyMatchingMessagesTo(String JavaDoc selector, String JavaDoc destinationName) throws Exception JavaDoc;
85
86     /**
87      * Copies the messages matching the given selector up to the maximum number of matched messages
88      *
89      * @return the number of messages copied
90      */

91     public int copyMatchingMessagesTo(String JavaDoc selector, String JavaDoc destinationName, int maximumMessages) throws Exception JavaDoc;
92
93     /**
94      * Moves the message to another destination.
95      *
96      * @param messageId
97      * @param destinationName
98      * @return true if the message was found and was successfully copied to the
99      * other destination.
100      * @throws Exception
101      */

102     public boolean moveMessageTo(String JavaDoc messageId, String JavaDoc destinationName) throws Exception JavaDoc;
103
104     /**
105      * Moves the messages matching the given selector
106      *
107      * @return the number of messages removed
108      */

109     public int moveMatchingMessagesTo(String JavaDoc selector, String JavaDoc destinationName) throws Exception JavaDoc;
110     
111     /**
112      * Moves the messages matching the given selector up to the maximum number of matched messages
113      */

114     public int moveMatchingMessagesTo(String JavaDoc selector, String JavaDoc destinationName, int maximumMessages) throws Exception JavaDoc;
115
116 }
117
Popular Tags