Qore tibrv Module Documentation

Module Reference Manual

David Nichols

v1.0

Revision History
Revision 1.06 September 2008dn
split from qore docs

tibrv Module

Note that the code in this module is not available with the PO_NO_NETWORK parse option.

To use this module, include the following line in the qore program to load the module:

%requires tibrv

The tibrv module provides direct TIBCO Rendezvous functionality, including support for reliable and certified messaging, secure daemon support, fault tolerant group membership and monitoring, and distributed queues. For ActiveEnterprise functionality, see the tibae module. All classes and constants provided by this module can be found in the Tibrv namespace.

Qore data sent on the Rendezvous bus is automatically serialized to TIBCO Rendezvous formats based on information in the following table. Because Rendezvous supports many more data types than Qore has basic types, serializion can be overridden by using the functions in tibrv functions. For example:

$msg = ( "field" : tibrv_xml($xmlstr) );

The preceding example will override the default serialization to TIBRVMSG_STRING and send the XML string data (assuming the variable $xmlstr contains an xml string) as TIBRVMSG_XML data.

Table 1. Default Serialization of Qore Data -> TIBCO Rendezvous Format

Qore Type

Rendezvous Type

Notes

bool

TIBRVMSG_BOOL

direct conversion

int

TIBRVMSG_I64

direct conversion

float

TIBRVMSG_F64

direct conversion

string

TIBRVMSG_STRING

direct conversion

binary

TIBRVMSG_OPAQUE

direct conversion

date

TIBRVMSG_DATETIME

When compiled with Qore 0.8.0+, date/time values are serialized as UTC in a manner consistent with ActiveEnterprise adapters


Received Rendezvous data is automatically deserialized to Qore data structures based on information in the following table.

Note

Because Qore integers are 64-bit signed numbers, conversions from the TIBRVMSG_U64 type can mean a loss of precision if the high-bit is set in the number. In this case the qore number will erroneously appear to be negative.

Table 2. Default Serialization of TIBCO Rendezvous -> Qore Data Structures

Rendezvous Type

Qore Type

Notes

TIBRVMSG_BOOL

bool

direct conversion

TIBRVMSG_U64

int

loss of precision possible as qore only supports signed 64-bit integer values

TIBRVMSG_I64

int

direct conversion

TIBRVMSG_U32

int

direct conversion

TIBRVMSG_I32

int

direct conversion

TIBRVMSG_U16

int

direct conversion

TIBRVMSG_I16

int

direct conversion

TIBRVMSG_U8

int

direct conversion

TIBRVMSG_I8

int

direct conversion

TIBRVMSG_F64

float

direct conversion

TIBRVMSG_F32

float

direct conversion

TIBRVMSG_DATETIME

date

When compiled with Qore 0.8.0+, date/time values are assumed to be in UTC in a manner consistent with ActiveEnterprise adapters usage of this data type

TIBRVMSG_OPAQUE

binary

direct conversion

TIBRVMSG_STRING

string

direct conversion

TIBRVMSG_XML

string

direct conversion

TIBRVMSG_IPPORT16

int

direct conversion to an integer value

TIBRVMSG_IPADDR32

string

direct conversion to a string


Table 3. Classes provided by the tibrv module

Class

Description

TibrvSender Class

For sending messages using Rendezvous' reliable protocol.

TibrvListener Class

For receiving messages using Rendezvous' reliable protocol.

TibrvCmSender Class

For sending messages using Rendezvous' certified messaging protocol.

TibrvCmListener Class

For receiving messages using Rendezvous' certified messaging protocol.

TibrvFtMember Class

Used to join a Rendezvous fault-tolerant group.

TibrvFtMonitor Class

Used to monitor a Rendezvous fault-tolerant group.

TibrvDistributedQueue Class

Used to participate in a Rendezvous distributed queue.


Table 4. Constants provided by the tibrv module

Name

Type

Description

TIBRVFT_PREPARE_TO_ACTIVATE

int

Fault tolerant action code indicating that an activation message could be pending.

TIBRVFT_ACTIVATE

int

Fault toleration action code indicating that the fault tolerant member should activate immedatitely.

TIBRVFT_DEACTIVATE

int

Fault tolerant action code indicating that the fault tolerant member should deactivate immedaitely.

TIBRVFT_QORE_STOP

int

Qore extension to the fault tolerant action codes meaning that the fault tolerant event loop should terminate immediately.


Table 5. Functions provided by the tibrv module

Function Name

Ret Type

Exception

Brief Description

tibrv_i8()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I8 data.

tibrv_u8()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U8 data.

tibrv_i16()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I16 data.

tibrv_u16()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U16 data.

tibrv_i32()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I32 data.

tibrv_u32()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U32 data.

tibrv_i64()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I64 data.

tibrv_u64()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U64 data.

tibrv_f32()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_F32 data.

tibrv_f64()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_F64 data.

tibrv_ipport16()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_IPPORT16 data.

tibrv_ipaddr32()

hash

N

Creates a hash structure to ensure that a qore string (ex. "192.168.1.1") is serialized as Rendezvous TIBRV_IPADDR32 data.

tibrv_xml()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_XML data.

tibrv_bool()

hash

N

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_BOOL data.


Tibrv::TibrvSender Class

The TibrvSender object is used to send messages using the TIBCO Rendezvous reliable messaging protocol. Each TibrvSender object is set with a string encoding value, which is by default set to the default encoding for qore. Any strings received by this object will be assumed to be in this encoding and any strings sent will be convert to this encoding if necessary. To set or check the encoding for TibrvSender objects, see the TibrvSender::setStringEncoding() and TibrvSender::getStringEncoding() methods.

Table 6. TibrvSender Class Method Overview

Method

Except?

Description

TibrvSender::constructor()

Y

Creates the TibrvSender object based on the parameters passed.

TibrvSender::destructor()

N

Destroys the TibrvSender object.

TibrvSender::copy()

Y

Copying object of this class is not supported, an exception will be thrown.

TibrvSender::sendSubject()

Y

Sends a message using the reliable protocol to the given subject.

TibrvSender::sendSubjectWithSyncReply()

Y

Sends a message using the reliable protocol to the given subject and returns the reply.

TibrvSender::setStringEncoding()

Y

Sets the string encoding for the object; any strings serialized with this object will be converted to this character encoding if necessary.

TibrvSender::getStringEncoding()

N

Returns the encoding used for the object


TibrvSender::constructor()

Synopsis

Creates the TibrvSender object based on the parameters passed.

Usage
new TibrvSender([desc], [service], [network], [daemon])

Table 7. Arguments for TibrvSender::constructor()

Argument

Type

Description

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 8. Return Values for TibrvSender::constructor()

Return Type

Description

Object

The TibrvSender object is returned


Table 9. Exceptions thrown by TibrvSender::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object


TibrvSender::destructor()

Synopsis

Destroys the TibrvSender object.

Usage
delete lvalue

Table 10. Arguments for TibrvSender::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 11. Return Values for TibrvSender::destructor()

Return Type

Description

n/a

This method returns no value


