LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
lsst::ctrl::events::CommandEvent Class Reference

Representation of an LSST CommandEvent. More...

#include <CommandEvent.h>

Inheritance diagram for lsst::ctrl::events::CommandEvent:
lsst::ctrl::events::Event

Public Member Functions

 CommandEvent ()
 Creates CommandEvent which contains a PropertySet consisting of an origination location ID and a destination location ID, plus additional properties. More...
 
 CommandEvent (LocationId const &originator, LocationId const &destination, boost::shared_ptr< PropertySet const > const &psp)
 Constructor for CommandEvent. More...
 
 CommandEvent (LocationId const &originator, LocationId const &destination, PropertySet const &ps)
 Constructor for CommandEvent. More...
 
 CommandEvent (LocationId const &originator, LocationId const &destination, PropertySet const &ps, PropertySet const &filterable)
 Constructor for CommandEvent. More...
 
 CommandEvent (std::string const &runid, LocationId const &originator, LocationId const &destination, boost::shared_ptr< PropertySet const > const &psp)
 Constructor for CommandEvent. More...
 
 CommandEvent (std::string const &runid, LocationId const &originator, LocationId const &destination, PropertySet const &ps)
 Constructor for CommandEvent. More...
 
 CommandEvent (std::string const &runid, LocationId const &originator, LocationId const &destination, PropertySet const &ps, PropertySet const &filterable)
 Constructor for CommandEvent. More...
 
 CommandEvent (cms::TextMessage *msg)
 Constructor for CommandEvent. More...
 
virtual ~CommandEvent ()
 destructor More...
 
LocationId::Ptr getOriginator () const
 retrieve an object containing the OriginatoDesination LocationId More...
 
LocationId::Ptr getDestination () const
 retrieve an object containing the OriginatoDesination LocationId More...
 
- Public Member Functions inherited from lsst::ctrl::events::Event
 Event ()
 Constructor for Event with no properties. More...
 
 Event (PropertySet const &properties)
 Constructor for Event. More...
 
 Event (PropertySet const &properties, PropertySet const &filterable)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet::Ptr const properties)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet const &properties)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet const &properties, PropertySet const &filterable)
 Constructor for Event. More...
 
 Event (cms::TextMessage *msg)
 Constructor for Event. More...
 
virtual ~Event ()
 destructor More...
 
PropertySet::Ptr getPropertySet () const
 retrieve the PropertySet for this Event More...
 
std::string getPubDate ()
 get the publication date of this Event, in ASCII More...
 
long long getPubTime ()
 get the publication time of this Event More...
 
void setPubTime (long long t)
 set the publication time of this Event More...
 
long long getEventTime ()
 get the event creation time More...
 
void setEventTime (long long nsecs)
 set the event creation time More...
 
void updateEventTime ()
 update the Event time to the current time More...
 
std::string getEventDate ()
 get the Event Date More...
 
std::string getRunId ()
 get the RunId for this Event More...
 
std::string getType ()
 get the Event type More...
 
std::string getStatus ()
 get the Event status More...
 
void setStatus (std::string status)
 set the Event status More...
 
void setTopic (std::string topic)
 set the Event topic More...
 
std::string getTopic ()
 get the Event topic More...
 
vector< std::string > getFilterablePropertyNames ()
 return all filterable property names More...
 
vector< std::string > getCustomPropertyNames ()
 return all custom property names More...
 
PropertySet::Ptr getCustomPropertySet () const
 return all custom property set More...
 
void marshall (cms::TextMessage *msg)
 marshall values in this event into a cms::TextMessage More...
 

Static Public Attributes

static const std::string ORIG_HOSTNAME = "ORIG_HOSTNAME"
 
static const std::string ORIG_PROCESSID = "ORIG_PROCESSID"
 
static const std::string ORIG_LOCALID = "ORIG_LOCALID"
 
static const std::string DEST_HOSTNAME = "DEST_HOSTNAME"
 
static const std::string DEST_PROCESSID = "DEST_PROCESSID"
 
static const std::string DEST_LOCALID = "DEST_LOCALID"
 
- Static Public Attributes inherited from lsst::ctrl::events::Event
static const std::string TYPE = "TYPE"
 
static const std::string EVENTTIME = "EVENTTIME"
 
static const std::string RUNID = "RUNID"
 
static const std::string STATUS = "STATUS"
 
