Package Reference

broker

broker.py is a Python interface to Webmethods EntireX Broker

The module loads the EntireX Broker stub:

  • broker.dll for 64-bit Python otherwise broker32.dll (on Windows)

  • libbroker.so shared library (on Unix)

broker.py defines the Broker class using the Advanced Communication interface (ACI) for communicating with the EntireX broker.

class adapya.entirex.broker.Broker(broker_id='localhost', user_id='monty', token=None, receive_length=2048, send_length=2048)[source]

Defines the essential Broker ACI functions using the Etbcb. For reference see EntireX Broker ACI Programming.

backout()[source]

Backout UOW but continue conversation

commit()[source]

Commit UOW but continue conversation

commitEndConversation()[source]

Commit UOW and end conversation

deregister()[source]

A server can deregister a service from EntireX Broker

endConversation(option=0)[source]

A client or server can terminate one or more conversations. This is the EOC function in ACI terms

kernelVersion()[source]

Determine Broker kernel version

logoff()[source]

Terminate communication with Broker kernel

logon(password=None, newpassword=None)[source]

Establish communication with a Broker kernel

receive(conv_id='', option=0, wait='')[source]

Used by clients to receive incoming messages and by servers to receive incoming requests

receiveNew(wait='')[source]

Receive any message from new conversation

register(option=0)[source]

Used by servers to inform EntireX Broker that a service is available

send(conv_id='', option=0)[source]

Used by clients to send requests and servers to send replies

syncpoint(option=0)[source]

Function allows to manage Units of Work (UOWs)

undo()[source]

Remove messages that have been sent out but not received

version()[source]

return the version of the EntireX Broker Stub

exception adapya.entirex.broker.BrokerError(value, etb)[source]

Subclass of BrokerException for Broker Error Responses

exception adapya.entirex.broker.BrokerException(value, etb)[source]

Instance will have set the following values:

self.value is the EXX Broker response string

self.etb is the Broker ACI call parameters that were used when

the error occurred

Example on how to call it:

try:
    raise BrokerException(value,etb)
except BrokerException as e:
    adalog.warning('BrokerException', e.value, e.__class__)
    dump(e.etb.error_buffer,log=adalog.warning)
exception adapya.entirex.broker.BrokerTimeOut(value, etb)[source]

Subclass of BrokerException for timeouts of requests to Broker

class adapya.entirex.broker.Etbcb(send_length=0, receive_length=0, use_api_version=7, **kw)[source]

Defines Broker control block with its attributes and Broker call()

exception adapya.entirex.broker.InterfaceError(value, etb)[source]

Subclass of BrokerException for Broker Interface Errors

class adapya.entirex.broker.ParmsBrokerService(broker_id='', user_id='', server_class='', server_name='', service='')[source]

Defines parameters for a Broker service

cmdinfo

cmdinfo.py interface to Webmethods EntireX Broker CIS Services and service explorer

Only a selection of the available fields is shown (see _FIELDS)

This covers the Broker API for Command and Information Services V9.7

Usage: cmdinfo [options]

Options:

-h, --help              display this help
-b, --broker ..         id of broker ETBxxxxx or hostname:port

-c, --class ..          Broker server class (selector)
-d  --detail            info request detailed conversation/uows
-n, --name ..           Broker server name (selector)
-k, --token ..          Token
-m, --maxinfo ..        Receive buffer length - default 32768
-o, --option ..         Option: QUIESCE, IMMED (first char suffices)
-p, --puid              Physical user id (selector)
-q, --seqno <int>       Sequence number (selector)
-s, --service ..        Broker service (selector)
                          short: -s class/server/service
-i, --infouid ..        user id for broker communication
-u, --userid ..         user id for information on active clients (selector)
-v, --convid ..         conversation id (selector)
-w, --uowid ..          unit of work (selector)
-x, --password ..       password
-t, --trace ..          sum of trace flags
                        1 - dump buffers before Broker call
                        2 -              after call
                        4 - print broker calls, short and data
                        8 - detailed print of buffers

CIS commands (default command: info)

-S, --shutdown          needs parameters convid or service or seqno (for server)
                         or userid/puid/token for client
-P, --purge <uowid>     psf remove uow from persistent store
-T, --btrace <level>    Broker trace on level 1-8, 0 switch off

Example:

1. show all services for broker class REPTOR and server MMSERV
   and related conversations, units of work and servers;
   show clients starting with userid MM
   show general broker information first::

     > cmdinfo -b zos3:3800 -u MM -s REPTOR/MMSERV/*

2. shutdown a participant identified by userid, service and/or conversation::

     > cmdinfo -b zos3:3800 -Su OUT4_Reader
                            -Ss REPTOR/MMSERV/OUT4
                            -Sv 1290000000000105
exception adapya.entirex.cmdinfo.CISError(value, epa)[source]
Example use:
try:

info = cis.iget(…)

except CISError as e:
if e.epa.cishdr.error_code == x:

print(‘

CIS error: %s on %s/%s/%s’ %(e.value,

sv.server_class,sv.server,sv.service))

class adapya.entirex.cmdinfo.Cishdr(**kw)[source]
class adapya.entirex.cmdinfo.Cisreq(**kw)[source]
reset(v=10)[source]

Reset values of the CIS Request instance

class adapya.entirex.cmdinfo.Infreq(**kw)[source]

Information request Structure Class

reset(v=10)[source]

reset values of the Information Request instance