KickJava   Java API By Example, From Geeks To Geeks.

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


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
23 /**
24  *
25  * @openwire:marshaller code="3"
26  * @version $Revision: 1.11 $
27  */

28 public class ConnectionInfo extends BaseCommand {
29     
30     public static final byte DATA_STRUCTURE_TYPE=CommandTypes.CONNECTION_INFO;
31     
32     protected ConnectionId connectionId;
33     protected String JavaDoc clientId;
34     protected String JavaDoc userName;
35     protected String JavaDoc password;
36     protected BrokerId[] brokerPath;
37     protected boolean brokerMasterConnector;
38     protected boolean manageable;
39     protected boolean clientMaster;
40     protected transient Object JavaDoc transportContext;
41     
42     public ConnectionInfo() {
43     }
44     public ConnectionInfo(ConnectionId connectionId) {
45         this.connectionId=connectionId;
46     }
47     
48     public byte getDataStructureType() {
49         return DATA_STRUCTURE_TYPE;
50     }
51     
52     public void copy(ConnectionInfo copy) {
53         super.copy(copy);
54         copy.clientId = clientId;
55         copy.userName = userName;
56         copy.password = password;
57         copy.brokerPath = brokerPath;
58         copy.brokerMasterConnector = brokerMasterConnector;
59         copy.manageable = manageable;
60     }
61
62     /**
63      * @openwire:property version=1 cache=true
64      */

65     public ConnectionId getConnectionId() {
66         return connectionId;
67     }
68     public void setConnectionId(ConnectionId connectionId) {
69         this.connectionId = connectionId;
70     }
71     
72     /**
73      * @openwire:property version=1
74      */

75     public String JavaDoc getClientId() {
76         return clientId;
77     }
78     public void setClientId(String JavaDoc clientId) {
79         this.clientId = clientId;
80     }
81     
82     public RemoveInfo createRemoveCommand() {
83         RemoveInfo command = new RemoveInfo(getConnectionId());
84         command.setResponseRequired(isResponseRequired());
85         return command;
86     }
87
88     /**
89      * @openwire:property version=1
90      */

91     public String JavaDoc getPassword() {
92         return password;
93     }
94     public void setPassword(String JavaDoc password) {
95         this.password = password;
96     }
97
98     /**
99      * @openwire:property version=1
100      */

101     public String JavaDoc getUserName() {
102         return userName;
103     }
104     public void setUserName(String JavaDoc userName) {
105         this.userName = userName;
106     }
107
108     /**
109      * The route of brokers the command has moved through.
110      *
111      * @openwire:property version=1 cache=true
112      */

113     public BrokerId[] getBrokerPath() {
114         return brokerPath;
115     }
116     public void setBrokerPath(BrokerId[] brokerPath) {
117         this.brokerPath = brokerPath;
118     }
119     
120     public Response visit(CommandVisitor visitor) throws Exception JavaDoc {
121         return visitor.processAddConnection( this );
122     }
123     /**
124      * @openwire:property version=1
125      */

126     public boolean isBrokerMasterConnector(){
127         return brokerMasterConnector;
128     }
129     /**
130      * @param brokerMasterConnector The brokerMasterConnector to set.
131      */

132     public void setBrokerMasterConnector(boolean slaveBroker){
133         this.brokerMasterConnector=slaveBroker;
134     }
135     /**
136      * @openwire:property version=1
137      */

138     public boolean isManageable(){
139         return manageable;
140     }
141     /**
142      * @param manageable The manageable to set.
143      */

144     public void setManageable(boolean manageable){
145         this.manageable=manageable;
146     }
147     
148     /**
149      * Transports may wish to associate additional data with the connection. For
150      * example, an SSL transport may use this field to attach the client certificates
151      * used when the conection was established.
152      *
153      * @return the transport context.
154      */

155     public Object JavaDoc getTransportContext() {
156         return transportContext;
157     }
158     
159     /**
160      * Transports may wish to associate additional data with the connection. For
161      * example, an SSL transport may use this field to attach the client certificates
162      * used when the conection was established.
163      *
164      * @param transportContext value used to set the transport context
165      */

166     public void setTransportContext(Object JavaDoc transportContext) {
167         this.transportContext = transportContext;
168     }
169     
170     /**
171      * @openwire:property version=2
172      * @return the clientMaster
173      */

174     public boolean isClientMaster(){
175         return this.clientMaster;
176     }
177     
178     /**
179      * @param clientMaster the clientMaster to set
180      */

181     public void setClientMaster(boolean clientMaster){
182         this.clientMaster=clientMaster;
183     }
184
185 }
186
Popular Tags