ATLAS Offline Software
Loading...
Searching...
No Matches
python.sendEI_SPB_Lib.MSG Class Reference
Inheritance diagram for python.sendEI_SPB_Lib.MSG:
Collaboration diagram for python.sendEI_SPB_Lib.MSG:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, opt)
 isConnected (self)
 connect (self)
 close (self)
 sendMSG (self, msg)

Public Attributes

 brokers = opt.endpoint
 user = opt.user
 passcode = opt.passcode
 queue = opt.queue
 verbose = opt.verbose
 dummy = opt.dummy
 conn = None

Detailed Description

Definition at line 20 of file sendEI_SPB_Lib.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.sendEI_SPB_Lib.MSG.__init__ ( self,
opt )

Definition at line 22 of file sendEI_SPB_Lib.py.

22 def __init__(self, opt):
23
24 self.brokers = opt.endpoint
25 self.user = opt.user
26 self.passcode = opt.passcode
27 self.queue = opt.queue
28 self.verbose = opt.verbose
29 self.dummy = opt.dummy
30
31 self.conn = None
32

Member Function Documentation

◆ close()

python.sendEI_SPB_Lib.MSG.close ( self)

Definition at line 66 of file sendEI_SPB_Lib.py.

66 def close(self):
67 if self.conn is not None:
68 self.conn.disconnect()
69 self.conn = None
70

◆ connect()

python.sendEI_SPB_Lib.MSG.connect ( self)

Definition at line 39 of file sendEI_SPB_Lib.py.

39 def connect(self):
40
41 # prepare for connection
42 self.conn = None
43
44 if self.dummy:
45 return
46
47 log.debug("Broker IPs and ports to connect:")
48 for broker in self.brokers:
49 log.debug(" {:15s} {}".format(*broker))
50
51 # connect
52 conn = stomp.Connection(self.brokers)
53 conn.set_listener('', MyListener())
54 try:
55 if self.user is not None and self.passcode is not None:
56 log.debug("Conecting broker using user and password")
57 conn.connect(self.user, self.passcode, wait=True)
58 else:
59 conn.connect(wait=True)
60 except stomp.exception.ConnectFailedException:
61 # pass error to caller
62 raise
63
64 self.conn = conn
65

◆ isConnected()

python.sendEI_SPB_Lib.MSG.isConnected ( self)

Definition at line 33 of file sendEI_SPB_Lib.py.

33 def isConnected(self):
34 if self.conn is None:
35 return False
36 else:
37 return True
38

◆ sendMSG()

python.sendEI_SPB_Lib.MSG.sendMSG ( self,
msg )

Definition at line 71 of file sendEI_SPB_Lib.py.

71 def sendMSG(self, msg):
72
73 log.debug("Sending message. Len: {}".format(len(msg)))
74
75 # NON_PERSISTENT = "1"
76 PERSISTENT = "2"
77
78 if not self.dummy:
79 self.conn.send(self.queue, msg,
80 JMSDeliveryMode=PERSISTENT,
81 JMSExpiration=0)
82 if self.verbose > 2:
83 print(msg, file=sys.stderr)
84
85
86# ----------------------
87# listener
88# ----------------------
void print(char *figname, TCanvas *c1)

Member Data Documentation

◆ brokers

python.sendEI_SPB_Lib.MSG.brokers = opt.endpoint

Definition at line 24 of file sendEI_SPB_Lib.py.

◆ conn

python.sendEI_SPB_Lib.MSG.conn = None

Definition at line 31 of file sendEI_SPB_Lib.py.

◆ dummy

python.sendEI_SPB_Lib.MSG.dummy = opt.dummy

Definition at line 29 of file sendEI_SPB_Lib.py.

◆ passcode

python.sendEI_SPB_Lib.MSG.passcode = opt.passcode

Definition at line 26 of file sendEI_SPB_Lib.py.

◆ queue

python.sendEI_SPB_Lib.MSG.queue = opt.queue

Definition at line 27 of file sendEI_SPB_Lib.py.

◆ user

python.sendEI_SPB_Lib.MSG.user = opt.user

Definition at line 25 of file sendEI_SPB_Lib.py.

◆ verbose

python.sendEI_SPB_Lib.MSG.verbose = opt.verbose

Definition at line 28 of file sendEI_SPB_Lib.py.


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