ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.sendEI_SPB_Lib.MSG Class Reference
Inheritance diagram for python.sendEI_SPB_Lib.MSG:
Collaboration diagram for python.sendEI_SPB_Lib.MSG:

Public Member Functions

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

Public Attributes

 brokers
 
 user
 
 passcode
 
 queue
 
 verbose
 
 dummy
 
 conn
 

Detailed Description

Definition at line 20 of file sendEI_SPB_Lib.py.

Constructor & Destructor Documentation

◆ __init__()

def 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()

def 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()

def 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()

def 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()

def 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 # ----------------------

Member Data Documentation

◆ brokers

python.sendEI_SPB_Lib.MSG.brokers

Definition at line 24 of file sendEI_SPB_Lib.py.

◆ conn

python.sendEI_SPB_Lib.MSG.conn

Definition at line 31 of file sendEI_SPB_Lib.py.

◆ dummy

python.sendEI_SPB_Lib.MSG.dummy

Definition at line 29 of file sendEI_SPB_Lib.py.

◆ passcode

python.sendEI_SPB_Lib.MSG.passcode

Definition at line 26 of file sendEI_SPB_Lib.py.

◆ queue

python.sendEI_SPB_Lib.MSG.queue

Definition at line 27 of file sendEI_SPB_Lib.py.

◆ user

python.sendEI_SPB_Lib.MSG.user

Definition at line 25 of file sendEI_SPB_Lib.py.

◆ verbose

python.sendEI_SPB_Lib.MSG.verbose

Definition at line 28 of file sendEI_SPB_Lib.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28