1 /*------------------------------------------------------------------------------
2 Name: ServerRef.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 Comment: Holding serverRef address std::string and protocol std::string to
6 access XmlBlaster
7 ------------------------------------------------------------------------------*/
8
9 /**
10 * Helper class holding serverRef address std::string and protocol std::string.
11 * <p />
12 * Holds example a CORBA "IOR:00012..." std::string
13 * @version $Revision: 1.8 $
14 * @author xmlBlaster@marcelruff.info
15 * @author laghi@swissinfo.org
16 */
17 #ifndef _UTIL_SERVERREF_H
18 #define _UTIL_SERVERREF_H
19
20 #include <util/XmlBCfg.h>
21 #include <string>
22
23 namespace org { namespace xmlBlaster { namespace util {
24
25 class Dll_Export ServerRef
26 {
27 private:
28 /** The unique address, e.g. the CORBA IOR std::string */
29 std::string address_;
30 /** The unique protocol type, e.g. "IOR" */
31 std::string type_;
32
33 public:
34
35 ServerRef(const ServerRef& serverRef);
36
37 ServerRef& operator =(const ServerRef& serverRef);
38
39 /**
40 * @param type The protocol type, e.g. "IOR", "EMAIL", "XMLRPC"
41 * @param address A serverRef address for your client, suitable to the protocol
42 * for email e.g. "xmlblaster@xmlBlaster.org"
43 */
44 ServerRef(const std::string& type, const std::string& address="");
45
46 /**
47 * Set the serverRef address, it should fit to the protocol-type.
48 *
49 * @param address The serverRef address, e.g. "et@mars.univers"
50 */
51 void setAddress(const std::string& address);
52
53 /**
54 * Returns the address.
55 * @return e.g. "IOR:00001100022...."
56 */
57 std::string getAddress() const;
58
59 /**
60 * Returns the protocol type.
61 * @return e.g. "SOCKET" or "IOR"
62 */
63 std::string getType() const;
64
65 /**
66 * Dump state of this object into a XML ASCII std::string.
67 */
68 std::string toXml() const;
69
70 /**
71 * Dump state of this object into a XML ASCII std::string.
72 * <br>
73 * @param extraOffset indenting of tags for nice output
74 * @return The xml representation
75 */
76 std::string toXml(const std::string& extraOffset) const;
77 };
78
79 }}} // namespaces
80
81 #endif
syntax highlighted by Code2HTML, v. 0.9.1