1 18 package org.apache.activemq.command; 19 20 import org.apache.activemq.state.CommandVisitor; 21 22 23 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 clientId; 34 protected String userName; 35 protected String password; 36 protected BrokerId[] brokerPath; 37 protected boolean brokerMasterConnector; 38 protected boolean manageable; 39 protected boolean clientMaster; 40 protected transient Object 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 65 public ConnectionId getConnectionId() { 66 return connectionId; 67 } 68 public void setConnectionId(ConnectionId connectionId) { 69 this.connectionId = connectionId; 70 } 71 72 75 public String getClientId() { 76 return clientId; 77 } 78 public void setClientId(String 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 91 public String getPassword() { 92 return password; 93 } 94 public void setPassword(String password) { 95 this.password = password; 96 } 97 98 101 public String getUserName() { 102 return userName; 103 } 104 public void setUserName(String userName) { 105 this.userName = userName; 106 } 107 108 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 { 121 return visitor.processAddConnection( this ); 122 } 123 126 public boolean isBrokerMasterConnector(){ 127 return brokerMasterConnector; 128 } 129 132 public void setBrokerMasterConnector(boolean slaveBroker){ 133 this.brokerMasterConnector=slaveBroker; 134 } 135 138 public boolean isManageable(){ 139 return manageable; 140 } 141 144 public void setManageable(boolean manageable){ 145 this.manageable=manageable; 146 } 147 148 155 public Object getTransportContext() { 156 return transportContext; 157 } 158 159 166 public void setTransportContext(Object transportContext) { 167 this.transportContext = transportContext; 168 } 169 170 174 public boolean isClientMaster(){ 175 return this.clientMaster; 176 } 177 178 181 public void setClientMaster(boolean clientMaster){ 182 this.clientMaster=clientMaster; 183 } 184 185 } 186 | Popular Tags |