XmlBlasterAccessUnparsed Struct Reference

All client access to xmlBlaster goes over this struct and its function pointers. More...

#include <XmlBlasterAccessUnparsed.h>

Collaboration diagram for XmlBlasterAccessUnparsed:

Collaboration graph
[legend]

Data Fields

int argc
 The number of argv entries.
const char *const * argv
 Environment configuration, usually from the command line.
Propertiesprops
 Further configuration parameters.
void * userObject
 A client can use this pointer to point to any client specific information.
XmlBlasterAccessGenericFp userFp
 A client can use this function pointer to do any client specific handling.
XmlBlasterAccessUnparsedConnect connect
 Connect to the server.
XmlBlasterAccessUnparsedInitialize initialize
 Creates client side connection object and the callback server and does the low level IP connection.
XmlBlasterAccessUnparsedDisconnect disconnect
 Disconnect from server.
XmlBlasterAccessUnparsedPublish publish
 Publish a message.
XmlBlasterAccessUnparsedPublishArr publishArr
 Publish an array of messages.
XmlBlasterAccessUnparsedPublishOneway publishOneway
 Publish oneway an array of messages.
XmlBlasterAccessUnparsedSubscribe subscribe
 Subscribe to messages.
XmlBlasterAccessUnparsedUnSubscribe unSubscribe
XmlBlasterAccessUnparsedErase erase
XmlBlasterAccessUnparsedGet get
XmlBlasterAccessUnparsedPing ping
XmlBlasterAccessUnparsedIsConnected isConnected
 Check if we are connected to xmlBlaster.
XMLBLASTER_LOG_LEVEL logLevel
XmlBlasterLogging log
void * logUserP
 For outside users to pass a user object back to the logging implementation.
XmlBlasterConnectionUnparsedconnectionP
CallbackServerUnparsedcallbackP
int isInitialized
int isShutdown
UpdateFp clientsUpdateFp
 Here we asynchronously receive the callback from xmlBlaster.
int callbackMultiThreaded
 Shall update messages be transported to the client code in a thread per request?
int lowLevelAutoAck
long responseTimeout
pthread_t callbackThreadId
char threadCounter
pthread_mutex_t writenMutex
 Protect writing n bytes to the socket.
pthread_mutex_t readnMutex
 Protect reading n bytes from the socket.

Detailed Description

All client access to xmlBlaster goes over this struct and its function pointers.

All function pointers expect a 'this' pointer of type XmlBlasterAccessUnparsed and return XmlBlasterException::errorCode="communication.noConnection" if connection to xmlBlaster is lost.

Create an instance of XmlBlasterAccessUnparsed with a call to getXmlBlasterAccessUnparsed() and you are ready to access xmlBlaster. Don't forget to free everything when you don't need xmlBlaster access anymore with a call to freeXmlBlasterAccessUnparsed()

See HelloWorld3.c for a complete usage example.

See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.c.socket.html

http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html

Definition at line 116 of file XmlBlasterAccessUnparsed.h.


Field Documentation

int XmlBlasterAccessUnparsed::argc

The number of argv entries.

Definition at line 118 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsedUnmanaged(), freeXmlBlasterAccessUnparsedUnmanagedCE(), getXmlBlasterAccessUnparsed(), and initialize().

const char* const* XmlBlasterAccessUnparsed::argv

Environment configuration, usually from the command line.

Definition at line 119 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsedUnmanaged(), freeXmlBlasterAccessUnparsedUnmanagedCE(), getXmlBlasterAccessUnparsed(), and initialize().

Properties* XmlBlasterAccessUnparsed::props

Further configuration parameters.

Definition at line 120 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), and main().

void* XmlBlasterAccessUnparsed::userObject

A client can use this pointer to point to any client specific information.

Definition at line 121 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed().

XmlBlasterAccessGenericFp XmlBlasterAccessUnparsed::userFp

A client can use this function pointer to do any client specific handling.

Definition at line 122 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), interceptUpdate(), xmlBlasterUnmanagedCEConnect(), xmlBlasterUnmanagedCEInitialize(), xmlBlasterUnmanagedConnect(), and xmlBlasterUnmanagedInitialize().

XmlBlasterAccessUnparsedConnect XmlBlasterAccessUnparsed::connect

Connect to the server.

Parameters:
xa The 'this' pointer
qos The QoS xml markup string to connect, typically
 <qos>
  <securityService type='htpasswd' version='1.0'>
    <user>fritz</user>
    <passwd>secret</passwd>
  </securityService>
 <queue relating='callback' maxEntries='100' maxEntriesCache='100'>
   <callback type='SOCKET' sessionId='s'>
     socket://myServer.myCompany.com:6645
   </callback>
 </queue>
 </qos>
 