TibrvSender::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Table 12. Exceptions thrown by TibrvSender::copy()

err

desc

TIBRVTRANSPORT-COPY-ERROR

objects of this class may not be copied


TibrvSender::sendSubject()

Synopsis

Sends a message using the reliable protocol to the given subject.

Usage
TibrvSender::sendSubject(subject, message, [reply_subject])

Table 13. Arguments for TibrvSender::sendSubject()

Argument

Type

Description

subject

string

The subject name for the message.

message

hash

The message to send as a hash

[reply_subject]

string

An optional subject to be used for the reply.


Table 14. Return Values for TibrvSender::sendSubject()

Return Type

Description

n/a

This method returns no value


Table 15. Exceptions thrown by TibrvSender::sendSubject()

err

desc

TIBRVSENDER-SENDSUBJECT-ERROR

missing subject or message parameter

TIBRV-MARSHALLING-ERROR

There was an error serializing the qore data to Tibco Rendezvous format

TIBRV-SEND-ERROR

There was an error sending the message


TibrvSender::sendSubjectWithSyncReply()

Synopsis

Sends a message using the reliable protocol to the given subject and returns the reply. A timeout value in milliseconds can be optionally included as the third parameter to the method. If no reply is received within the timeout period, NOTHING is returned. If a reply is received, the reply is convert to a qore data structure and returned in the form of a hash with the following keys: 'msg' containing the reply data, 'subject' giving the subject of the reply message, and optionally 'replySubject' giving a subject name for a subsequent reply.

Usage
TibrvSender::sendSubjectWithSyncReply(subject, message, [timeout])

Table 16. Arguments for TibrvSender::sendSubjectWithSyncReply()

Argument

Type

Description

subject

string

The subject name for the message.

message

hash

The message to send as a hash

[timeout]

int

The timeout value in milliseconds. Can also be a relative time (i.e. 250ms) in order to make the units clear in the source. If no timeout value is passed to the method (or the timeout value is negative) then the timeout period is infinite, therefore it's recommended to send a timeout value.


Table 17. Return Values for TibrvSender::sendSubjectWithSyncReply()

Return Type

Description

hash

The return hash will have the following keys: 'msg' containing the return message data, 'subject' giving the subject of the reply message, and optionally 'replySubject' giving a subject name for a subsequent reply message

NOTHING

In the case of a timeout, NOTHING is returned.


Table 18. Exceptions thrown by TibrvSender::sendSubjectWithSyncReply()

err

desc

TIBRVSENDER-SENDSUBJECTWITHSYNCREPLY-ERROR

missing subject or message parameter

TIBRV-MARSHALLING-ERROR

There was an error serializing the qore data to Tibco Rendezvous format

TIBRV-DEMARSHALLING-ERROR

There was an error deserializing the Tibco Rendezvous data to qore data structures

TIBRV-SENDREQUEST-ERROR

There was an error sending the message


TibrvSender::setStringEncoding()

Synopsis

Sets the string encoding for the object; any strings serialized with this object will be converted to this character encoding if necessary.

Usage
TibrvSender::setStringEncoding(encoding)

Table 19. Arguments for TibrvSender::setStringEncoding()

Argument

Type

Description

encoding

string

The string encoding to use for this object.


Table 20. Return Values for TibrvSender::setStringEncoding()

Return Type

Description

n/a

This method returns no value


Table 21. Exceptions thrown by TibrvSender::setStringEncoding()

err

desc

TIBRVSENDER-SETSTRINGENCODING-ERROR

missing encoding parameter from method call


TibrvSender::getStringEncoding()

Synopsis

Returns the encoding used for the object

Usage
TibrvSender::getStringEncoding()

Table 22. Arguments for TibrvSender::getStringEncoding()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 23. Return Values for TibrvSender::getStringEncoding()

Return Type

Description

string

The encoding used for the object.


Tibrv::TibrvListener Class

The TibrvListener object is used to receive messages using the TIBCO Rendezvous reliable messaging protocol. To send messages, use the TibrvSender Class. Each TibrvListener object is set with a string encoding value, which is by default set to the default encoding for qore. Any strings received by this object will be assumed to be in this encoding. To set or check the encoding for TibrvListener objects, see the TibrvListener::setStringEncoding() and TibrvListener::getStringEncoding() methods.

Table 24. TibrvListener Class Method Overview

Method

Except?

Description

TibrvListener::constructor()

Y

Creates the TibrvListener object based on the parameters passed.

TibrvListener::destructor()

N

Destroys the TibrvListener object.

TibrvListener::copy()

Y

Copying objects of this class is not supported, an exception will be thrown.

TibrvListener::getMessage()

Y

Waits for a message event matching the subject string for this object.

TibrvListener::getQueueSize()

Y

Returns the number of messages in the queue.

TibrvListener::createInboxName()

Y

Creates a subject name that will be delivered by a point-to-point message directly to this listener object when used as a replySubject in an outgoing message.

TibrvListener::setStringEncoding()

Y

Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding.

TibrvListener::getStringEncoding()

N

Returns the character encoding used for the object


TibrvListener::constructor()

Synopsis

Creates the TibrvListener object based on the parameters passed.

Usage
new TibrvListener(subject, [desc], [service], [network], [daemon])

Table 25. Arguments for TibrvListener::constructor()

Argument

Type

Description

subject

string

The subject to listen for (may contain wildcards, i.e. 'TEST.ADAPTER.>')

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 26. Return Values for TibrvListener::constructor()

Return Type

Description

Object

The TibrvListener object is returned


Table 27. Exceptions thrown by TibrvListener::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object

TIBRVLISTENER-CONSTRUCTOR-ERROR

there was an error creating the listener object (ex: invalid subject, etc)


TibrvListener::destructor()

Synopsis

Destroys the TibrvListener object.

Usage
delete lvalue

Table 28. Arguments for TibrvListener::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 29. Return Values for TibrvListener::destructor()

Return Type

Description

n/a

This method returns no value


TibrvListener::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Table 30. Exceptions thrown by TibrvListener::copy()

err

desc

TIBRVLISTENER-COPY-ERROR

objects of this class may not be copied


TibrvListener::getMessage()

Synopsis

Waits for a message event matching the subject string passed. If a timeout value is passed, then if no suitable event is received within the timeout period, NOTHING is returned. Note that this method may return before the timeout period has expired in case that an event is posted to the queue that does not contain message data. In this case the method returns as with a normal timeout.

Usage
TibrvListener::getMessage([timeout])

Table 31. Arguments for TibrvListener::getMessage()

Argument

Type

Description

[timeout]

int

The timeout value in milliseconds. Can also be a relative time (i.e. 1250ms) in order to make the units clear in the source. If no timeout value is passed to the method (or the timeout value is negative) then the timeout period is infinite, therefore it's recommended to send a timeout value.


Table 32. Return Values for TibrvListener::getMessage()

Return Type

Description

hash

The return hash will have the following keys: 'msg' containing the return message data, 'subject' giving the subject of the reply message, and optionally 'replySubject' giving a subject name for a subsequent reply message

NOTHING

In the case of a timeout, NOTHING is returned.


