00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ACTIVEMQ_COMMANDS_CONNECTIONINFO_H_
00019 #define _ACTIVEMQ_COMMANDS_CONNECTIONINFO_H_
00020
00021
00022 #ifdef _MSC_VER
00023 #pragma warning( disable : 4290 )
00024 #endif
00025
00026 #include <activemq/commands/BaseCommand.h>
00027 #include <activemq/commands/BrokerId.h>
00028 #include <activemq/commands/ConnectionId.h>
00029 #include <activemq/commands/RemoveInfo.h>
00030 #include <activemq/util/Config.h>
00031 #include <decaf/lang/Pointer.h>
00032 #include <string>
00033 #include <vector>
00034
00035 namespace activemq {
00036 namespace commands {
00037
00038 using decaf::lang::Pointer;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class AMQCPP_API ConnectionInfo : public BaseCommand {
00050 protected:
00051
00052 Pointer<ConnectionId> connectionId;
00053 std::string clientId;
00054 std::string password;
00055 std::string userName;
00056 std::vector< decaf::lang::Pointer<BrokerId> > brokerPath;
00057 bool brokerMasterConnector;
00058 bool manageable;
00059 bool clientMaster;
00060 bool faultTolerant;
00061 bool failoverReconnect;
00062 std::string clientIp;
00063
00064 public:
00065
00066 const static unsigned char ID_CONNECTIONINFO = 3;
00067
00068 private:
00069
00070 ConnectionInfo(const ConnectionInfo&);
00071 ConnectionInfo& operator= (const ConnectionInfo&);
00072
00073 public:
00074
00075 ConnectionInfo();
00076
00077 virtual ~ConnectionInfo();
00078
00079 virtual unsigned char getDataStructureType() const;
00080
00081 virtual ConnectionInfo* cloneDataStructure() const;
00082
00083 virtual void copyDataStructure(const DataStructure* src);
00084
00085 virtual std::string toString() const;
00086
00087 virtual bool equals(const DataStructure* value) const;
00088
00089 Pointer<RemoveInfo> createRemoveCommand() const;
00090
00091 virtual const Pointer<ConnectionId>& getConnectionId() const;
00092 virtual Pointer<ConnectionId>& getConnectionId();
00093 virtual void setConnectionId( const Pointer<ConnectionId>& connectionId );
00094
00095 virtual const std::string& getClientId() const;
00096 virtual std::string& getClientId();
00097 virtual void setClientId( const std::string& clientId );
00098
00099 virtual const std::string& getPassword() const;
00100 virtual std::string& getPassword();
00101 virtual void setPassword( const std::string& password );
00102
00103 virtual const std::string& getUserName() const;
00104 virtual std::string& getUserName();
00105 virtual void setUserName( const std::string& userName );
00106
00107 virtual const std::vector< decaf::lang::Pointer<BrokerId> >& getBrokerPath() const;
00108 virtual std::vector< decaf::lang::Pointer<BrokerId> >& getBrokerPath();
00109 virtual void setBrokerPath( const std::vector< decaf::lang::Pointer<BrokerId> >& brokerPath );
00110
00111 virtual bool isBrokerMasterConnector() const;
00112 virtual void setBrokerMasterConnector( bool brokerMasterConnector );
00113
00114 virtual bool isManageable() const;
00115 virtual void setManageable( bool manageable );
00116
00117 virtual bool isClientMaster() const;
00118 virtual void setClientMaster( bool clientMaster );
00119
00120 virtual bool isFaultTolerant() const;
00121 virtual void setFaultTolerant( bool faultTolerant );
00122
00123 virtual bool isFailoverReconnect() const;
00124 virtual void setFailoverReconnect( bool failoverReconnect );
00125
00126 virtual const std::string& getClientIp() const;
00127 virtual std::string& getClientIp();
00128 virtual void setClientIp( const std::string& clientIp );
00129
00133 virtual bool isConnectionInfo() const {
00134 return true;
00135 }
00136
00137 virtual Pointer<Command> visit(activemq::state::CommandVisitor* visitor);
00138
00139 };
00140
00141 }}
00142
00143 #endif