1 /*------------------------------------------------------------------------------
  2 Name:      ConnectQosFactory.h
  3 Project:   xmlBlaster.org
  4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
  5 Comment:   Factory for org::xmlBlaster::util::qos::ConnectQosData (for org::xmlBlaster::util::qos::ConnectReturnQos and org::xmlBlaster::util::qos::ConnectQos)
  6 ------------------------------------------------------------------------------*/
  7 #ifndef _UTIL_QOS_CONNECTQOSFACTORY_H
  8 #define _UTIL_QOS_CONNECTQOSFACTORY_H
  9 
 10 #include <util/xmlBlasterDef.h>
 11 #include <util/qos/ConnectQos.h>
 12 #include <authentication/SecurityQosFactory.h>
 13 
 14 /**
 15  * <qos>\n") +
 16  *    <securityService type='htpasswd' version='1.0'>
 17  *      <![CDATA[
 18  *      <user>joe</user>
 19  *      <passwd>secret</passwd>
 20  *      ]]>
 21  *    </securityService>
 22  *    <session name='/node/heron/client/joe/-9' timeout='3600000' maxSessions='10' clearSessions='false' sessionId='4e56890ghdFzj0'/>
 23  *    <ptp>true</ptp>
 24  *    <!-- The client side queue: -->
 25  *    <queue relating='client' type='CACHE' version='1.0' maxEntries='1000' maxBytes='4000' onOverflow='exception'>
 26  *       <address type='IOR' sessionId='4e56890ghdFzj0'>
 27  *          IOR:10000010033200000099000010....
 28  *       </address>
 29  *    </queue>
 30  *    <!-- The server side callback queue: -->
 31  *    <queue relating='callback' type='CACHE' version='1.0' maxEntries='1000' maxBytes='4000' onOverflow='deadMessage'>
 32  *       <callback type='IOR' sessionId='4e56890ghdFzj0'>
 33  *          IOR:10000010033200000099000010....
 34  *          <burstMode collectTime='400' />
 35  *       </callback>
 36  *    </queue>
 37  * </qos>
 38  */
 39 
 40 namespace org { namespace xmlBlaster { namespace util { namespace qos {
 41 
 42 class Dll_Export ConnectQosFactory: public org::xmlBlaster::util::parser::XmlHandlerBase
 43 {
 44 private:
 45    const std::string ME;
 46    org::xmlBlaster::util::qos::SessionQosFactory sessionQosFactory_;
 47    org::xmlBlaster::authentication::SecurityQosFactory securityQosFactory_;
 48    org::xmlBlaster::util::qos::storage::QueuePropertyFactory queuePropertyFactory_;
 49    org::xmlBlaster::util::qos::address::AddressFactory addressFactory_;
 50    std::string serverRefType_;
 51    std::string clientPropertyKey_;
 52 
 53    // helper flags for SAX parsing
 54    bool inSecurityService_;
 55    bool inServerRef_;
 56    bool inSession_;
 57    bool inRefreshSession_;
 58    bool inReconnected_;
 59    bool inInstanceId_;
 60    bool inIsPersistent_; // QosData
 61    bool inClientProperty_;
 62    bool inQos_;
 63 
 64    ClientProperty* clientProperty_;
 65 
 66    org::xmlBlaster::util::qos::ConnectQosDataRef connectQos_;
 67    /** when the current parsing point should be handled by another qos factory*/
 68    XmlHandlerBase* subFactory_;
 69 
 70    void prep();
 71 
 72 public:
 73    ConnectQosFactory(org::xmlBlaster::util::Global& global);
 74 
 75    ~ConnectQosFactory();
 76 
 77    /**
 78     * This characters emulates the java version but keep in mind that it is
 79     * not the virtual method inherited from DocumentHandler !!
 80     */
 81    void characters(const std::string &ch);
 82 
 83    /**
 84     * Start element, event from SAX parser.
 85     * <p />
 86     * @param name Tag name
 87     * @param attrs the attributes of the tag
 88     */
 89    void startElement(const std::string &name, const org::xmlBlaster::util::parser::AttributeMap& attrs);
 90 
 91    /**
 92     * End element, event from SAX parser.
 93     * <p />
 94     * @param name Tag name
 95     */
 96    void endElement(const std::string& name);
 97 
 98    org::xmlBlaster::util::qos::ConnectQosDataRef readObject(const std::string& qos);
 99 };
100 
101 }}}} // namespaces
102 
103 #endif


syntax highlighted by Code2HTML, v. 0.9.1