Table 33. Exceptions thrown by TibrvListener::getMessage()

err

desc

TIBRVLISTENER-GETMESSAGE-ERROR

There was an error dispatching the event on the internal queue

TIBRV-DEMARSHALLING-ERROR

There was an error deserializing the Tibco Rendezvous data to a qore data structore


TibrvListener::getQueueSize()

Synopsis

Returns the number of messages in the queue.

Usage
TibrvListener::getQueueSize()

Table 34. Arguments for TibrvListener::getQueueSize()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 35. Return Values for TibrvListener::getQueueSize()

Return Type

Description

int

The number of messages in the queue.


Table 36. Exceptions thrown by TibrvListener::getQueueSize()

err

desc

TIBRVLISTENER-GETQUEUESIZE-ERROR

An internal error occurred.


TibrvListener::createInboxName()

Synopsis

Creates a subject name that will be delivered by a point-to-point message directly to this listener object when used as a replySubject in an outgoing message.

Usage
TibrvListener::createInboxName()

Table 37. Arguments for TibrvListener::createInboxName()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 38. Return Values for TibrvListener::createInboxName()

Return Type

Description

string

The string to use as a replySubject in an outgoing message to ensure that any reply will be a point-to-point reply directly to this listener object


Table 39. Exceptions thrown by TibrvListener::createInboxName()

err

desc

TIBRVLISTENER-CREATEINBOXNAME-ERROR

An error occurred creating the inbox name


TibrvListener::setStringEncoding()

Synopsis

Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding.

Usage
TibrvListener::setStringEncoding()

Table 40. Arguments for TibrvListener::setStringEncoding()

Argument

Type

Description

encoding

string

The string encoding to use for this object.


Table 41. Return Values for TibrvListener::setStringEncoding()

Return Type

Description

n/a

This method returns no value


Table 42. Exceptions thrown by TibrvListener::setStringEncoding()

err

desc

TIBRVLISTENER-SETSTRINGENCODING-ERROR

missing encoding parameter from method call


TibrvListener::getStringEncoding()

Synopsis

Returns the character encoding used for the object

Usage
TibrvListener::getStringEncoding()

Table 43. Arguments for TibrvListener::getStringEncoding()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 44. Return Values for TibrvListener::getStringEncoding()

Return Type

Description

string

The character encoding used for the object.


Tibrv::TibrvCmSender Class

The TibrvCmSender object is used to send certified messages using the TIBCO Rendezvous certified messaging protocol. Each TibrvCmSender object is set with a string encoding value, which is by default set to the default encoding for qore. Any strings received by this object will be assumed to be in this encoding and any strings sent will be convert to this encoding if necessary. To set or check the encoding for TibrvSender objects, see the TibrvSender::setStringEncoding() and TibrvSender::getStringEncoding() methods.

Table 45. TibrvCmSender Class Method Overview

Method

Except?

Description

TibrvCmSender::constructor()

Y

Creates the TibrvCmSender object based on the parameters passed.

TibrvCmSender::destructor()

N

Destroys the TibrvCmSender object.

TibrvCmSender::copy()

Y

Copying objects of this class is not supported, an exception will be thrown.

TibrvCmSender::sendSubject()

Y

Sends a certified message to the given subject.

TibrvCmSender::sendSubjectWithSyncReply()

Y

Sends a certified message to the given subject and returns the reply.

TibrvCmSender::setStringEncoding()

Y

Sets the string encoding for the object; any strings serialized with this object will be converted to this character encoding if necessary.

TibrvCmSender::getStringEncoding()

N

Returns the encoding used for the object

TibrvCmSender::connectToRelayAgent()

Y

Explicitly and asynchronously connect to the relay agent.

TibrvCmSender::disconnectFromRelayAgent()

Y

Explicitly and asynchronously disconnect from the relay agent.

TibrvCmSender::expireMssages()

Y

Marks certified messages in the ledger as expired

TibrvCmSender::getName()

Y

Returns the correspondent name of the object.

TibrvCmSender::getDefaultTimeLimit()

Y

Returns the time limit in milliseconds for outbound certified messages.

TibrvCmSender::setDefaultTimeLimit()

Y

Sets the time limit in milliseconds for outbound certified messages; use zero for no time limit.

TibrvCmSender::reviewLedger()

Y

Query the ledger for items matching a subject name.

TibrvCmSender::removeSendState()

Y

Remove sequence accounting for obsolete subjects

TibrvCmSender::syncLedger()

Y

Flushes the ledger to its storage medium (only useful for file-based ledgers)


TibrvCmSender::constructor()

Synopsis

Creates the TibrvCmSender object based on the parameters passed.

Usage
new TibrvCmSender([cmName], [requestOld], [ledgerName], [syncLedger], [relayAgent], [desc], [service], [network], [daemon])

Table 46. Arguments for TibrvCmSender::constructor()

Argument

Type

Description

[cmName]

string

The name for the persistent correspondent for this object. The name must conform to Rendezvous subject naming conventions. If this argument is not passed, then a unique, non-reusable name will be generated for the duration of this object.

[requestOld]

bool

If True, then this object will require certified messages delivered to a previous instance with the same correspondent name without a confirmed delivery to be redelivered.

[ledgerName]

string

If this argument is passed then the object will use a file-based ledger; if this argument is omitted the object will use a process-based ledger.

[syncLedger]

bool

If True no buffering will be made on changes to the ledger.

[relayAgent]

string

If this argument is present, it must be a reusable name for the relay agent for this Rendezvous transport

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 47. Return Values for TibrvCmSender::constructor()

Return Type

Description

Object

The TibrvCmSender object is returned


Table 48. Exceptions thrown by TibrvCmSender::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object

TIBRV-CMTRANSPORT-ERROR

there was an error creating the certified transport object


TibrvCmSender::destructor()

Synopsis

Destroys the TibrvCmSender object.

Usage
delete lvalue

Table 49. Arguments for TibrvCmSender::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 50. Return Values for TibrvCmSender::destructor()

Return Type

Description

n/a

This method returns no value


TibrvCmSender::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Table 51. Exceptions thrown by TibrvCmSender::copy()

err

desc

TIBRVTRANSPORT-COPY-ERROR

objects of this class may not be copied


TibrvCmSender::sendSubject()

Synopsis

Sends a certified message to the given subject.

Usage
TibrvCmSender::sendSubject(subject, message)

Table 52. Arguments for TibrvCmSender::sendSubject()

Argument

Type

Description

subject

string

The subject name for the message.

message

hash

The message to send as a hash


Table 53. Return Values for TibrvCmSender::sendSubject()

Return Type

Description

n/a

This method returns no value


Table 54. Exceptions thrown by TibrvCmSender::sendSubject()

err

desc

TIBRVCMSENDER-SENDSUBJECT-ERROR

missing subject or message parameter

TIBRV-MARSHALLING-ERROR

There was an error serializing the qore data to Tibco Rendezvous format

TIBRV-SEND-ERROR

There was an error sending the message


TibrvCmSender::sendSubjectWithSyncReply()

Synopsis