static const std::string TOPIC = "TOPIC"
 
static const std::string PUBTIME = "PUBTIME"
 
static const std::string UNINITIALIZED = "uninitialized"
 

Private Member Functions

void _constructor (LocationId const &originator, LocationId const &destination)
 
virtual void populateHeader (cms::TextMessage *msg) const
 populate a cms::TextMessage header with properties More...
 
void _init ()
 

Additional Inherited Members

- Protected Member Functions inherited from lsst::ctrl::events::Event
void _init ()
 
void _constructor (std::string const &runid, PropertySet const &properties, PropertySet const &filterable)
 
template<typename T >
void add (std::string const &name, std::string const &tag, PropertySet const &properties, boost::property_tree::ptree &child)
 
- Protected Attributes inherited from lsst::ctrl::events::Event
PropertySet::Ptr _psp
 
PropertySet::Ptr _filterable
 
set< std::string > _keywords
 

Detailed Description

Representation of an LSST CommandEvent.

Definition at line 63 of file CommandEvent.h.

Constructor & Destructor Documentation

lsst::ctrl::events::CommandEvent::CommandEvent ( )

Creates CommandEvent which contains a PropertySet consisting of an origination location ID and a destination location ID, plus additional properties.

Definition at line 69 of file CommandEvent.cc.

69  : Event() {
70  _init();
71 }
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( LocationId const &  originator,
LocationId const &  destination,
boost::shared_ptr< PropertySet const > const &  psp 
)

Constructor for CommandEvent.

Parameters
originatororiginating location of this event
destinationdestination location for this event
pspPropertySet to pass in this event

Definition at line 100 of file CommandEvent.cc.

100  : Event(*psp) {
101  _constructor(originator, destination);
102 }
void _constructor(LocationId const &originator, LocationId const &destination)
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( LocationId const &  originator,
LocationId const &  destination,
PropertySet const &  ps 
)

Constructor for CommandEvent.

Parameters
originatororiginating location of this event
destinationdestination location for this event
psPropertySet to pass in this event

Definition at line 104 of file CommandEvent.cc.

104  : Event(ps) {
105  _constructor(originator, destination);
106 }
void _constructor(LocationId const &originator, LocationId const &destination)
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( LocationId const &  originator,
LocationId const &  destination,
PropertySet const &  ps,
PropertySet const &  filterable 
)

Constructor for CommandEvent.

Parameters
originatororiginating location of this event
destinationdestination location for this event
psPropertySet to pass in this event
filterableadditional, broker-filterable, PropertySet parameters

Definition at line 108 of file CommandEvent.cc.

108  : Event(ps, filterable) {
109  _constructor(originator, destination);
110 }
void _constructor(LocationId const &originator, LocationId const &destination)
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( std::string const &  runid,
LocationId const &  originator,
LocationId const &  destination,
boost::shared_ptr< PropertySet const > const &  psp 
)

Constructor for CommandEvent.

Parameters
runidname of the run which this event is used in
originatororiginating location of this event
destinationdestination location for this event
pspPropertySet to pass in this event

Definition at line 112 of file CommandEvent.cc.

112  : Event(runId, *psp) {
113  _constructor(originator, destination);
114 }
void _constructor(LocationId const &originator, LocationId const &destination)
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( std::string const &  runid,
LocationId const &  originator,
LocationId const &  destination,
PropertySet const &  ps 
)

Constructor for CommandEvent.

Parameters
runidname of the run which this event is used in
originatororiginating location of this event
destinationdestination location for this event
psPropertySet to pass in this event

Definition at line 116 of file CommandEvent.cc.

116  : Event(runId, ps) {
117  _constructor(originator, destination);
118 }
void _constructor(LocationId const &originator, LocationId const &destination)
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( std::string const &  runid,
LocationId const &  originator,
LocationId const &  destination,
PropertySet const &  ps,
PropertySet const &  filterable 
)

Constructor for CommandEvent.

Parameters
runidname of the run which this event is used in
originatororiginating location of this event
destinationdestination location for this event
psPropertySet to pass in this event
filterableadditional, broker-filterable, PropertySet parameters

Definition at line 120 of file CommandEvent.cc.

120  : Event(runId, ps, filterable) {
121  _constructor(originator, destination);
122 }
void _constructor(LocationId const &originator, LocationId const &destination)
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::CommandEvent::CommandEvent ( cms::TextMessage *  msg)

