00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ACTIVEMQ_COMMANDS_SESSIONID_H_
00019 #define _ACTIVEMQ_COMMANDS_SESSIONID_H_
00020
00021
00022 #ifdef _MSC_VER
00023 #pragma warning( disable : 4290 )
00024 #endif
00025
00026 #include <activemq/commands/BaseDataStructure.h>
00027 #include <activemq/commands/ConnectionId.h>
00028 #include <activemq/util/Config.h>
00029 #include <decaf/lang/Comparable.h>
00030 #include <decaf/lang/Pointer.h>
00031 #include <string>
00032 #include <vector>
00033
00034 namespace activemq {
00035 namespace commands {
00036
00037 class ProducerId;
00038 class ConsumerId;
00039
00040 using decaf::lang::Pointer;
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 class AMQCPP_API SessionId : public BaseDataStructure, public decaf::lang::Comparable<SessionId> {
00052 protected:
00053
00054 std::string connectionId;
00055 long long value;
00056
00057 public:
00058
00059 const static unsigned char ID_SESSIONID = 121;
00060
00061 typedef decaf::lang::PointerComparator<SessionId> COMPARATOR;
00062
00063 private:
00064
00065 mutable Pointer<ConnectionId> parentId;
00066
00067 public:
00068
00069 SessionId();
00070
00071 SessionId(const SessionId& other);
00072
00073 SessionId(const ConnectionId* connectionId, long long sessionId);
00074
00075 SessionId(const ProducerId* producerId);
00076
00077 SessionId(const ConsumerId* consumerId);
00078
00079 virtual ~SessionId();
00080
00081 virtual unsigned char getDataStructureType() const;
00082
00083 virtual SessionId* cloneDataStructure() const;
00084
00085 virtual void copyDataStructure(const DataStructure* src);
00086
00087 virtual std::string toString() const;
00088
00089 virtual bool equals(const DataStructure* value) const;
00090
00091 const Pointer<ConnectionId>& getParentId() const;
00092
00093 virtual const std::string& getConnectionId() const;
00094 virtual std::string& getConnectionId();
00095 virtual void setConnectionId( const std::string& connectionId );
00096
00097 virtual long long getValue() const;
00098 virtual void setValue( long long value );
00099
00100 virtual int compareTo(const SessionId& value) const;
00101
00102 virtual bool equals(const SessionId& value) const;
00103
00104 virtual bool operator==(const SessionId& value) const;
00105
00106 virtual bool operator<(const SessionId& value) const;
00107
00108 SessionId& operator= (const SessionId& other);
00109
00110 int getHashCode() const;
00111
00112 };
00113
00114 }}
00115
00116 #endif