Sends a certified message to the given subject and returns the reply. A timeout value in milliseconds can be optionally included as the third parameter to the method. If no reply is received within the timeout period, NOTHING is returned. If a reply is received, the reply is convert to a qore data structure and returned in the form of a hash with the following keys: 'msg' containing the reply data, 'subject' giving the subject of the reply message, and optionally 'replySubject' giving a subject name for a subsequent reply.

Usage
TibrvCmSender::sendSubjectWithSyncReply(subject, message, [timeout])

Table 55. Arguments for TibrvCmSender::sendSubjectWithSyncReply()

Argument

Type

Description

subject

string

The subject name for the message.

message

hash

The message to send as a hash

[timeout]

int

The timeout value in milliseconds. Can also be a relative time (i.e. 1250ms) in order to make the units clear in the source. If no timeout value is passed to the method (or the timeout value is negative) then the timeout period is infinite, therefore it's recommended to send a timeout value.


Table 56. Return Values for TibrvCmSender::sendSubjectWithSyncReply()

Return Type

Description

hash

The return hash will have the following keys: 'msg' containing the return message data, 'subject' giving the subject of the reply message, and optionally 'replySubject' giving a subject name for a subsequent reply message


Table 57. Exceptions thrown by TibrvCmSender::sendSubjectWithSyncReply()

err

desc

TIBRVCMSENDER-SENDSUBJECTWITHSYNCREPLY-ERROR

missing subject or message parameter

TIBRV-MARSHALLING-ERROR

There was an error serializing the qore data to Tibco Rendezvous format

TIBRV-DEMARSHALLING-ERROR

There was an error deserializing the Tibco Rendezvous data to qore data structures

TIBRV-SENDREQUEST-ERROR

There was an error sending the message


TibrvCmSender::setStringEncoding()

Synopsis

Sets the string encoding for the object; any strings serialized with this object will be converted to this character encoding if necessary.

Usage
TibrvCmSender::setStringEncoding(encoding)

Table 58. Arguments for TibrvCmSender::setStringEncoding()

Argument

Type

Description

encoding

string

The string encoding to use for this object.


Table 59. Return Values for TibrvCmSender::setStringEncoding()

Return Type

Description

n/a

This method returns no value


Table 60. Exceptions thrown by TibrvCmSender::setStringEncoding()

err

desc

TIBRVCMSENDER-SETSTRINGENCODING-ERROR

missing encoding parameter from method call


TibrvCmSender::getStringEncoding()

Synopsis

Returns the encoding used for the object

Usage
TibrvCmSender::getStringEncoding()

Table 61. Arguments for TibrvCmSender::getStringEncoding()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 62. Return Values for TibrvCmSender::getStringEncoding()

Return Type

Description

string

The encoding used for the object.


TibrvCmSender::connectToRelayAgent()

Synopsis

If a relay agent was specified in the object's constructor, this method will asynchronously connect to the relay agent.

Usage
TibrvCmSender::connectToRelayAgent()

Table 63. Arguments for TibrvCmSender::connectToRelayAgent()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 64. Return Values for TibrvCmSender::connectToRelayAgent()

Return Type

Description

n/a

This method returns no value


Table 65. Exceptions thrown by TibrvCmSender::connectToRelayAgent()

err

desc

TIBRV-CONNECT-TO-RELAY-AGENT-ERROR

An error occurred making this call (ex: no relay agent was specified in the constructor)


TibrvCmSender::disconnectFromRelayAgent()

Synopsis

If the transport is connected to the relay agent, this method will asynchronously disconnect from the relay agent.

Usage
TibrvCmSender::disconnectFromRelayAgent()

Table 66. Arguments for TibrvCmSender::disconnectFromRelayAgent()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 67. Return Values for TibrvCmSender::disconnectFromRelayAgent()

Return Type

Description

n/a

This method returns no value


Table 68. Exceptions thrown by TibrvCmSender::disconnectFromRelayAgent()

err

desc

TIBRV-DISCONNECT-FROM-RELAY-AGENT-ERROR

An error occurred making this call (ex: not connected to the relay agent)


TibrvCmSender::expireMssages()

Synopsis

Immediately marks certified messages matching both the subject name and the sequence number as expired

Usage
TibrvCmSender::expireMssages(subject, seq_no)

Table 69. Arguments for TibrvCmSender::expireMssages()

Argument

Type

Description

subject

string

The subject name (can contain wildcards) for messages to expire from the ledger.

seq_no

int

All messages less than or equal to this value (and matching the subject name) will be deleted.


Table 70. Return Values for TibrvCmSender::expireMssages()

Return Type

Description

n/a

This method returns no value


Table 71. Exceptions thrown by TibrvCmSender::expireMssages()

err

desc

TIBRV-CMSENDER-EXPIRE-MESSAGES-ERROR

missing subject name parameter

TIBRV-EXPIRE-MESSAGES-ERROR

an error occured expiring messages


TibrvCmSender::getName()

Synopsis

Returns the correspondent name of the object.

Usage
TibrvCmSender::getName()

Table 72. Arguments for TibrvCmSender::getName()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 73. Return Values for TibrvCmSender::getName()

Return Type

Description

string

The correspondent name of the object


Table 74. Exceptions thrown by TibrvCmSender::getName()

err

desc

TIBRV-GET-NAME-ERROR

An internal error occurred.


TibrvCmSender::getDefaultTimeLimit()

Synopsis

Returns the time limit in milliseconds for outbound certified messages. Zero means no time limit is in effect.

Usage
TibrvCmSender::getDefaultTimeLimit()

Table 75. Arguments for TibrvCmSender::getDefaultTimeLimit()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 76. Return Values for TibrvCmSender::getDefaultTimeLimit()

Return Type

Description

string

The correspondent name of the object


Table 77. Exceptions thrown by TibrvCmSender::getDefaultTimeLimit()

err

desc

TIBRV-GET-DEFAULT-TIME-LIMIT-ERROR

An internal error occurred.


TibrvCmSender::setDefaultTimeLimit()

Synopsis

Sets the time limit in milliseconds for outbound certified messages; use zero for no time limit.

Usage
TibrvCmSender::setDefaultTimeLimit(time_limit)

Table 78. Arguments for TibrvCmSender::setDefaultTimeLimit()

Argument

Type

Description

time_limit

int

time limit in milliseconds for outbound certified delivery; zero means no time limit.


Table 79. Return Values for TibrvCmSender::setDefaultTimeLimit()

Return Type

Description

n/a

This method returns no value


Table 80. Exceptions thrown by TibrvCmSender::setDefaultTimeLimit()

err

desc

TIBRV-SET-DEFAULT-TIME-LIMIT-ERROR

An internal error occurred.


TibrvCmSender::reviewLedger()

Synopsis

Query the ledger for items matching a subject name.

Usage
TibrvCmSender::reviewLedger(subject)

Table 81. Arguments for TibrvCmSender::reviewLedger()

Argument

Type

Description

subject

string

Subject name (wildcards accepted) for ledger review.


Table 82. Return Values for TibrvCmSender::reviewLedger()

Return Type

Description