clientUpdateFp The clients callback function pointer UpdateFp, if NULL our default handler is used Is ignored if set by initialize already.
The exception struct, exception->errorCode is filled on exception
Returns:
The ConnectReturnQos raw xml string, you need to free() it
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.connect.html

Definition at line 146 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEConnect(), and xmlBlasterUnmanagedConnect().

XmlBlasterAccessUnparsedInitialize XmlBlasterAccessUnparsed::initialize

Creates client side connection object and the callback server and does the low level IP connection.

This method is automatically called by connect() so you usually only call it explicitly if you are interested in the callback server settings.

Parameters:
xa The 'this' pointer
clientUpdateFp The clients callback handler function UpdateFp. If NULL our default handler is used
Returns:
true on success

Definition at line 155 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEInitialize(), and xmlBlasterUnmanagedInitialize().

XmlBlasterAccessUnparsedDisconnect XmlBlasterAccessUnparsed::disconnect

Disconnect from server.

Parameters:
xa The 'this' pointer
qos The QoS xml markup string to disconnect
The exception struct, exception->errorCode is filled on exception
Returns:
false on exception
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html

Definition at line 164 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), myUpdate(), xmlBlasterUnmanagedCEDisconnect(), and xmlBlasterUnmanagedDisconnect().

XmlBlasterAccessUnparsedPublish XmlBlasterAccessUnparsed::publish

Publish a message.

Parameters:
xa The 'this' pointer to simulate C++ classes
msgUnit The message of type MsgUnit you want to send.
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr.
Returns:
The QoS string with the response from xmlBlaster. You have to free it with a call to xmlBlasterFree. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it.
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html

Definition at line 176 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), myUpdate(), xmlBlasterUnmanagedCEPublish(), and xmlBlasterUnmanagedPublish().

XmlBlasterAccessUnparsedPublishArr XmlBlasterAccessUnparsed::publishArr

Publish an array of messages.

Parameters:
xa The 'this' pointer to simulate C++ classes
msgUnitArr The messages of type MsgUnitArr you want to send.
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr.
Returns:
The QosArr struct with the response from xmlBlaster. You have to free it with a call to freeQosArr. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it.
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html

Definition at line 188 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEPublishArr(), and xmlBlasterUnmanagedPublishArr().

XmlBlasterAccessUnparsedPublishOneway XmlBlasterAccessUnparsed::publishOneway

Publish oneway an array of messages.

Oneway messages don't return something, the server does not acknowledge (ACK) them.

Parameters:
xa The 'this' pointer to simulate C++ classes
msgUnitArr The messages of type MsgUnitArr you want to send.
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr.
Returns:
The QosArr struct with the response from xmlBlaster. You have to free it with a call to freeQosArr. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it.
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html

Definition at line 202 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEPublishOneway(), and xmlBlasterUnmanagedPublishOneway().

XmlBlasterAccessUnparsedSubscribe XmlBlasterAccessUnparsed::subscribe

Subscribe to messages.

Parameters:
xa The 'this' pointer to simulate C++ classes
key The key xml string
qos The QoS xml string
xmlBlasterException If *xmlBlasterException.errorCode!=0 this XmlBlasterException is filled with the exception details and you should ignore the returned QosArr.
Returns:
The QoS string with the response from xmlBlaster. You have to free it with a call to xmlBlasterFree. If *xmlBlasterException.errorCode!=0 you need to ignore the returned data and don't need to free it.
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.subscribe.html

Definition at line 215 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCESubscribe(), and xmlBlasterUnmanagedSubscribe().

XmlBlasterAccessUnparsedUnSubscribe XmlBlasterAccessUnparsed::unSubscribe

Definition at line 216 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEUnSubscribe(), and xmlBlasterUnmanagedUnSubscribe().

XmlBlasterAccessUnparsedErase XmlBlasterAccessUnparsed::erase

Definition at line 217 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEErase(), and xmlBlasterUnmanagedErase().

XmlBlasterAccessUnparsedGet XmlBlasterAccessUnparsed::get

Definition at line 218 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEGet(), and xmlBlasterUnmanagedGet().

XmlBlasterAccessUnparsedPing XmlBlasterAccessUnparsed::ping

Definition at line 219 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), main(), xmlBlasterUnmanagedCEPing(), and xmlBlasterUnmanagedPing().

XmlBlasterAccessUnparsedIsConnected XmlBlasterAccessUnparsed::isConnected

Check if we are connected to xmlBlaster.

Parameters:
xa The 'this' pointer
Returns:
bool true or false

Definition at line 225 of file XmlBlasterAccessUnparsed.h.

Referenced by checkArgs(), getXmlBlasterAccessUnparsed(), xmlBlasterUnmanagedCEIsConnected(), and xmlBlasterUnmanagedIsConnected().

XMLBLASTER_LOG_LEVEL XmlBlasterAccessUnparsed::logLevel

Definition at line 226 of file XmlBlasterAccessUnparsed.h.

