KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > command > BrokerInfo


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.command;
19
20 import org.apache.activemq.state.CommandVisitor;
21 /**
22  * When a client connects to a broker, the broker send the client a BrokerInfo so that the client knows which broker
23  * node he's talking to and also any peers that the node has in his cluster. This is the broker helping the client out
24  * in discovering other nodes in the cluster.
25  *
26  * @openwire:marshaller code="2"
27  * @version $Revision: 1.7 $
28  */

29 public class BrokerInfo extends BaseCommand{
30     public static final byte DATA_STRUCTURE_TYPE=CommandTypes.BROKER_INFO;
31     BrokerId brokerId;
32     String JavaDoc brokerURL;
33     boolean slaveBroker;
34     boolean masterBroker;
35     boolean faultTolerantConfiguration;
36     boolean networkConnection;
37     boolean duplexConnection;
38     BrokerInfo peerBrokerInfos[];
39     String JavaDoc brokerName;
40     long connectionId;
41     String JavaDoc brokerUploadUrl;
42     String JavaDoc networkProperties;
43
44
45     public boolean isBrokerInfo(){
46         return true;
47     }
48
49     public byte getDataStructureType(){
50         return DATA_STRUCTURE_TYPE;
51     }
52
53     /**
54      * @openwire:property version=1 cache=true
55      */

56     public BrokerId getBrokerId(){
57         return brokerId;
58     }
59
60     public void setBrokerId(BrokerId brokerId){
61         this.brokerId=brokerId;
62     }
63
64     /**
65      * @openwire:property version=1
66      */

67     public String JavaDoc getBrokerURL(){
68         return brokerURL;
69     }
70
71     public void setBrokerURL(String JavaDoc brokerURL){
72         this.brokerURL=brokerURL;
73     }
74
75     /**
76      * @openwire:property version=1 testSize=0
77      */

78     public BrokerInfo[] getPeerBrokerInfos(){
79         return peerBrokerInfos;
80     }
81
82     public void setPeerBrokerInfos(BrokerInfo[] peerBrokerInfos){
83         this.peerBrokerInfos=peerBrokerInfos;
84     }
85
86     /**
87      * @openwire:property version=1
88      */

89     public String JavaDoc getBrokerName(){
90         return brokerName;
91     }
92
93     public void setBrokerName(String JavaDoc brokerName){
94         this.brokerName=brokerName;
95     }
96
97     public Response visit(CommandVisitor visitor) throws Exception JavaDoc{
98         return visitor.processBrokerInfo(this);
99     }
100
101     /**
102      * @openwire:property version=1
103      */

104     public boolean isSlaveBroker(){
105         return slaveBroker;
106     }
107
108     public void setSlaveBroker(boolean slaveBroker){
109         this.slaveBroker=slaveBroker;
110     }
111
112     /**
113      * @openwire:property version=1
114      */

115     public boolean isMasterBroker(){
116         return masterBroker;
117     }
118
119     /**
120      * @param masterBroker
121      * The masterBroker to set.
122      */

123     public void setMasterBroker(boolean masterBroker){
124         this.masterBroker=masterBroker;
125     }
126
127     /**
128      * @openwire:property version=1
129      * @return Returns the faultTolerantConfiguration.
130      */

131     public boolean isFaultTolerantConfiguration(){
132         return faultTolerantConfiguration;
133     }
134
135     /**
136      * @param faultTolerantConfiguration
137      * The faultTolerantConfiguration to set.
138      */

139     public void setFaultTolerantConfiguration(boolean faultTolerantConfiguration){
140         this.faultTolerantConfiguration=faultTolerantConfiguration;
141     }
142
143     
144     /**
145      * @openwire:property version=2
146      * @return the duplexConnection
147      */

148     public boolean isDuplexConnection(){
149         return this.duplexConnection;
150     }
151
152     
153     /**
154      * @param duplexConnection the duplexConnection to set
155      */

156     public void setDuplexConnection(boolean duplexConnection){
157         this.duplexConnection=duplexConnection;
158     }
159
160     
161     /**
162      * @openwire:property version=2
163      * @return the networkConnection
164      */

165     public boolean isNetworkConnection(){
166         return this.networkConnection;
167     }
168
169     
170     /**
171      * @param networkConnection the networkConnection to set
172      */

173     public void setNetworkConnection(boolean networkConnection){
174         this.networkConnection=networkConnection;
175     }
176
177     /**
178      * The broker assigns a each connection it accepts a connection id.
179      *
180      * @openwire:property version=2
181      */

182     public long getConnectionId() {
183         return connectionId;
184     }
185
186     public void setConnectionId(long connectionId) {
187         this.connectionId = connectionId;
188     }
189
190
191     /**
192      * The URL to use when uploading BLOBs to the broker or some other external file/http server
193      *
194      * @openwire:property version=3
195      */

196     public String JavaDoc getBrokerUploadUrl() {
197         return brokerUploadUrl;
198     }
199
200     public void setBrokerUploadUrl(String JavaDoc brokerUploadUrl) {
201         this.brokerUploadUrl = brokerUploadUrl;
202     }
203
204     
205     /**
206      * @openwire:property version=3 cache=false
207      * @return the networkProperties
208      */

209     public String JavaDoc getNetworkProperties(){
210         return this.networkProperties;
211     }
212
213     
214     /**
215      * @param networkProperties the networkProperties to set
216      */

217     public void setNetworkProperties(String JavaDoc networkProperties){
218         this.networkProperties=networkProperties;
219     }
220 }
221
Popular Tags