list

The list of matching messages in the ledger.


Table 83. Exceptions thrown by TibrvCmSender::reviewLedger()

err

desc

TIBRV-CMSENDER-REVIEW-LEDGER-ERROR

missing subject parameter

TIBRV-REVIEW-LEDGER-ERROR

An internal error occurred.


TibrvCmSender::removeSendState()

Synopsis

Remove sequence accounting for obsolete subjects

Usage
TibrvCmSender::removeSendState(subject)

Table 84. Arguments for TibrvCmSender::removeSendState()

Argument

Type

Description

subject

string

Subject name (wildcards accepted) for subject names to reset.


Table 85. Return Values for TibrvCmSender::removeSendState()

Return Type

Description

n/a

This method returns no value


Table 86. Exceptions thrown by TibrvCmSender::removeSendState()

err

desc

TIBRV-REMOVE-SEND-STATE-ERROR

An internal error occurred.


TibrvCmSender::syncLedger()

Synopsis

Flushes the ledger to its storage medium (only useful for file-based ledgers)

Usage
TibrvCmSender::syncLedger()

Table 87. Arguments for TibrvCmSender::syncLedger()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 88. Return Values for TibrvCmSender::syncLedger()

Return Type

Description

n/a

This method returns no value


Table 89. Exceptions thrown by TibrvCmSender::syncLedger()

err

desc

TIBRV-SYNC-LEDGER-ERROR

An internal error occurred.


Tibrv::TibrvCmListener Class

The TibrvCmListener object is used to receive certified messages. To send certified messages, use the TibrvCmSender Class. Each TibrvCmListener object is set with a string encoding value, which is by default set to the default encoding for qore. Any strings received by this object will be assumed to be in this encoding. To set or check the encoding for TibrvCmListener objects, see the TibrvCmListener::setStringEncoding() and TibrvCmListener::getStringEncoding() methods.

Table 90. TibrvCmListener Class Method Overview

Method

Except?

Description

TibrvCmListener::constructor()

Y

Creates the TibrvCmListener object based on the parameters passed.

TibrvCmListener::destructor()

N

Destroys the TibrvCmListener object.

TibrvCmListener::copy()

Y

Copying objects of this class is not supported, an exception will be thrown.

TibrvCmListener::getMessage()

Y

Waits for a message event matching the subject string for this object.

TibrvCmListener::getQueueSize()

Y

Returns the number of messages in the queue.

TibrvCmListener::createInboxName()

Y

Creates a subject name that will be delivered by a point-to-point message directly to this listener object when used as a replySubject in an outgoing message.

TibrvCmListener::setStringEncoding()

Y

Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding.

TibrvCmListener::getStringEncoding()

N

Returns the character encoding used for the object

TibrvCmListener::getName()

Y

Returns the correspondent name of the object.

TibrvCmListener::syncLedger()

Y

Flushes the ledger to its storage medium (only useful for file-based ledgers)


TibrvCmListener::constructor()

Synopsis

Creates the TibrvCmListener object based on the parameters passed.

Usage
new TibrvCmListener(subject, [cmName], [requestOld], [ledgerName], [syncLedger], [relayAgent], [desc], [service], [network], [daemon])

Table 91. Arguments for TibrvCmListener::constructor()

Argument

Type

Description

subject

string

The subject to listen for (may contain wildcards, i.e. 'TEST.ADAPTER.>')

[cmName]

string

The name for the persistent correspondent for this object. The name must conform to Rendezvous subject naming conventions. If this argument is not passed, then a unique, non-reusable name will be generated for the duration of this object.

[requestOld]

bool

If True, then this object will require certified messages delivered to a previous instance with the same corres pondent name without a confirmed delivery to be redelivered.

[ledgerName]

string

If this argument is passed then the object will use a file-based ledger; if this argument is omitted the object will use a process-based ledger.

[syncLedger]

bool

If True no buffering will be made on changes to the ledger.

[relayAgent]

string

If this argument is present, it must be a reusable name for the relay agent for this Rendezvous transport

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 92. Return Values for TibrvCmListener::constructor()

Return Type

Description

Object

The TibrvCmListener object is returned


Table 93. Exceptions thrown by TibrvCmListener::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object

TIBRVCMLISTENER-CONSTRUCTOR-ERROR

there was an error creating the certified listener object (ex: invalid subject, etc)


TibrvCmListener::destructor()

Synopsis

Destroys the TibrvCmListener object.

Usage
delete lvalue

Table 94. Arguments for TibrvCmListener::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 95. Return Values for TibrvCmListener::destructor()

Return Type

Description

n/a

This method returns no value


TibrvCmListener::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Table 96. Exceptions thrown by TibrvCmListener::copy()

err

desc

TIBRVCMLISTENER-COPY-ERROR

objects of this class may not be copied


TibrvCmListener::getMessage()

Synopsis

Waits for a message event matching the subject string passed. If a timeout value is passed, then if no suitable event is received within the timeout period, NOTHING is returned. Note that this method may return before the timeout period has expired in case that an event is posted to the queue that does not contain message data. In this case the method returns as with a normal timeout.

Usage
TibrvCmListener::getMessage([timeout])

Table 97. Arguments for TibrvCmListener::getMessage()

Argument

Type

Description

[timeout]

int

The timeout value in milliseconds. Can also be a relative time (i.e. 1250ms) in order to make the units clear in the source. If no timeout value is passed to the method (or the timeout value is negative) then the timeout period is infinite, therefore it's recommended to send a timeout value.


Table 98. Return Values for TibrvCmListener::getMessage()

Return Type

Description

hash

The return hash will have the following keys: 'msg' containing the return message data, 'subject' giving the subject of the reply message, optionally 'replySubject' giving a subject name for a subsequent reply message, 'cmSender' giving the name of the certified sender, and 'cmSequence' giving the integer sequence number for this certified message.


Table 99. Exceptions thrown by TibrvCmListener::getMessage()

err

desc

TIBRVCMLISTENER-GETMESSAGE-ERROR

There was an error dispatching the event on the internal queue

TIBRV-DEMARSHALLING-ERROR

There was an error deserializing the Tibco Rendezvous data to a qore data structore


TibrvCmListener::getQueueSize()

Synopsis

Returns the number of messages in the queue.

Usage
TibrvCmListener::getQueueSize()

Table 100. Arguments for TibrvCmListener::getQueueSize()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 101. Return Values for TibrvCmListener::getQueueSize()

Return Type

Description

int

The number of messages in the queue.


Table 102. Exceptions thrown by TibrvCmListener::getQueueSize()

err

desc

TIBRVCMLISTENER-GETQUEUESIZE-ERROR

An internal error occurred.


TibrvCmListener::createInboxName()

Synopsis

Creates a subject name that will be delivered by a point-to-point message directly to this listener object when used as a replySubject in an outgoing message.

Usage
TibrvCmListener::createInboxName()

Table 103. Arguments for TibrvCmListener::createInboxName()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 104. Return Values for TibrvCmListener::createInboxName()

Return Type

Description

string

