endurox-java
Functions
unsolicited message handling group

Functions

UnsolCallback org.endurox.AtmiCtx.tpsetunsol (UnsolCallback cb)
 
native void org.endurox.AtmiCtx.tpnotify (ClientId clientid, TypedBuffer idata, long flags)
 
native void org.endurox.AtmiCtx.tpbroadcast (String lmid, String usrname, String cltname, TypedBuffer idata, long flags)
 
native int org.endurox.AtmiCtx.tpchkunsol ()
 

Detailed Description

Unsolicited message handling

Function Documentation

◆ tpbroadcast()

native void org.endurox.AtmiCtx.tpbroadcast ( String  lmid,
String  usrname,
String  cltname,
TypedBuffer  idata,
long  flags 
)

Broadcast a message to matched clients or send message to remove remote server's '@TPBROADNNN' service for local broadcasting. See tpbroadcast(3) manpage for more information.

Parameters
lmidcluster node id to which message shall be delivered. if flag TPREGEXMATCH is present, then regexp is used for the given string to match the cluster nodes to which message shall be delivered. Max string length is MAXTIDENT*2-1.
usrnamethis is reserved for future use.
cltnameexecutable name which shall be matched for notification delivery. If flag TPREGEXMATCH is set, then this is regular expression of the binary name to be matched. Max string length in bytes are MAXTIDENT*2-1.
idatainput typed buffer (can be null) for notification delivery
flagsfollowing broadcast flags may be set:
  • TPNOBLOCK Do not block on full client queue, instead return error.
  • TPNOTIME Do not timeout when waiting on full queue (TPNOBLOCK is not set).
  • TPSIGRSTRT Restart the system call in progress if interrupted by signal handler. This affects only underlaying mq_* function calls.
  • TPREGEXMATCH Match lmid (cluster node id) and cltname by assuming that these are regular expressions.
Exceptions
AtmiTPEINVALExceptionEnvironment variables not configured, see ex_env(5) page, or invalid parameters have been passed to the function, for example clientid, lmtid or username are set and they are invalid regular expressions (i.e. with TPREGEXMATCH set).
AtmiTPESYSTEExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.
AtmiTPEOSExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.

◆ tpchkunsol()

native int org.endurox.AtmiCtx.tpchkunsol ( )

Process received unsolicited messages and invoke callback set by tpsetunsol(). See tpchkunsol(3) manpage for more information.

Returns
Number of unsolicited messages processed
Exceptions
AtmiTPESYSTEMExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.
AtmiTPEOSExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.

◆ tpnotify()

native void org.endurox.AtmiCtx.tpnotify ( ClientId  clientid,
TypedBuffer  idata,
long  flags 
)

Send notification to clients See tpnotify(3) manpage for more information.

Parameters
clientidclient id (received in service call)
idatainput typed buffer
flagsvalid flags:
  • TPNOBLOCK Do not block on full client queue, instead return error.
  • TPNOTIME Do not timeout when waiting on full queue (TPNOBLOCK is not set).
  • TPSIGRSTRT Restart the system call in progress if interrupted by signal handler. This affects only underlaying mq_* function calls.
  • TPACK Reserved for future use, Enduro/X silently ignores this flag. Thus tpnotify() call does not get any acknowledgement signal that client is processed the message. This is limitation of Enduro/X.
Exceptions
AtmiTPEINVALExceptionEnvironment variables not configured, see ex_env(5) page, or invalid parameters have been passed to the function, for example clientid is NULL or corrupted.
AtmiTPENOENTExceptionThe local delivery was about to be performed (no remote client call) and the client process did not exist on local machine. This error will be reported regardless of the TPACK flag.
AtmiTPETIMEExceptionBlocking message delivery did timeout. Meaning that client queue was full and TPNOBLOCK nor TPNOTIME was set. Error is returned from local clients only regardless of the TPACK flag. If client resists on remote node, then this error can be returned only when time-out occurred while s ending message to then local bridge server.
AtmiTPEBLOCKExceptionClient queue was full and TPNOBLOCK flag was not specified.
AtmiTPESYSTEMExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.
AtmiTPEOSExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.

◆ tpsetunsol()

UnsolCallback org.endurox.AtmiCtx.tpsetunsol ( UnsolCallback  cb)

Register unsolicited message callback handler See tpsetunsol(3) manpage for more information.

Parameters
cbcallback handler
Returns
previous callback handler
Exceptions
AtmiTPEINVALExceptionEnvironment variables not configured, see ex_env(5) page.
AtmiTPESYSTEMExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.
AtmiTPEOSExceptionSystem failure occurred during serving. See logs i.e. user log, or debugs for more info.