Constructor for CommandEvent.

Parameters
msga cms::TextMessage to convert into a CommandEvent

Definition at line 86 of file CommandEvent.cc.

86  : Event(msg) {
87  _init();
88 
89 
90  _psp->set(ORIG_HOSTNAME, (std::string)msg->getStringProperty(ORIG_HOSTNAME));
91  _psp->set(ORIG_PROCESSID, (int)msg->getIntProperty(ORIG_PROCESSID));
92  _psp->set(ORIG_LOCALID, (int)msg->getIntProperty(ORIG_LOCALID));
93 
94  _psp->set(DEST_HOSTNAME, (std::string)msg->getStringProperty(DEST_HOSTNAME));
95  _psp->set(DEST_PROCESSID, (int)msg->getIntProperty(DEST_PROCESSID));
96  _psp->set(DEST_LOCALID, (int)msg->getIntProperty(DEST_LOCALID));
97 
98 }
static const std::string DEST_LOCALID
Definition: CommandEvent.h:72
static const std::string ORIG_HOSTNAME
Definition: CommandEvent.h:66
PropertySet::Ptr _psp
Definition: Event.h:236
static const std::string ORIG_PROCESSID
Definition: CommandEvent.h:67
static const std::string DEST_PROCESSID
Definition: CommandEvent.h:71
static const std::string ORIG_LOCALID
Definition: CommandEvent.h:68
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
static const std::string DEST_HOSTNAME
Definition: CommandEvent.h:70
lsst::ctrl::events::CommandEvent::~CommandEvent ( )
virtual

destructor

Definition at line 169 of file CommandEvent.cc.

169  {
170 }

Member Function Documentation

void lsst::ctrl::events::CommandEvent::_constructor ( LocationId const &  originator,
LocationId const &  destination 
)
private

private method common to all constructors containing, originator, the originating location of this event, and destination, the destination location for this event.

Definition at line 128 of file CommandEvent.cc.

128  {
129  _init();
130 
131  _psp->set(ORIG_HOSTNAME, originator.getHostName());
132  _psp->set(ORIG_PROCESSID, originator.getProcessID());
133  _psp->set(ORIG_LOCALID, originator.getLocalID());
134 
135  _psp->set(DEST_HOSTNAME, destination.getHostName());
136  _psp->set(DEST_PROCESSID, destination.getProcessID());
137  _psp->set(DEST_LOCALID, destination.getLocalID());
138 
140 
141 }
static const std::string DEST_LOCALID
Definition: CommandEvent.h:72
static const std::string ORIG_HOSTNAME
Definition: CommandEvent.h:66
PropertySet::Ptr _psp
Definition: Event.h:236
static const std::string ORIG_PROCESSID
Definition: CommandEvent.h:67
static const std::string DEST_PROCESSID
Definition: CommandEvent.h:71
static const std::string ORIG_LOCALID
Definition: CommandEvent.h:68
static const std::string TYPE
Definition: Event.h:66
static const std::string DEST_HOSTNAME
Definition: CommandEvent.h:70
static const std::string COMMAND
Definition: EventTypes.h:49
void lsst::ctrl::events::CommandEvent::_init ( )
private

private method to initialize the CommandEvent

Definition at line 76 of file CommandEvent.cc.

76  {
77  _keywords.insert(ORIG_HOSTNAME);
78  _keywords.insert(ORIG_PROCESSID);
79  _keywords.insert(ORIG_LOCALID);
80 
81  _keywords.insert(DEST_HOSTNAME);
82  _keywords.insert(DEST_PROCESSID);
83  _keywords.insert(DEST_LOCALID);
84 }
static const std::string DEST_LOCALID
Definition: CommandEvent.h:72
static const std::string ORIG_HOSTNAME
Definition: CommandEvent.h:66
static const std::string ORIG_PROCESSID
Definition: CommandEvent.h:67
static const std::string DEST_PROCESSID
Definition: CommandEvent.h:71
set< std::string > _keywords
Definition: Event.h:238
static const std::string ORIG_LOCALID
Definition: CommandEvent.h:68
static const std::string DEST_HOSTNAME
Definition: CommandEvent.h:70
LocationId::Ptr lsst::ctrl::events::CommandEvent::getDestination ( ) const

retrieve an object containing the OriginatoDesination LocationId

Definition at line 162 of file CommandEvent.cc.