The string to use as a replySubject in an outgoing message to ensure that any reply will be a point-to-point reply directly to this listener object


Table 105. Exceptions thrown by TibrvCmListener::createInboxName()

err

desc

TIBRVCMLISTENER-CREATEINBOXNAME-ERROR

An error occurred creating the inbox name


TibrvCmListener::setStringEncoding()

Synopsis

Sets the string encoding for the object; any strings deserialized with this object will be tagged with this character encoding.

Usage
TibrvCmListener::setStringEncoding(encoding)

Table 106. Arguments for TibrvCmListener::setStringEncoding()

Argument

Type

Description

encoding

string

The string encoding to use for this object.


Table 107. Return Values for TibrvCmListener::setStringEncoding()

Return Type

Description

n/a

This method returns no value


Table 108. Exceptions thrown by TibrvCmListener::setStringEncoding()

err

desc

TIBRVCMLISTENER-SETSTRINGENCODING-ERROR

missing encoding parameter from method call


TibrvCmListener::getStringEncoding()

Synopsis

Returns the character encoding used for the object

Usage
TibrvCmListener::getStringEncoding()

Table 109. Arguments for TibrvCmListener::getStringEncoding()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 110. Return Values for TibrvCmListener::getStringEncoding()

Return Type

Description

string

The character encoding used for the object.


TibrvCmListener::getName()

Synopsis

Returns the correspondent name of the object.

Usage
TibrvCmListener::getName()

Table 111. Arguments for TibrvCmListener::getName()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 112. Return Values for TibrvCmListener::getName()

Return Type

Description

string

The correspondent name of the object


Table 113. Exceptions thrown by TibrvCmListener::getName()

err

desc

TIBRV-GET-NAME-ERROR

An internal error occurred.


TibrvCmListener::syncLedger()

Synopsis

Flushes the ledger to its storage medium (only useful for file-based ledgers)

Usage
TibrvCmListener::syncLedger()

Table 114. Arguments for TibrvCmListener::syncLedger()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 115. Return Values for TibrvCmListener::syncLedger()

Return Type

Description

n/a

This method returns no value


Table 116. Exceptions thrown by TibrvCmListener::syncLedger()

err

desc

TIBRV-SYNC-LEDGER-ERROR

An internal error occurred.


Tibrv::TibrvFtMember Class

The TibrvFtMember object is required to function as member of a Rendezvous fault tolerant group. To monitor a fault-tolerant group from outside the group, use the TibrvFtMonitor Class.

Table 117. TibrvFtMember Class Method Overview

Method

Except?

Description

TibrvFtMember::constructor()

Y

Creates the TibrvFtMember object based on the parameters passed.

TibrvFtMember::destructor()

N

Stops and destroys the TibrvFtMember object.

TibrvFtMember::copy()

Y

Copying objects of this class is not supported, an exception will be thrown.

TibrvFtMember::getEvent()

Y

Waits for a fault-tolerant event and returns a hash representing the event if possible.

TibrvFtMember::getGroupName()

N

Returns the name of the fault tolerant group.

TibrvFtMember::setWeight()

Y

Sets the member weight. Weight values must be between 1 and 65535; members with higher weight numbers take precedence over members with lower weight numbers.

TibrvFtMember::stop()

N

Signals fault-tolerant event processing to stop.


TibrvFtMember::constructor()

Synopsis

Creates the TibrvFtMember object based on the parameters passed.

Usage
new TibrvFtMember(group_name, weight, activeGoal, heartbeatInterval, preparationInterval, activationInterval, [desc], [service], [network], [daemon])

Table 118. Arguments for TibrvFtMember::constructor()

Argument

Type

Description

group_name

string

The fault tolerant group name (must confirm to Rendezvous subject-naming conventions)

weight

int

The relative weight of this member, higher numbers take precendence over lower numbers. Weight must be between 1 and 65535.

activeGoal

int

The number of active members for this group, must be between 1 and 65535.

heartbeatInterval

int

The interval in milliseconds for heartbeat messages for active members. This argument can also be specified with a relative date (for example, in milliseconds) to make the time units clear in the source code.

preparationInterval

int

The preparation interval in milliseconds (can also be specified with a relative date).

activationInterval

int

The activation interval in milliseconds (can also be specified with a relative date).

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 119. Return Values for TibrvFtMember::constructor()

Return Type

Description

Object

The TibrvFtMember object is returned


Table 120. Exceptions thrown by TibrvFtMember::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object

TIBRVFTMEMBER-CONSTRUCTOR-ERROR

parameter error, error creating the ftmember object (ex: invalid name, etc)


TibrvFtMember::destructor()

Synopsis

Stops and destroys the TibrvFtMember object.

Usage
delete lvalue

Table 121. Arguments for TibrvFtMember::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 122. Return Values for TibrvFtMember::destructor()

Return Type

Description

n/a

This method returns no value


TibrvFtMember::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Table 123. Exceptions thrown by TibrvFtMember::copy()

err

desc

TIBRVFTMEMBER-COPY-ERROR

objects of this class may not be copied


TibrvFtMember::getEvent()

Synopsis

Waits for a fault-tolerant event. If a timeout value is passed, then if no suitable event is received within the timeout period, NOTHING is returned. Note that this method may return before the timeout period has expired in case that an event is posted to the queue that is not applicable to fault-tolerant membership. In this case the method returns as with a normal timeout.

Usage
TibrvFtMember::getEvent([timeout])

Table 124. Arguments for TibrvFtMember::getEvent()

Argument

Type

Description

[timeout]

int

The timeout value in milliseconds. Can also be a relative time (i.e. 1250ms) in order to make the units clear in the source. If no timeout value is passed to the method (or the timeout value is negative) then the timeout period is infinite, therefore it's recommended to send a timeout value.


Table 125. Return Values for TibrvFtMember::getEvent()

Return Type

Description

hash

The return hash will have the following keys: 'action' giving an action code as defined in the Tibrv Constants table, and 'group', a string giving the name of the fault-tolerant group.


Table 126. Exceptions thrown by TibrvFtMember::getEvent()

err

desc

TIBRVFTMEMBER-GETEVENT-ERROR

There was an error posting the event on the internal queue


TibrvFtMember::getGroupName()

Synopsis

Returns the name of the fault tolerant group.

Usage
TibrvFtMember::getGroupName()

Table 127. Arguments for TibrvFtMember::getGroupName()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 128. Return Values for TibrvFtMember::getGroupName()

Return Type

Description

string

The name of the fault tolerant group.


TibrvFtMember::setWeight()

Synopsis

Sets the member weight. Weight values must be between 1 and 65535; members with higher weight numbers take precedence over members with lower weight numbers.

Usage
TibrvFtMember::setWeight(weight)

Table 129. Arguments for TibrvFtMember::setWeight()

Argument

Type

Description

weight

int

The weight to use for this member; must be between 1 and 65535.


Table 130. Return Values for TibrvFtMember::setWeight()

Return Type

Description

n/a

This method returns no value


Table 131. Exceptions thrown by TibrvFtMember::setWeight()

err

desc

TIBRVFTMEMBER-SETWEIGHT-ERROR

