Inheritance diagram for org::xmlBlaster::client::XmlBlasterAccess:
Public Member Functions | |
XmlBlasterAccess (org::xmlBlaster::util::Global &global) | |
Create an xmlBlaster accessor. | |
XmlBlasterAccess (org::xmlBlaster::util::GlobalRef global) | |
Create an xmlBlaster accessor. | |
virtual | ~XmlBlasterAccess () |
org::xmlBlaster::util::Global & | getGlobal () |
Access the global handle of this connection. | |
org::xmlBlaster::util::queue::I_Queue * | getQueue () |
Access the client side queue. | |
org::xmlBlaster::util::qos::ConnectReturnQos | connect (org::xmlBlaster::util::qos::ConnectQos &qos, org::xmlBlaster::client::I_Callback *clientCb) |
Login to xmlBlaster. | |
org::xmlBlaster::util::qos::ConnectQosRef | getConnectQos () |
Access the current ConnectQos instance. | |
org::xmlBlaster::util::qos::ConnectReturnQosRef | getConnectReturnQos () |
org::xmlBlaster::client::I_Callback * | getCallback () |
Access the previously with connect() registered callback pointer. | |
void | createDefaultCbServer () |
Extracts address data from org::xmlBlaster::util::qos::ConnectQos (or adds default if missing) and instantiate a callback server as specified in org::xmlBlaster::util::qos::ConnectQos. | |
org::xmlBlaster::client::protocol::I_CallbackServer * | initCbServer (std::string &loginName, std::string &type, std::string &version) |
Create a new instance of the desired protocol driver like CORBA or RMI driver using the plugin loader. | |
org::xmlBlaster::util::dispatch::I_PostSendListener * | registerPostSendListener (org::xmlBlaster::util::dispatch::I_PostSendListener *listener) |
Register a listener for to receive information about the progress of incoming data. | |
org::xmlBlaster::client::protocol::I_ProgressListener * | registerProgressListener (org::xmlBlaster::client::protocol::I_ProgressListener *listener) |
Register a listener for to receive the return Qos of send messages from the client queue. | |
void | initSecuritySettings (std::string &secMechanism, std::string &secVersion) |
Initializes the little client helper framework for authentication. | |
bool | disconnect (org::xmlBlaster::util::qos::DisconnectQos &qos, bool flush=true, bool shutdown=true, bool shutdownCb=true) |
Logout from the server. | |
void | postSend (org::xmlBlaster::util::queue::MsgQueueEntry &msgQueueEntry) |
Enforced by I_PostSendListener. | |
std::string | getId () |
Create a descriptive ME, for logging only. | |
std::string | getSessionName () |
The public session ID of this login session. | |
org::xmlBlaster::util::SessionNameRef | getSessionNameRef () |
Your changes outside change the internal sessionName. | |
std::string | getLoginName () |
Access the login name. | |
void | setServerNodeId (std::string &nodeId) |
Allows to set the node name for nicer logging. | |
std::string | getServerNodeId () |
The cluster node id (name) to which we want to connect. | |
org::xmlBlaster::client::qos::SubscribeReturnQos | subscribe (org::xmlBlaster::client::key::SubscribeKey &key, org::xmlBlaster::client::qos::SubscribeQos &qos, I_Callback *callback=0) |
Put the given message entry into the queue. | |
std::vector< org::xmlBlaster::util::MessageUnit > | get (org::xmlBlaster::client::key::GetKey &key, org::xmlBlaster::client::qos::GetQos &qos) |
std::vector< org::xmlBlaster::util::MessageUnit > | receive (std::string oid, int maxEntries, long timeout, bool consumable) |
This method synchronously accesses maxEntries messages from any xmlBlaster server side queue. | |
std::vector< org::xmlBlaster::client::qos::UnSubscribeReturnQos > | unSubscribe (org::xmlBlaster::client::key::UnSubscribeKey &key, org::xmlBlaster::client::qos::UnSubscribeQos &qos) |
org::xmlBlaster::client::qos::PublishReturnQos | publish (org::xmlBlaster::util::MessageUnit &msgUnit) |
void | publishOneway (std::vector< org::xmlBlaster::util::MessageUnit > &msgUnitArr) |
std::vector< org::xmlBlaster::client::qos::PublishReturnQos > | publishArr (std::vector< org::xmlBlaster::util::MessageUnit > &msgUnitArr) |
std::vector< org::xmlBlaster::client::qos::EraseReturnQos > | erase (org::xmlBlaster::client::key::EraseKey &key, org::xmlBlaster::client::qos::EraseQos &qos) |
void | setCallbackDispatcherActive (bool isActive) |
Switch callback dispatcher on/off. | |
std::string | sendAdministrativeCommand (std::string &command) |
Convenience method to send an administrative command to xmlBlaster. | |
std::string | update (std::string &sessionId, org::xmlBlaster::client::key::UpdateKey &updateKey, unsigned char *content, long contentSize, org::xmlBlaster::client::qos::UpdateQos &updateQos) |
This is the callback method invoked from xmlBlaster delivering us a new asynchronous message. | |
void | initFailsafe (I_ConnectionProblems *connectionProblems=((void *) 0)) |
used to initialize the failsafe behaviour of the client. | |
std::string | ping () |
long | flushQueue () |
Flushes all entries in the queue, i.e. | |
bool | isConnected () |
Same as isAlive() || isPolling(). | |
bool | isAlive () |
Check if we are 'online'. | |
bool | isPolling () |
Check if we are polling for the server. | |
bool | isDead () |
Check if this handle is still useful. | |
std::string | getStatusString () |
Get connection status string for logging. | |
void | leaveServer (StringMap &map) |
Disconnect and cleanup client side resources but keep our login session on server side. | |
Static Public Member Functions | |
static std::string | usage () |
Command line usage. |
Exactly one Global instance and one instance of this are a pair which can't be mixed with other instances.
Definition at line 80 of file XmlBlasterAccess.h.
org::xmlBlaster::client::XmlBlasterAccess::XmlBlasterAccess | ( | org::xmlBlaster::util::Global & | global | ) |
Create an xmlBlaster accessor.
glob | Your environment handle or null to use the default org::xmlBlaster::util::Global.instance() |
Definition at line 28 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::parser::ParserFactory::getFactory(), org::xmlBlaster::util::TimestampFactory::getInstance, org::xmlBlaster::util::TimestampFactory::getTimestamp(), org::xmlBlaster::util::parser::ParserFactory::initialize(), and org::xmlBlaster::util::lexical_cast().
org::xmlBlaster::client::XmlBlasterAccess::XmlBlasterAccess | ( | org::xmlBlaster::util::GlobalRef | global | ) |
Create an xmlBlaster accessor.
glob | Your environment handle or null to use the default org::xmlBlaster::util::Global.instance() |
Definition at line 53 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::parser::ParserFactory::getFactory(), org::xmlBlaster::util::TimestampFactory::getInstance, org::xmlBlaster::util::TimestampFactory::getTimestamp(), org::xmlBlaster::util::parser::ParserFactory::initialize(), and org::xmlBlaster::util::lexical_cast().
org::xmlBlaster::client::XmlBlasterAccess::~XmlBlasterAccess | ( | ) | [virtual] |
Definition at line 78 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), and org::xmlBlaster::util::I_Log::trace().
org::xmlBlaster::util::Global & org::xmlBlaster::client::XmlBlasterAccess::getGlobal | ( | ) |
Access the global handle of this connection.
The returned Global lifetime is limited by XmlBlasterAccess lifetime.
Definition at line 168 of file XmlBlasterAccess.cpp.
org::xmlBlaster::util::queue::I_Queue * org::xmlBlaster::client::XmlBlasterAccess::getQueue | ( | ) |
Access the client side queue.
Definition at line 173 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::getQueue().
Referenced by HelloWorld2::execute().
ConnectReturnQos org::xmlBlaster::client::XmlBlasterAccess::connect | ( | org::xmlBlaster::util::qos::ConnectQos & | qos, | |
org::xmlBlaster::client::I_Callback * | clientCb | |||
) |
Login to xmlBlaster.
Calling multiple times for changed connections should be possible but is not deeply tested.
qos | Your configuration desire | |
client | If not null callback messages will be routed to client.update() |
Definition at line 117 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::dispatch::ConnectionsHandler::connect(), createDefaultCbServer(), org::xmlBlaster::util::I_Log::dump(), org::xmlBlaster::util::qos::SessionQosData::getAbsoluteName(), org::xmlBlaster::util::dispatch::DispatchManager::getConnectionsHandler(), org::xmlBlaster::util::Global::getDispatchManager(), getId(), org::xmlBlaster::util::Global::getInstanceId(), org::xmlBlaster::util::Global::getProperty(), org::xmlBlaster::util::qos::ConnectQosData::getSessionQos(), org::xmlBlaster::util::Property::getStringProperty(), org::xmlBlaster::util::dispatch::ConnectionsHandler::initFailsafe(), org::xmlBlaster::util::dispatch::ConnectionsHandler::registerPostSendListener(), org::xmlBlaster::util::Global::setId(), setServerNodeId(), org::xmlBlaster::util::qos::ConnectQosData::toXml(), and org::xmlBlaster::util::I_Log::trace().
Referenced by Leak::checkConnection2(), SubscribeDemo::connect(), PublishDemo::connect(), TestEmptyContent::execute(), HelloWorld2::execute(), org::xmlBlaster::util::EmbeddedServer::isSomeServerResponding(), org::xmlBlaster::test::TestSubXPath::setUp(), org::xmlBlaster::test::TestSub::setUp(), org::xmlBlaster::test::TestRam::setUp(), org::xmlBlaster::test::TestLeaveServer::setUp(), org::xmlBlaster::test::TestGet::setUp(), org::xmlBlaster::test::TestFailsafe::setUp(), org::xmlBlaster::test::TestConnect::setUp(), org::xmlBlaster::test::TestCommand::setUp(), org::xmlBlaster::util::EmbeddedServer::start(), org::xmlBlaster::util::EmbeddedServer::stop(), and org::xmlBlaster::test::TestFailsafe::testReconnect().
org::xmlBlaster::util::qos::ConnectQosRef org::xmlBlaster::client::XmlBlasterAccess::getConnectQos | ( | ) |
Access the current ConnectQos instance.
Definition at line 286 of file XmlBlasterAccess.cpp.
org::xmlBlaster::util::qos::ConnectReturnQosRef org::xmlBlaster::client::XmlBlasterAccess::getConnectReturnQos | ( | ) |
org::xmlBlaster::client::I_Callback * org::xmlBlaster::client::XmlBlasterAccess::getCallback | ( | ) |
Access the previously with connect() registered callback pointer.
Definition at line 182 of file XmlBlasterAccess.cpp.
void org::xmlBlaster::client::XmlBlasterAccess::createDefaultCbServer | ( | ) |
Extracts address data from org::xmlBlaster::util::qos::ConnectQos (or adds default if missing) and instantiate a callback server as specified in org::xmlBlaster::util::qos::ConnectQos.
Definition at line 235 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::client::protocol::I_CallbackServer::getCbAddress(), org::xmlBlaster::client::protocol::I_CallbackServer::getCbProtocol(), org::xmlBlaster::util::qos::storage::CbQueueProperty::getCurrentCallbackAddress(), getLoginName(), org::xmlBlaster::util::qos::storage::CbQueueProperty::getSettings(), org::xmlBlaster::util::I_Log::info(), initCbServer(), and org::xmlBlaster::util::I_Log::trace().
Referenced by connect().
org::xmlBlaster::client::protocol::I_CallbackServer* org::xmlBlaster::client::XmlBlasterAccess::initCbServer | ( | std::string & | loginName, | |
std::string & | type, | |||
std::string & | version | |||
) |
Create a new instance of the desired protocol driver like CORBA or RMI driver using the plugin loader.
type | E.g. "IOR" or "SOCKET", if null we use the same protocol as our client access. | |
version | The version of the driver, e.g. "1.0" |
Referenced by createDefaultCbServer().
org::xmlBlaster::util::dispatch::I_PostSendListener * org::xmlBlaster::client::XmlBlasterAccess::registerPostSendListener | ( | org::xmlBlaster::util::dispatch::I_PostSendListener * | listener | ) |
Register a listener for to receive information about the progress of incoming data.
Only one listener is supported, the last call overwrites older calls.
listener | Your listener, pass 0 to unregister. |
Definition at line 265 of file XmlBlasterAccess.cpp.
Referenced by PublishDemo::connect().
org::xmlBlaster::client::protocol::I_ProgressListener * org::xmlBlaster::client::XmlBlasterAccess::registerProgressListener | ( | org::xmlBlaster::client::protocol::I_ProgressListener * | listener | ) |
Register a listener for to receive the return Qos of send messages from the client queue.
Only one listener is supported, the last call overwrites older calls.
Note: The synchronously send returned QoS are not delivered here as they are returned by the method invocation already:
PublishReturnQos pubRetQos = con.publish(msgUnit);
listener | Your listener, pass 0 to unregister. |
Definition at line 281 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::client::protocol::I_CallbackServer::registerProgressListener().
Referenced by SubscribeDemo::connect().
void org::xmlBlaster::client::XmlBlasterAccess::initSecuritySettings | ( | std::string & | secMechanism, | |
std::string & | secVersion | |||
) |
Initializes the little client helper framework for authentication.
The first goal is a proper loginQoS xml std::string for authentication.
The second goal is to intercept the messages for encryption (or whatever the plugin supports).
See xmlBlaster.properties, for example:
Security.Client.DefaultPlugin=gui,1.0 Security.Client.Plugin[gui][1.0]=org.xmlBlaster.authentication.plugins.gui.ClientSecurityHelper
bool org::xmlBlaster::client::XmlBlasterAccess::disconnect | ( | org::xmlBlaster::util::qos::DisconnectQos & | qos, | |
bool | flush = true , |
|||
bool | shutdown = true , |
|||
bool | shutdownCb = true | |||
) |
Logout from the server.
Depending on your arguments, the callback server is removed as well, releasing all CORBA/RMI/XmlRpc threads. Note that this kills the server ping thread as well (if in failsafe mode)
qos | The disconnect quality of service | |
flush | Flushed pending publishOneway() messages if any | |
shutdown | shutdown lowlevel connection as well (e.g. CORBA connection) | |
shutdownCb | shutdown callback server as well (if any was established) |
true
successfully logged outfalse
failure on logout Definition at line 332 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::dispatch::ConnectionsHandler::disconnect(), org::xmlBlaster::util::I_Log::dump(), org::xmlBlaster::util::Global::getBoolAsString(), org::xmlBlaster::util::Global::getCbServerPluginManager(), org::xmlBlaster::util::qos::storage::CbQueueProperty::getCurrentCallbackAddress(), org::xmlBlaster::client::protocol::CbServerPluginManager::releasePlugin(), org::xmlBlaster::util::dispatch::ConnectionsHandler::shutdown(), org::xmlBlaster::util::qos::DisconnectQos::toXml(), and org::xmlBlaster::util::I_Log::trace().
Referenced by Leak::checkConnection2(), SubscribeDemo::disconnect_(), TestEmptyContent::execute(), HelloWorld2::execute(), PublishDemo::run(), org::xmlBlaster::test::TestConnect::setUp(), org::xmlBlaster::util::EmbeddedServer::start(), org::xmlBlaster::test::TestSub::tearDown(), org::xmlBlaster::test::TestRam::tearDown(), org::xmlBlaster::test::TestGet::tearDown(), org::xmlBlaster::test::TestFailsafe::tearDown(), org::xmlBlaster::test::TestConnect::tearDown(), org::xmlBlaster::test::TestCommand::tearDown(), and org::xmlBlaster::test::TestFailsafe::testReconnect().
void org::xmlBlaster::client::XmlBlasterAccess::postSend | ( | org::xmlBlaster::util::queue::MsgQueueEntry & | msgQueueEntry | ) | [virtual] |
Enforced by I_PostSendListener.
Implements org::xmlBlaster::util::dispatch::I_PostSendListener.
Definition at line 274 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::I_PostSendListener::postSend().
string org::xmlBlaster::client::XmlBlasterAccess::getId | ( | ) |
Create a descriptive ME, for logging only.
Definition at line 367 of file XmlBlasterAccess.cpp.
References getSessionName().
Referenced by connect().
string org::xmlBlaster::client::XmlBlasterAccess::getSessionName | ( | ) |
The public session ID of this login session.
Definition at line 378 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::ReferenceHolder< T >::isNull().
Referenced by getId(), and setCallbackDispatcherActive().
SessionNameRef org::xmlBlaster::client::XmlBlasterAccess::getSessionNameRef | ( | ) |
Your changes outside change the internal sessionName.
Definition at line 372 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::ReferenceHolder< T >::isNull().
Referenced by subscribe().
string org::xmlBlaster::client::XmlBlasterAccess::getLoginName | ( | ) |
Access the login name.
Definition at line 386 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::XmlBlasterException::toString(), and org::xmlBlaster::util::I_Log::warn().
Referenced by createDefaultCbServer().
void org::xmlBlaster::client::XmlBlasterAccess::setServerNodeId | ( | std::string & | nodeId | ) |
string org::xmlBlaster::client::XmlBlasterAccess::getServerNodeId | ( | ) |
The cluster node id (name) to which we want to connect.
Needed only for nicer logging when running in a cluster.
Is configurable with "-server.node.id golan"
Definition at line 403 of file XmlBlasterAccess.cpp.
Referenced by PublishDemo::connect().
SubscribeReturnQos org::xmlBlaster::client::XmlBlasterAccess::subscribe | ( | org::xmlBlaster::client::key::SubscribeKey & | key, | |
org::xmlBlaster::client::qos::SubscribeQos & | qos, | |||
I_Callback * | callback = 0 | |||
) |
Put the given message entry into the queue.
Definition at line 422 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::I_Log::dump(), org::xmlBlaster::client::qos::SubscribeQos::getMultiSubscribe(), getSessionNameRef(), org::xmlBlaster::client::qos::SubscribeReturnQos::getSubscriptionId(), org::xmlBlaster::client::qos::SubscribeQos::hasSubscriptionId(), isConnected(), org::xmlBlaster::util::dispatch::ConnectionsHandler::subscribe(), org::xmlBlaster::client::qos::UnSubscribeQos::toXml(), org::xmlBlaster::client::key::UnSubscribeKey::toXml(), org::xmlBlaster::util::I_Log::trace(), and org::xmlBlaster::util::USER_NOT_CONNECTED.
Referenced by TestEmptyContent::execute(), HelloWorld2::execute(), org::xmlBlaster::test::TestFailsafe::setUp(), SubscribeDemo::subscribe(), org::xmlBlaster::test::TestConnect::testPubSub(), org::xmlBlaster::test::TestFailsafe::testReconnect(), org::xmlBlaster::test::TestSub::testSubscribeSpecificCallback(), and org::xmlBlaster::test::TestSub::testSubscribeXPath().
vector< MessageUnit > org::xmlBlaster::client::XmlBlasterAccess::get | ( | org::xmlBlaster::client::key::GetKey & | key, | |
org::xmlBlaster::client::qos::GetQos & | qos | |||
) |
Definition at line 463 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::I_Log::dump(), org::xmlBlaster::util::dispatch::ConnectionsHandler::get(), isConnected(), org::xmlBlaster::client::qos::UnSubscribeQos::toXml(), org::xmlBlaster::client::key::UnSubscribeKey::toXml(), and org::xmlBlaster::util::USER_NOT_CONNECTED.
Referenced by org::xmlBlaster::test::TestGet::testGet(), org::xmlBlaster::test::TestLeaveServer::testLeaveServer(), org::xmlBlaster::test::TestGet::testMany(), and org::xmlBlaster::test::TestRam::testPublish().
std::vector<org::xmlBlaster::util::MessageUnit> org::xmlBlaster::client::XmlBlasterAccess::receive | ( | std::string | oid, | |
int | maxEntries, | |||
long | timeout, | |||
bool | consumable | |||
) |
This method synchronously accesses maxEntries messages from any xmlBlaster server side queue.
This is a convenience method which uses get() with a specific Qos.
Important note:
Currently you shouldn't use unlimited timeout==-1 as this could lead to a server side thread leak on client disconnect. As a workaround please use a loop and a timeout of for example 60000 and just ignore returned arrays of length 0.
oid | The identifier like "topic/hello" to access a history queue, "client/joe" to access a subject queue or "client/joe/session/1" to access a callback queue. The string must follow the formatting rule of ContextNode.java | |
maxEntries | The maximum number of entries to retrieve | |
timeout | The time to wait until return. If you choose a negative value it will block until the maxEntries has been reached. If the value is '0' (i.e. zero) it will not wait and will correspond to a non-blocking get. If the value is positive it will block until the specified amount in milliseconds has elapsed or when the maxEntries has been reached (whichever comes first). | |
consumable | Expressed with 'true' or 'false'. If true the entries returned are deleted from the queue |
engine.qos.queryspec.QueueQuery requirement
javax.jms.MessageConsumer::receive
Referenced by HelloWorld2::execute().
vector< UnSubscribeReturnQos > org::xmlBlaster::client::XmlBlasterAccess::unSubscribe | ( | org::xmlBlaster::client::key::UnSubscribeKey & | key, | |
org::xmlBlaster::client::qos::UnSubscribeQos & | qos | |||
) |
Definition at line 507 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::I_Log::dump(), isConnected(), org::xmlBlaster::client::qos::UnSubscribeQos::toXml(), org::xmlBlaster::client::key::UnSubscribeKey::toXml(), org::xmlBlaster::util::I_Log::trace(), org::xmlBlaster::util::dispatch::ConnectionsHandler::unSubscribe(), and org::xmlBlaster::util::USER_NOT_CONNECTED.
Referenced by org::xmlBlaster::test::TestSub::testSubscribeSpecificCallback(), and SubscribeDemo::unSubscribe_().
PublishReturnQos org::xmlBlaster::client::XmlBlasterAccess::publish | ( | org::xmlBlaster::util::MessageUnit & | msgUnit | ) |
Definition at line 531 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::I_Log::dump(), isConnected(), org::xmlBlaster::util::dispatch::ConnectionsHandler::publish(), org::xmlBlaster::util::MessageUnit::toXml(), and org::xmlBlaster::util::USER_NOT_CONNECTED.
Referenced by TestEmptyContent::execute(), HelloWorld2::execute(), PublishDemo::publish(), org::xmlBlaster::util::EmbeddedServer::stop(), org::xmlBlaster::test::TestFailsafe::testFailsafe(), org::xmlBlaster::test::TestGet::testGet(), org::xmlBlaster::test::TestSubXPath::testInitial(), org::xmlBlaster::test::TestSub::testPublishCorbaMethods(), org::xmlBlaster::test::TestSub::testPublishSTLMethods(), org::xmlBlaster::test::TestConnect::testPubSub(), org::xmlBlaster::test::TestFailsafe::testReconnect(), and org::xmlBlaster::test::TestSub::testSubscribeSpecificCallback().
void org::xmlBlaster::client::XmlBlasterAccess::publishOneway | ( | std::vector< org::xmlBlaster::util::MessageUnit > & | msgUnitArr | ) |
std::vector<org::xmlBlaster::client::qos::PublishReturnQos> org::xmlBlaster::client::XmlBlasterAccess::publishArr | ( | std::vector< org::xmlBlaster::util::MessageUnit > & | msgUnitArr | ) |
vector< EraseReturnQos > org::xmlBlaster::client::XmlBlasterAccess::erase | ( | org::xmlBlaster::client::key::EraseKey & | key, | |
org::xmlBlaster::client::qos::EraseQos & | qos | |||
) |
Definition at line 577 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::I_Log::call(), org::xmlBlaster::util::I_Log::dump(), org::xmlBlaster::util::dispatch::ConnectionsHandler::erase(), isConnected(), org::xmlBlaster::client::qos::UnSubscribeQos::toXml(), org::xmlBlaster::client::key::UnSubscribeKey::toXml(), and org::xmlBlaster::util::USER_NOT_CONNECTED.
Referenced by PublishDemo::erase(), TestEmptyContent::execute(), HelloWorld2::execute(), org::xmlBlaster::test::TestSub::tearDown(), org::xmlBlaster::test::TestRam::tearDown(), org::xmlBlaster::test::TestGet::tearDown(), org::xmlBlaster::test::TestFailsafe::tearDown(), org::xmlBlaster::test::TestSubXPath::testInitial(), and org::xmlBlaster::test::TestConnect::testPubSub().
void org::xmlBlaster::client::XmlBlasterAccess::setCallbackDispatcherActive | ( | bool | isActive | ) |
Switch callback dispatcher on/off.
This is a convenience function (see ConnectQos). It will update the client side ConnectQos as well so we don't loose the setting on reconnects after server maintenance.
isActive | true: XmlBlaster server delivers callback messages false: XmlBlaster server keeps messages for this client in the callback queue |
Definition at line 187 of file XmlBlasterAccess.cpp.
References getSessionName(), org::xmlBlaster::util::lexical_cast(), and sendAdministrativeCommand().
Referenced by SubscribeDemo::execute(), and org::xmlBlaster::test::TestCommand::testSetCallbackDispatcherActive().
std::string org::xmlBlaster::client::XmlBlasterAccess::sendAdministrativeCommand | ( | std::string & | command | ) |
Convenience method to send an administrative command to xmlBlaster.
If the command contains a '=' it is interpreted as a set() call, else it is used as a get() call.
command | for example "client/joe/?dispatcherActive" (a getter) or "client/joe/?dispatcherActive=false" (a setter). The "__cmd:" is added by us To enforce a getter or setter you can write "get client/joe/?dispatcherActive" or "set client/joe/?dispatcherActive=false" |
XmlBlasterException | on problems |
Referenced by setCallbackDispatcherActive(), and org::xmlBlaster::test::TestCommand::testSendAdministrativeCommand().
std::string org::xmlBlaster::client::XmlBlasterAccess::update | ( | std::string & | sessionId, | |
org::xmlBlaster::client::key::UpdateKey & | updateKey, | |||
unsigned char * | content, | |||
long | contentSize, | |||
org::xmlBlaster::client::qos::UpdateQos & | updateQos | |||
) | [virtual] |
This is the callback method invoked from xmlBlaster delivering us a new asynchronous message.
Implements org::xmlBlaster::client::I_Callback.
std::string org::xmlBlaster::client::XmlBlasterAccess::usage | ( | ) | [static] |
Command line usage.
Definition at line 629 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::Global::getDefaultProtocol(), org::xmlBlaster::util::Global::getInstance, org::xmlBlaster::util::Global::getProperty(), and org::xmlBlaster::util::Property::getStringProperty().
Referenced by org::xmlBlaster::test::TestRam::usage(), org::xmlBlaster::test::TestKeys::usage(), and org::xmlBlaster::test::TestGet::usage().
void org::xmlBlaster::client::XmlBlasterAccess::initFailsafe | ( | I_ConnectionProblems * | connectionProblems = ((void *) 0) |
) |
used to initialize the failsafe behaviour of the client.
If connectionProblems is not NULL, then the passed object will be notified for connection lost and reconnected events.
Definition at line 644 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::initFailsafe().
Referenced by SubscribeDemo::connect(), TestEmptyContent::execute(), HelloWorld2::execute(), and org::xmlBlaster::test::TestFailsafe::setUp().
string org::xmlBlaster::client::XmlBlasterAccess::ping | ( | ) |
Definition at line 650 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::ping().
long org::xmlBlaster::client::XmlBlasterAccess::flushQueue | ( | ) |
Flushes all entries in the queue, i.e.
the entries of the queue are sent to xmlBlaster. If the queue is empty or NULL, then 0 is returned. If the state is in POLLING or DEAD, then -1 is returned.. This method blocks until all entries in the queue have been sent.
Definition at line 657 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::flushQueue(), and org::xmlBlaster::util::INTERNAL_NULLPOINTER.
bool org::xmlBlaster::client::XmlBlasterAccess::isConnected | ( | ) |
Same as isAlive() || isPolling().
Definition at line 666 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::isConnected().
Referenced by erase(), get(), leaveServer(), publish(), subscribe(), and unSubscribe().
bool org::xmlBlaster::client::XmlBlasterAccess::isAlive | ( | ) |
Check if we are 'online'.
Definition at line 672 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::isAlive().
Referenced by org::xmlBlaster::test::TestFailsafe::testReconnect().
bool org::xmlBlaster::client::XmlBlasterAccess::isPolling | ( | ) |
Check if we are polling for the server.
Definition at line 678 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::isPolling().
bool org::xmlBlaster::client::XmlBlasterAccess::isDead | ( | ) |
Check if this handle is still useful.
Definition at line 684 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::isDead().
std::string org::xmlBlaster::client::XmlBlasterAccess::getStatusString | ( | ) |
Get connection status string for logging.
Definition at line 691 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::dispatch::ConnectionsHandler::getStatusString().
void org::xmlBlaster::client::XmlBlasterAccess::leaveServer | ( | StringMap & | map | ) |
Disconnect and cleanup client side resources but keep our login session on server side.
As the login session on server side stays alive, all subscriptions stay valid and callback messages are queued by the server. If you connect at a later time the server sends us all queued messages.
Once you have called this method the XmlBlasterAccess instance becomes invalid and any further invocation results in an XmlBlasterException to be thrown.
map | The properties to pass while leaving server. Currently this argument has no effect. |
Definition at line 299 of file XmlBlasterAccess.cpp.
References org::xmlBlaster::util::Global::getCbServerPluginManager(), org::xmlBlaster::util::qos::storage::CbQueueProperty::getCurrentCallbackAddress(), org::xmlBlaster::util::I_Log::info(), isConnected(), org::xmlBlaster::client::protocol::CbServerPluginManager::releasePlugin(), org::xmlBlaster::util::dispatch::ConnectionsHandler::shutdown(), org::xmlBlaster::client::protocol::I_CallbackServer::shutdownCb(), org::xmlBlaster::util::I_Log::trace(), and org::xmlBlaster::util::USER_NOT_CONNECTED.
Referenced by org::xmlBlaster::test::TestLeaveServer::testLeaveServer().