semaine::cms::sender::XMLSender Class Reference

#include <XMLSender.h>

Inheritance diagram for semaine::cms::sender::XMLSender:
semaine::cms::sender::Sender semaine::cms::IOBase semaine::cms::sender::BMLSender semaine::cms::sender::EmmaSender semaine::cms::sender::FMLSender semaine::cms::sender::StateSender

List of all members.

Public Member Functions

 XMLSender (const std::string &topicName, const std::string &datatype, const std::string &source) throw (CMSException, SystemConfigurationException)
 XMLSender (const std::string &cmsUrl, const std::string &cmsUser, const std::string &cmsPassword, const std::string &topicName, const std::string &datatype, const std::string &source) throw (CMSException, SystemConfigurationException)
virtual ~XMLSender ()
void sendXML (const XERCES_CPP_NAMESPACE::DOMDocument *document, long long usertime, const std::string &event=SEMAINE_CMS_EVENT_SINGLE, const std::string &contentID="", long long contentCreationTime=-1, const std::string &contentType="") throw (CMSException, SystemConfigurationException)

Protected Member Functions

virtual void fillMessageProperties (Message *message, long long usertime) throw (CMSException)

Constructor & Destructor Documentation

semaine::cms::sender::XMLSender::XMLSender ( const std::string &  topicName,
const std::string &  datatype,
const std::string &  source 
) throw (CMSException, SystemConfigurationException)

Create a new Sender to the given topic on the default JMS server. The default JMS server is determined as follows:

  • jms URL: default value tcp://localhost:61616;
  • jms User: default value empty;
  • jms Password: default value empty.

Datatype and source will be sent with every message.

Parameters:
topic the name of the topic to send to.
datatype the name of the type of data being sent.
source the name of the component sending the data.
Exceptions:
CMSException 
semaine::cms::sender::XMLSender::XMLSender ( const std::string &  cmsUrl,
const std::string &  cmsUser,
const std::string &  cmsPassword,
const std::string &  topicName,
const std::string &  datatype,
const std::string &  source 
) throw (CMSException, SystemConfigurationException)

Create a new CMS IOBase connection with the given topic on the given JMS server.

Parameters:
cmsUrl the url where to contact the JMS server
cmsUser the username to use (can be an empty string)
cmsPassword the password to use (can be an empty string)
topicName the name of the topic to send to.
datatype the name of the type of data being sent.
source the name of the component sending the data.
Exceptions:
CMSException 
semaine::cms::sender::XMLSender::~XMLSender (  )  [virtual]

Member Function Documentation

void semaine::cms::sender::XMLSender::fillMessageProperties ( Message *  message,
long long  usertime 
) throw (CMSException) [protected, virtual]

Fill in the usual message properties as far as possible. Subclasses are encouraged to override this method, but should normally call this method as well (as super.fillMessageProperties(message, usertime)).

Parameters:
a pointer to a message object in preparation for sending.
usertime the "user" time that this message refers to, in milliseconds since system startup.

Reimplemented from semaine::cms::sender::Sender.

void semaine::cms::sender::XMLSender::sendXML ( const XERCES_CPP_NAMESPACE::DOMDocument *  document,
long long  usertime,
const std::string &  event = SEMAINE_CMS_EVENT_SINGLE,
const std::string &  contentID = "",
long long  contentCreationTime = -1,
const std::string &  contentType = "" 
) throw (CMSException, SystemConfigurationException)

Send an XML message via this sender, for event-based messages. This will send a message to the registered topic with the following message properties:

  • datatype is a String property containing the value produced by getDatatype();
  • source is a String property containing the value produced by getSource();
  • usertime is a long property containing the value of parameter usertime;
  • event is a String property containing the String representation of the event parameter to this method.

Furthermore, if getTimeToLive() returns a non-zero value, the message will contain a header field JMSExpiration containing the time when the message will expire.

Parameters:
text the message text.
usertime the "user" time at which this message is being sent, in milliseconds since system startup.
event the type of event represented by this message.
contentID a unique identifier for the message's content. If this is not the empty string, it will cause the addition of the String property content-id in the message.
contentCreationTime the time when the content in this message was created. If this is not negative, it will cause the addition of the Long property content-creation-time in the message.
contentType an optional content type for the message's content; The value may be one of SEMAINEMessage::CONTENT_TYPE_UTTERANCE, SEMAINEMessage::CONTENT_TYPE_LISTENERVOCALISATION, SEMAINEMessage::CONTENT_TYPE_VISUALONLY, or any other string. If this is not the empty string, it will cause the addition of the String property content-type in the message.
Exceptions:
SystemConfigurationException if the connection is not started or the sender is in periodic mode.

The documentation for this class was generated from the following files:
Generated on Tue Dec 14 17:13:18 2010 for SEMAINE by  doxygen 1.6.3