invalid weight value


TibrvFtMember::stop()

Synopsis

Signals fault-tolerant event processing to stop by placing the TIBRVFT_QORE_STOP message on the event queue. This message can be used, for example, when the event queue is processed in a dedicated thread; upon receiving this message the event thread should terminate.

Usage
TibrvFtMember::stop()

Table 132. Arguments for TibrvFtMember::stop()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 133. Return Values for TibrvFtMember::stop()

Return Type

Description

n/a

This method returns no value


Tibrv::TibrvFtMonitor Class

The TibrvFtMonitor object is used to monitor a Rendezvous fault tolerant group. To join a fault-tolerant group, see the TibrvFtMember Class.

Table 134. TibrvFtMonitor Class Method Overview

Method

Except?

Description

TibrvFtMonitor::constructor()

Y

Creates the TibrvFtMonitor object based on the parameters passed.

TibrvFtMonitor::destructor()

N

Stops and destroys the TibrvFtMonitor object.

TibrvFtMonitor::copy()

Y

Copying objects of this class is not supported, an exception will be thrown.

TibrvFtMonitor::getEvent()

Y

Waits for a fault-tolerant event and returns a hash representing the event if possible.

TibrvFtMonitor::getGroupName()

N

Returns the name of the fault tolerant group.

TibrvFtMonitor::stop()

N

Signals fault-tolerant monitoring event processing to stop.


TibrvFtMonitor::constructor()

Synopsis

Creates the TibrvFtMonitor object based on the parameters passed.

Usage
new TibrvFtMonitor(group_name, lostInterval, [desc], [service], [network], [daemon])

Table 135. Arguments for TibrvFtMonitor::constructor()

Argument

Type

Description

group_name

string

The fault tolerant group name to monitor (must confirm to Rendezvous subject-naming conventions)

lostInterval

int

When the heartbeat signal from a member has been silent for this interval in milliseconds (can also be specified with a relative date), the monitor object considers it lost. This value should be equal to the activation interval for group members.

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 136. Return Values for TibrvFtMonitor::constructor()

Return Type

Description

Object

The TibrvFtMonitor object is returned


Table 137. Exceptions thrown by TibrvFtMonitor::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object

TIBRVFTMONITOR-CONSTRUCTOR-ERROR

parameter error, error creating the object (ex: invalid name, etc)


TibrvFtMonitor::destructor()

Synopsis

Stops and destroys the TibrvFtMonitor object.

Usage
delete lvalue

Table 138. Arguments for TibrvFtMonitor::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 139. Return Values for TibrvFtMonitor::destructor()

Return Type

Description

n/a

This method returns no value


TibrvFtMonitor::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Usage
TibrvFtMonitor::copy()

Table 140. Arguments for TibrvFtMonitor::copy()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 141. Return Values for TibrvFtMonitor::copy()

Return Type

Description

n/a

This method returns no value


Table 142. Exceptions thrown by TibrvFtMonitor::copy()

err

desc

TIBRVFTMONITOR-COPY-ERROR

objects of this class may not be copied


TibrvFtMonitor::getEvent()

Synopsis

Waits for a fault-tolerant event. If a timeout value is passed, then if no suitable event is received within the timeout period, NOTHING is returned. Note that this method may return before the timeout period has expired in case that an event is posted to the queue that is not applicable to fault-tolerant membership monitoring. In this case the method returns as with a normal timeout.

Usage
TibrvFtMonitor::getEvent([timeout])

Table 143. Arguments for TibrvFtMonitor::getEvent()

Argument

Type

Description

[timeout]

int

The timeout value in milliseconds. Can also be a relative time (i.e. 1250ms) in order to make the units clear in the source. If no timeout value is passed to the method (or the timeout value is negative) then the timeout period is infinite, therefore it's recommended to send a timeout value.


Table 144. Return Values for TibrvFtMonitor::getEvent()

Return Type

Description

hash

In the case of a normal monitoring message, the return hash will have the following keys: 'numActiveMembers', an integer giving the number of active members in the group, and 'group', a string giving the name of the fault-tolerant group. However in the case that the stop message has been placed on the queue, the hash will have an 'action' member having the value TIBRVFT_QORE_STOP.


Table 145. Exceptions thrown by TibrvFtMonitor::getEvent()

err

desc

TIBRVFTMONITOR-GETEVENT-ERROR

There was an error posting the event on the internal queue


TibrvFtMonitor::getGroupName()

Synopsis

Returns the name of the fault tolerant group.

Usage
TibrvFtMonitor::getGroupName()

Table 146. Arguments for TibrvFtMonitor::getGroupName()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 147. Return Values for TibrvFtMonitor::getGroupName()

Return Type

Description

string

The name of the fault tolerant group.


TibrvFtMonitor::stop()

Synopsis

Signals fault-tolerant monitoring event processing to stop by placing the TIBRVFT_QORE_STOP message on the event queue. This message can be used, for example, when the event queue is processed in a dedicated thread; upon receiving this message the event thread should terminate.

Usage
TibrvFtMonitor::stop()

Table 148. Arguments for TibrvFtMonitor::stop()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 149. Return Values for TibrvFtMonitor::stop()

Return Type

Description

n/a

This method returns no value


Tibrv::TibrvDistributedQueue Class

The TibrvDistributedQueue object is used to participate in a distributed queue.

Table 150. TibrvDistributedQueue Class Method Overview

Method

Except?

Description

TibrvDistributedQueue::constructor()

Y

Creates the TibrvDistributedQueue object based on the parameters passed.

TibrvDistributedQueue::destructor()

N

Stops and destroys the TibrvDistributedQueue object.

TibrvDistributedQueue::copy()

Y

Copying objects of this class is not supported, an exception will be thrown.

TibrvDistributedQueue::getWorkerTasks()

Y

Returns the workerTasks value of this object.

TibrvDistributedQueue::getWorkerWeight()

Y

Returns the workerWeight value of this object.

TibrvDistributedQueue::setWorkerTasks()

Y

Sets a new workerTasks value for this object.

TibrvDistributedQueue::setWorkerWeight()

Y

Sets a new workerWeight value for this object.


TibrvDistributedQueue::constructor()

Synopsis

Creates the TibrvDistributedQueue object based on the parameters passed.

Usage
new TibrvDistributedQueue(queue_name, [workerWeight], [workerTasks], [schedulerWeight], [schedulerHeartbeat], [schedulerActivation], [desc], [service], [network], [daemon])

Table 151. Arguments for TibrvDistributedQueue::constructor()

Argument

Type

Description

queue_name

string

The distributed queue name (must confirm to Rendezvous subject-naming conventions)

[workerWeight]

int

Higher worker weights take precendence over lower numbers. When omitted, the value is one.

[workerTasks]

int

The maximum number of tasks a worker can accept. When omitted, the value is one.

[schedulerWeight]

int

The ability of this worker to take on the role of the scheduler. Higher numbers take precedence over lower numbers. Zero means the worker can never be a scheduler. The default value is one.

[schedulerHeartbeat]

int

