1 /*------------------------------------------------------------------------------
 2 Name:      Address.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 Comment:   Holding address std::string and protocol std::string
 6 Version:   $Id: Address.h 12937 2004-11-24 20:15:11Z ruff $
 7 ------------------------------------------------------------------------------*/
 8 
 9 /**
10  * Helper class holding address std::string, protocol std::string and client side connection properties.
11  * <p />
12  * <pre>
13  * &lt;address type='XMLRPC' sessionId='4e56890ghdFzj0'
14  *           pingInterval='60000' retries='5' delay='10000'
15  *           oneway='false'>
16  *    http://server:8080/cb
17  *    &lt;compress type='gzip' minSize='1000'/>
18  *    &lt;burstMode collectTime='400'/> <!-- for publishOneway() calls -->
19  * &lt;/address>
20  * </pre>
21  */
22 #ifndef _UTIL_CFG_ADDRESS_H
23 #define _UTIL_CFG_ADDRESS_H
24 
25 #include <util/qos/address/AddressBase.h>
26 
27 namespace org { namespace xmlBlaster { namespace util { namespace qos { namespace address {
28 
29 class Dll_Export Address : public AddressBase
30 {
31 private:
32 
33    /**
34     * Configure property settings. 
35     * "-delay[heron] 20" has precedence over "-delay 10"
36     * @see #Address(String, String)
37     */
38    inline void initialize();
39 
40 public:
41 
42    /**
43     * @param type    The protocol type, e.g. "IOR", "SOCKET", "XMLRPC"
44     * @param nodeId  A unique std::string (typically the cluster node id we connect to).<br />
45     *   This is used for extended env-variable support, e.g. for a given
46     *    <code>nodeId="heron"</ code>
47     *   the command line argument (or xmlBlaster.property entry)
48     *    <code>-retries[heron] 20</code>
49     *   is precedence over
50     *    <code>-retries 10</code>
51     */
52    Address(org::xmlBlaster::util::Global& global, const std::string& type="", const std::string& nodeId="");
53 
54    /**
55     * copy constructor
56     */
57    Address(const AddressBase& addr);
58 
59    /**
60     * Assignment operator. Note that both assignment operator and copy
61     * constructor are taking an AddressBase as argument. This because Address
62     * is only a decorator to AddressBase, i.e. it does not provide any new
63     * member, it only has different accessors.
64     */
65    Address& operator =(const AddressBase& addr);
66 
67    void setMaxEntries(long maxEntries);
68 
69    long getMaxEntries() const;
70 
71    /** For logging only */
72    std::string getSettings();
73 
74    /** @return The literal address as given by getRawAddress() */
75    std::string toString();
76 
77    /**
78     * Get a usage std::string for the connection parameters
79     */
80    std::string usage();
81 
82 };
83 
84 }}}}} // namespace
85 
86 #endif


syntax highlighted by Code2HTML, v. 0.9.1