Referenced by callbackProgressListener(), checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), mutexUnlock(), postSendEvent(), preSendEvent(), readnCompressed(), readnPlain(), responseEvent(), runUpdate(), writenCompressed(), writenPlain(), and xmlBlasterConnect().

XmlBlasterLogging XmlBlasterAccessUnparsed::log

Definition at line 227 of file XmlBlasterAccessUnparsed.h.

Referenced by callbackProgressListener(), checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), main(), mutexUnlock(), myUpdate(), postSendEvent(), preSendEvent(), readnCompressed(), readnPlain(), responseEvent(), runUpdate(), writenCompressed(), writenPlain(), xmlBlasterConnect(), and xmlBlasterUnmanagedCERegisterLogger().

void* XmlBlasterAccessUnparsed::logUserP

For outside users to pass a user object back to the logging implementation.

Definition at line 228 of file XmlBlasterAccessUnparsed.h.

Referenced by callbackProgressListener(), checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), main(), mutexUnlock(), myUpdate(), postSendEvent(), preSendEvent(), readnCompressed(), readnPlain(), responseEvent(), runUpdate(), writenCompressed(), writenPlain(), xmlBlasterConnect(), and xmlBlasterUnmanagedCERegisterLogger().

XmlBlasterConnectionUnparsed* XmlBlasterAccessUnparsed::connectionP

Definition at line 230 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), isConnected(), readnCompressed(), writenCompressed(), xmlBlasterConnect(), xmlBlasterDisconnect(), xmlBlasterErase(), xmlBlasterGet(), xmlBlasterPing(), xmlBlasterPublish(), xmlBlasterPublishArr(), xmlBlasterPublishOneway(), xmlBlasterSubscribe(), and xmlBlasterUnSubscribe().

CallbackServerUnparsed* XmlBlasterAccessUnparsed::callbackP

Definition at line 231 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), initialize(), main(), postSendEvent(), preSendEvent(), xmlBlasterConnect(), and xmlBlasterUnmanagedCERegisterProgressListener().

int XmlBlasterAccessUnparsed::isInitialized

Definition at line 232 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), and initialize().

int XmlBlasterAccessUnparsed::isShutdown

Definition at line 233 of file XmlBlasterAccessUnparsed.h.

Referenced by checkArgs(), freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), and isConnected().

UpdateFp XmlBlasterAccessUnparsed::clientsUpdateFp

Here we asynchronously receive the callback from xmlBlaster.

NOTE: After this call the memory of MsgUnitArr is freed immediately by CallbackServerUnparsed. So you need to take a copy of all message members if needed out of the scope of this function.

Parameters:
msgUnitArr The messages of type MsgUnitArr from the server, use MsgUnit::responseQos to transport the return value. If responseQos is not NULL it will be free()'d as well by us.
userData An optional pointer from the client with client specific data which is delivered back. Here userData is always the 'XmlBlasterAccessUnparsed *' pointer
xmlBlasterException This points on a valid struct of type XmlBlasterException, so you only need to fill errorCode with strcpy and the returned pointer is ignored and the exception is thrown to xmlBlaster.
Returns:
Return bool true if everything is OK Return false if you want to throw an exception, please fill XmlBlasterException in such a case. If false and *xmlBlasterException.errorCode==0 we don't send a return message (useful for update dispatcher thread to do it later)
See also:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.update.html
Todo:
Return void instead of bool

Definition at line 254 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), initialize(), interceptUpdate(), and runUpdate().

int XmlBlasterAccessUnparsed::callbackMultiThreaded

Shall update messages be transported to the client code in a thread per request?

Definition at line 256 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), interceptUpdate(), and myUpdate().

int XmlBlasterAccessUnparsed::lowLevelAutoAck

Definition at line 257 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), interceptUpdate(), and runUpdate().

long XmlBlasterAccessUnparsed::responseTimeout

Definition at line 258 of file XmlBlasterAccessUnparsed.h.

Referenced by getXmlBlasterAccessUnparsed(), and postSendEvent().

pthread_t XmlBlasterAccessUnparsed::callbackThreadId

Definition at line 259 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), and initialize().

char XmlBlasterAccessUnparsed::threadCounter

Definition at line 260 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), interceptUpdate(), and runUpdate().

pthread_mutex_t XmlBlasterAccessUnparsed::writenMutex

Protect writing n bytes to the socket.

Definition at line 261 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), writenCompressed(), and writenPlain().

pthread_mutex_t XmlBlasterAccessUnparsed::readnMutex

Protect reading n bytes from the socket.

Definition at line 262 of file XmlBlasterAccessUnparsed.h.

Referenced by freeXmlBlasterAccessUnparsed(), getXmlBlasterAccessUnparsed(), readnCompressed(), and readnPlain().


The documentation for this struct was generated from the following file: