00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _ACTIVEMQ_COMMANDS_PRODUCERID_H_
00019 #define _ACTIVEMQ_COMMANDS_PRODUCERID_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/SessionId.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 using decaf::lang::Pointer;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 class AMQCPP_API ProducerId : public BaseDataStructure, public decaf::lang::Comparable<ProducerId> {
00049 protected:
00050
00051 std::string connectionId;
00052 long long value;
00053 long long sessionId;
00054
00055 public:
00056
00057 const static unsigned char ID_PRODUCERID = 123;
00058
00059 typedef decaf::lang::PointerComparator<ProducerId> COMPARATOR;
00060
00061 private:
00062
00063 mutable Pointer<SessionId> parentId;
00064
00065 public:
00066
00067 ProducerId();
00068
00069 ProducerId(const ProducerId& other);
00070
00071 ProducerId(const SessionId& sessionId, long long consumerId);
00072
00073 ProducerId(std::string producerId);
00074
00075 virtual ~ProducerId();
00076
00077 virtual unsigned char getDataStructureType() const;
00078
00079 virtual ProducerId* cloneDataStructure() const;
00080
00081 virtual void copyDataStructure(const DataStructure* src);
00082
00083 virtual std::string toString() const;
00084
00085 virtual bool equals(const DataStructure* value) const;
00086
00087 const Pointer<SessionId>& getParentId() const;
00088
00089 void setProducerSessionKey(std::string sessionKey);
00090
00091 virtual const std::string& getConnectionId() const;
00092 virtual std::string& getConnectionId();
00093 virtual void setConnectionId( const std::string& connectionId );
00094
00095 virtual long long getValue() const;
00096 virtual void setValue( long long value );
00097
00098 virtual long long getSessionId() const;
00099 virtual void setSessionId( long long sessionId );
00100
00101 virtual int compareTo(const ProducerId& value) const;
00102
00103 virtual bool equals(const ProducerId& value) const;
00104
00105 virtual bool operator==(const ProducerId& value) const;
00106
00107 virtual bool operator<(const ProducerId& value) const;
00108
00109 ProducerId& operator= (const ProducerId& other);
00110
00111 int getHashCode() const;
00112
00113 };
00114
00115 }}
00116
00117 #endif