The heartbeat interval in milliseconds (relative date/time values can also be used). All members of the distributed queue must use the same heartbeat value.

[schedulerActivation]

int

When the heartbeat value of the scheduler is silent for more than this number of milliseconds, a new scheduler will be assigned.

[desc]

string

The description for this transport object.

[service]

string

The service port number as a string

[network]

string

The network value

[daemon]

string

The remote rvd daemon's IP address


Table 152. Return Values for TibrvDistributedQueue::constructor()

Return Type

Description

Object

The TibrvDistributedQueue object is returned


Table 153. Exceptions thrown by TibrvDistributedQueue::constructor()

err

desc

TIBRVTRANSPORT-CONSTRUCTOR-ERROR

there was an error creating the transport object

TIBRVDISTRIBUTEDQUEUE-CONSTRUCTOR-ERROR

parameter error, error creating the object (ex: invalid name, etc)


TibrvDistributedQueue::destructor()

Synopsis

Stops and destroys the TibrvDistributedQueue object.

Usage
delete lvalue

Table 154. Arguments for TibrvDistributedQueue::destructor()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 155. Return Values for TibrvDistributedQueue::destructor()

Return Type

Description

n/a

This method returns no value


TibrvDistributedQueue::copy()

Synopsis

Copying objects of this class is not supported, an exception will be thrown.

Table 156. Exceptions thrown by TibrvDistributedQueue::copy()

err

desc

TIBRVDISTRIBUTEDQUEUE-COPY-ERROR

objects of this class may not be copied


TibrvDistributedQueue::getWorkerTasks()

Synopsis

Returns the workerTasks value of this object.

Usage
TibrvDistributedQueue::getWorkerTasks()

Table 157. Arguments for TibrvDistributedQueue::getWorkerTasks()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 158. Return Values for TibrvDistributedQueue::getWorkerTasks()

Return Type

Description

int

The workerTasks value of this object.


Table 159. Exceptions thrown by TibrvDistributedQueue::getWorkerTasks()

err

desc

TIBRVDISTRIBUTEDQUEUE-GETWORKERTASKS-ERROR

An internal error has occurred.


TibrvDistributedQueue::getWorkerWeight()

Synopsis

Returns the workerWeight value of this object.

Usage
TibrvDistributedQueue::getWorkerWeight()

Table 160. Arguments for TibrvDistributedQueue::getWorkerWeight()

Argument

Type

Description

n/a

n/a

This method takes no arguments.


Table 161. Return Values for TibrvDistributedQueue::getWorkerWeight()

Return Type

Description

int

The workerWeight value of this object.


Table 162. Exceptions thrown by TibrvDistributedQueue::getWorkerWeight()

err

desc

TIBRVDISTRIBUTEDQUEUE-GETWORKERWEIGHT-ERROR

An internal error has occurred.


TibrvDistributedQueue::setWorkerTasks()

Synopsis

Sets a new workerTasks value for this object.

Usage
TibrvDistributedQueue::setWorkerTasks(workerTasks)

Table 163. Arguments for TibrvDistributedQueue::setWorkerTasks()

Argument

Type

Description

workerTasks

int

The new workerTasks value of this object.


Table 164. Return Values for TibrvDistributedQueue::setWorkerTasks()

Return Type

Description

n/a

This method returns no value


Table 165. Exceptions thrown by TibrvDistributedQueue::setWorkerTasks()

err

desc

TIBRVDISTRIBUTEDQUEUE-SETWORKERTASKS-ERROR

An error occurred setting the new value.


TibrvDistributedQueue::setWorkerWeight()

Synopsis

Sets a new workerWeight value for this object.

Usage
TibrvDistributedQueue::setWorkerWeight(workerWeight)

Table 166. Arguments for TibrvDistributedQueue::setWorkerWeight()

Argument

Type

Description

workerWeight

int

The new workerWeight value of this object.


Table 167. Return Values for TibrvDistributedQueue::setWorkerWeight()

Return Type

Description

n/a

This method returns no value


Table 168. Exceptions thrown by TibrvDistributedQueue::setWorkerWeight()

err

desc

TIBRVDISTRIBUTEDQUEUE-SETWORKERWEIGHT-ERROR

An error occurred setting the new value.


tibrv Functions

tibrv_i8()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I8 data.

Usage
tibrv_i8(integer)

Table 169. Arguments and Return Values for tibrv_i8()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I8 data.


tibrv_u8()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U8 data.

Usage
tibrv_u8(integer)

Table 170. Arguments and Return Values for tibrv_u8()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U8 data.


tibrv_i16()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I16 data.

Usage
tibrv_i16(integer)

Table 171. Arguments and Return Values for tibrv_i16()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I16 data.


tibrv_u16()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U16 data.

Usage
tibrv_u16(integer)

Table 172. Arguments and Return Values for tibrv_u16()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U16 data.


tibrv_i32()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I32 data.

Usage
tibrv_i32(integer)

Table 173. Arguments and Return Values for tibrv_i32()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I32 data.


tibrv_u32()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U32 data.

Usage
tibrv_u32(integer)

Table 174. Arguments and Return Values for tibrv_u32()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U32 data.


tibrv_i64()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I64 data.

Usage
tibrv_i64(integer)

Table 175. Arguments and Return Values for tibrv_i64()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_I64 data.


tibrv_u64()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U64 data.

Usage
tibrv_u64(integer)

Table 176. Arguments and Return Values for tibrv_u64()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_U64 data.


tibrv_f32()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_F32 data.

Usage
tibrv_f32(float)

Table 177. Arguments and Return Values for tibrv_f32()

Argument Type

Return Type

Description

float

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_F32 data.


tibrv_f64()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_F64 data.

Usage
tibrv_f64(float)

Table 178. Arguments and Return Values for tibrv_f64()

Argument Type

Return Type

Description

float

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_F64 data.


tibrv_ipport16()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_IPPORT16 data.

Usage
tibrv_ipport16(integer)

Table 179. Arguments and Return Values for tibrv_ipport16()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_IPPORT16 data.


tibrv_ipaddr32()

Synopsis

Creates a hash structure to ensure that a qore string (ex. "192.168.1.1") is serialized as Rendezvous TIBRV_IPADDR32 data.

Usage
tibrv_ipaddr32(string)

Table 180. Arguments and Return Values for tibrv_ipaddr32()

Argument Type

Return Type

Description

string

hash

Creates a hash structure to ensure that a qore string (ex. "192.168.1.1") is serialized as Rendezvous TIBRV_IPADDR32 data.


tibrv_xml()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_XML data.

Usage
tibrv_xml(string)

Table 181. Arguments and Return Values for tibrv_xml()

Argument Type

Return Type

Description

string

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_XML data.


tibrv_bool()

Synopsis

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_BOOL data. Note that qore boolean values are automatically serialized as TIBRV_ BOOL values, so boolean() could be called as well with the same effect

Usage
tibrv_bool(integer)

Table 182. Arguments and Return Values for tibrv_bool()

Argument Type

Return Type

Description

int

hash

Creates a hash structure to ensure that qore data is serialized as Rendezvous TIBRV_BOOL data.