162  {
163  std::string hostname = _psp->get<std::string>(DEST_HOSTNAME);
164  int pid = _psp->get<int>(DEST_PROCESSID);
165  int local = _psp->get<int>(DEST_LOCALID);
166  return LocationId::Ptr(new LocationId(hostname, pid, local));
167 }
static const std::string DEST_LOCALID
Definition: CommandEvent.h:72
PropertySet::Ptr _psp
Definition: Event.h:236
boost::shared_ptr< LocationId > Ptr
Definition: LocationId.h:52
static const std::string DEST_PROCESSID
Definition: CommandEvent.h:71
static const std::string DEST_HOSTNAME
Definition: CommandEvent.h:70
LocationId::Ptr lsst::ctrl::events::CommandEvent::getOriginator ( ) const

retrieve an object containing the OriginatoDesination LocationId

Definition at line 155 of file CommandEvent.cc.

155  {
156  std::string hostname = _psp->get<std::string>(ORIG_HOSTNAME);
157  int pid = _psp->get<int>(ORIG_PROCESSID);
158  int local = _psp->get<int>(ORIG_LOCALID);
159  return LocationId::Ptr(new LocationId(hostname, pid, local));
160 }
static const std::string ORIG_HOSTNAME
Definition: CommandEvent.h:66
PropertySet::Ptr _psp
Definition: Event.h:236
static const std::string ORIG_PROCESSID
Definition: CommandEvent.h:67
boost::shared_ptr< LocationId > Ptr
Definition: LocationId.h:52
static const std::string ORIG_LOCALID
Definition: CommandEvent.h:68
void lsst::ctrl::events::CommandEvent::populateHeader ( cms::TextMessage *  msg) const
privatevirtual

populate a cms::TextMessage header with properties

Parameters
[in]msga cms::TextMessage

Reimplemented from lsst::ctrl::events::Event.

Definition at line 143 of file CommandEvent.cc.

143  {
145 
146  msg->setStringProperty(ORIG_HOSTNAME, _psp->get<std::string>(ORIG_HOSTNAME));
147  msg->setIntProperty(ORIG_PROCESSID, _psp->get<int>(ORIG_PROCESSID));
148  msg->setIntProperty(ORIG_LOCALID, _psp->get<int>(ORIG_LOCALID));
149 
150  msg->setStringProperty(DEST_HOSTNAME, _psp->get<std::string>(DEST_HOSTNAME));
151  msg->setIntProperty(DEST_PROCESSID, _psp->get<int>(DEST_PROCESSID));
152  msg->setIntProperty(DEST_LOCALID, _psp->get<int>(DEST_LOCALID));
153 }
static const std::string DEST_LOCALID
Definition: CommandEvent.h:72
static const std::string ORIG_HOSTNAME
Definition: CommandEvent.h:66
PropertySet::Ptr _psp
Definition: Event.h:236
static const std::string ORIG_PROCESSID
Definition: CommandEvent.h:67
static const std::string DEST_PROCESSID
Definition: CommandEvent.h:71
virtual void populateHeader(cms::TextMessage *msg) const
populate a cms::TextMessage header with properties
Definition: Event.cc:241
static const std::string ORIG_LOCALID
Definition: CommandEvent.h:68
static const std::string DEST_HOSTNAME
Definition: CommandEvent.h:70

Member Data Documentation

const std::string lsst::ctrl::events::CommandEvent::DEST_HOSTNAME = "DEST_HOSTNAME"
static

Definition at line 70 of file CommandEvent.h.

const std::string lsst::ctrl::events::CommandEvent::DEST_LOCALID = "DEST_LOCALID"
static

Definition at line 72 of file CommandEvent.h.

const std::string lsst::ctrl::events::CommandEvent::DEST_PROCESSID = "DEST_PROCESSID"
static

Definition at line 71 of file CommandEvent.h.

const std::string lsst::ctrl::events::CommandEvent::ORIG_HOSTNAME = "ORIG_HOSTNAME"
static

Definition at line 66 of file CommandEvent.h.

const std::string lsst::ctrl::events::CommandEvent::ORIG_LOCALID = "ORIG_LOCALID"
static

Definition at line 68 of file CommandEvent.h.

const std::string lsst::ctrl::events::CommandEvent::ORIG_PROCESSID = "ORIG_PROCESSID"
static

Definition at line 67 of file CommandEvent.h.


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