1 /*------------------------------------------------------------------------------
 2 Name:      CbQueueProperty.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 Comment:   Holding callback queue properties
 6 Version:   $Id: CbQueueProperty.h 16685 2007-12-28 13:50:59Z ruff $
 7 ------------------------------------------------------------------------------*/
 8 
 9 /**
10  * Helper class holding callback queue properties.
11  * <p />
12  * See org::xmlBlaster::util::qos::ConnectQos for XML sysntax.
13  * @see org.xmlBlaster.client.qos.ConnectQos
14  */
15 
16 #ifndef _UTIL_QUEUE_CBQUEUEPROPERTY_H
17 #define _UTIL_QUEUE_CBQUEUEPROPERTY_H
18 
19 #include <util/xmlBlasterDef.h>
20 #include <util/Constants.h>
21 #include <util/qos/storage/QueuePropertyBase.h>
22 #include <util/qos/address/CallbackAddress.h>
23 
24 #include <string>
25 
26 
27 
28 
29 namespace org { namespace xmlBlaster { namespace util { namespace qos { namespace storage {
30 
31 class Dll_Export CbQueueProperty : public QueuePropertyBase
32 {
33 protected:
34 
35    /**
36     * @param relating  To what is this queue related: Constants.RELATING_CALLBACK | Constants.RELATING_SUBJECT
37     * @param nodeId    If not null, the command line properties will look for prop[nodeId] as well,
38     * e.g. -queue/maxEntries and -queue/maxEntries[heron] will be searched
39     */
40 public:
41    CbQueueProperty(org::xmlBlaster::util::Global& global, const std::string& relating, const std::string& nodeId);
42 
43    CbQueueProperty(const QueuePropertyBase& prop);
44 
45    CbQueueProperty& operator =(const QueuePropertyBase& prop);
46 
47    virtual ~CbQueueProperty();
48 
49    /**
50     * Show some important settings for logging
51     */
52    std::string getSettings();
53 
54    /**
55     * This method converts a std::string to lowercase. Note that the input std::string is
56     * modified and a reference to it is returned.
57     */
58    static std::string& toLowerCase(std::string& ref);
59 
60    /**
61     * @param relating    To what is this queue related: Constants.RELATING_CALLBACK | Constants.RELATING_SUBJECT
62     */
63    void setRelating(const std::string& relating);
64 
65    bool isSubjectRelated();
66 
67    bool isSessionRelated();
68 
69    bool onOverflowDeadMessage();
70 
71    /**
72     * Currently only one address is allowed, failover addresses will be implemented in a future version
73     */
74    void setCallbackAddress(const org::xmlBlaster::util::qos::address::AddressBaseRef& address);
75 
76    /**
77     */
78    void setCallbackAddresses(const AddressVector& addresses);
79 
80    /**
81     * @return array with size 0 if none available
82     */
83    AddressVector getCallbackAddresses();
84 
85    /**
86     * @return null if none available
87     */
88    org::xmlBlaster::util::qos::address::AddressBaseRef getCurrentCallbackAddress();
89 
90    /**
91     * Get a usage std::string for the connection parameters
92     */
93    static std::string usage();
94 };
95 
96 }}}}} // namespace
97 
98 #endif


syntax highlighted by Code2HTML, v. 0.9.1