This is the based class for all the server actions in the system which will be executed when a property is requested. TODO discuss the DataType parameter.
More...
#include <AbstractServerAction.h>
Inherits fesa::AbstractAction.
Inherited by fesa::GetDiagnosticSetting, fesa::GetMetrics, fesa::ServerAction< DeviceType, DataType, FilterType >, and fesa::SetDiagnosticSetting.
|
| AbstractServerAction (const ServerActionConfig &actionConfig, const AbstractServiceLocator *serviceLocator, const std::map< std::string, const AbstractServiceLocator * > &serviceLocatorRelatedClasses) |
|
virtual std::auto_ptr
< PropertyData > | executeGet (RequestEvent *event, AbstractDevice &device, const cmw::data::Data &filter)=0 |
|
virtual void | executeSet (RequestEvent *event, AbstractDevice &device, const PropertyData &propertyData, const cmw::data::Data &filter)=0 |
|
virtual bool | hasDataChanged (const RequestEvent &event, AbstractDevice &device, const cmw::data::Data &filter) const |
| Check if the data published by this server action's property changed The check will be done only during a subscription The default implementation always returns 'true'. It can be overridden by a FESA class developer. More...
|
|
virtual bool | needFilter () |
|
virtual bool | isPartialSetAllowed () |
|
virtual void | performCommit (boost::shared_ptr< MultiplexingContext > &transactionCtxt, AbstractDevice *transactionDevice)=0 |
| this method is executed to commit the transaction CRFESA-764 shouldn't be poor virtual
|
|
virtual void | performRollback (boost::shared_ptr< MultiplexingContext > &transactionCtxt, AbstractDevice *transactionDevice)=0 |
| this method is executed to rollback the transaction CRFESA-764 shouldn't be poor virtual
|
|
void | triggerOnDemandEventSource (const std::string &sourceName, const MultiplexingContext *context, const char *payload, std::size_t payloadSize, uint32_t msgPrio=DEFAULT_ON_DEMAND_MESSAGE_PRIO) |
|
void | triggerOnDemandEventSource (const std::string &sourceName, const MultiplexingContext *context, uint32_t msgPrio=DEFAULT_ON_DEMAND_MESSAGE_PRIO) |
|
virtual void | printConfig (FesaStream *configStream) |
| this method prints the action configuration into the stream passed by argument More...
|
|
virtual void | printState (FesaStream *fesaStream, double elapsedTime) |
| this method prints the actual state of the action (frequency of the completed actions) into the stream passed by argument More...
|
|
void | sendManualNotification (const MultiplexingContext *context) const |
| this method sends a manual notification message in order to notify the properties and devices specified in the message
|
|
void | resetManualNotification () const |
| Clears any registered properties/devices for the manual notification.
|
|
void | disableAutomaticNotification () |
|
void | enableAutomaticNotification () |
|
bool | isAutomaticNotificationDisabled () const |
|
|
std::string | name_ |
| name of the action
|
|
std::string | className_ |
| name of the FESA-class, which controls this action
|
|
NotificationProducer * | theNotificationProducer_ |
| the notification producer is used to send properties' notifications to the server side
|
|
std::set< std::string > | automaticallyNotifiedPropertiesCol_ |
| list of properties that will be notified automatically, after the action has finished
|
|
This is the based class for all the server actions in the system which will be executed when a property is requested. TODO discuss the DataType parameter.
Maps on demand producers to vectors of on demand messages.
fesa::AbstractServerAction::AbstractServerAction |
( |
const ServerActionConfig & |
actionConfig, |
|
|
const AbstractServiceLocator * |
serviceLocator, |
|
|
const std::map< std::string, const AbstractServiceLocator * > & |
serviceLocatorRelatedClasses |
|
) |
| |
- Parameters
-
actionConfig | which contains all the attributes to create the action |
Throws if any of the disabling fault-fields of the action is raised.
void fesa::AbstractServerAction::clearPendingOnDemandMessages |
( |
| ) |
|
|
protected |
Removes all messages from the pending on demand messages.
This method is called by a Property::get() and calls the user's get-server-action code. It returns a PropertyData object whose ownership is transferred to the caller.
- Parameters
-
device | the device to use |
event | object containing the context |
filter | optional filter data, may be empty |
- Returns
- a PropertyData object containing the result of the get action.
This method is called by a Property::set() and calls the user's set-server-action code.
- Parameters
-
device | the device to use |
event | object containing the context |
propertyData | a container object filled with the data to set |
filter | optional filter data, may be empty |
bool fesa::AbstractServerAction::hasDataChanged |
( |
const RequestEvent & |
event, |
|
|
AbstractDevice & |
device, |
|
|
const cmw::data::Data & |
filter |
|
) |
| const |
|
virtual |
Check if the data published by this server action's property changed The check will be done only during a subscription The default implementation always returns 'true'. It can be overridden by a FESA class developer.
- Parameters
-
event | The request event that triggered this server action |
device | The device this server action's property belongs to |
filter | The data filter |
- Returns
- 'true' if the data published by the property changed, 'false' otherwise
bool fesa::AbstractServerAction::isPartialSetAllowed |
( |
| ) |
|
|
virtual |
- Returns
- true if the action supports partial sets
bool fesa::AbstractServerAction::needFilter |
( |
| ) |
|
|
virtual |
- Returns
- true if the action needs a filter
void fesa::AbstractServerAction::notify |
( |
boost::shared_ptr< MultiplexingContext > & |
context, |
|
|
AbstractDevice & |
device, |
|
|
RequestType::RequestType |
reqType = RequestType::GET |
|
) |
| |
|
protected |
this method notifies the properties in the server action
- Parameters
-
transactionCtxt | the multiplexing context to be notified |
device | which triggers the notification |
void fesa::AbstractServerAction::printConfig |
( |
FesaStream * |
configStream | ) |
|
|
virtual |
this method prints the action configuration into the stream passed by argument
- Parameters
-
configStream | in which the information will be printed |
void fesa::AbstractServerAction::printState |
( |
FesaStream * |
fesaStream, |
|
|
double |
elapsedTime |
|
) |
| |
|
virtual |
this method prints the actual state of the action (frequency of the completed actions) into the stream passed by argument
- Parameters
-
fesaStream | in which the information will be printed |
void fesa::AbstractServerAction::registerAllAutomaticallyTriggeredOnDemandEventSources |
( |
const MultiplexingContext * |
context, |
|
|
const char * |
payload, |
|
|
std::size_t |
payloadSize, |
|
|
uint32_t |
msgPrio = DEFAULT_ON_DEMAND_MESSAGE_PRIO |
|
) |
| |
|
protected |
void fesa::AbstractServerAction::sendPendingOnDemandMessages |
( |
uint32_t |
synchronizationId | ) |
|
|
protected |
Sends pending On Demand messages. Sends all the messages contained in pendingOnDemandMessages_, and empties the vector.
- Parameters
-
synchronizationId | the synchronization id to wait for before executing the event |
void fesa::AbstractServerAction::triggerOnDemandEventSource |
( |
const std::string & |
sourceName, |
|
|
const MultiplexingContext * |
context, |
|
|
const char * |
payload, |
|
|
std::size_t |
payloadSize, |
|
|
uint32_t |
msgPrio = DEFAULT_ON_DEMAND_MESSAGE_PRIO |
|
) |
| |
This implementation delays the sending of the on demand event till after the execution of the action. This implementation delays the sending of the on demand event till after the execution of the action.
void fesa::AbstractServerAction::triggerOnDemandEventSource |
( |
const std::string & |
sourceName, |
|
|
const MultiplexingContext * |
context, |
|
|
uint32_t |
msgPrio = DEFAULT_ON_DEMAND_MESSAGE_PRIO |
|
) |
| |
This implementation delays the sending of the on demand event till after the execution of the action. This method is only here because of c++ overload resolution: even though it is virtual in the base class (AbstractAction), it needs to be present here to be visible to child classes. It does nothing but call the base implementation (which in turn call the version with the payload parameters).
The documentation for this class was generated from the following files:
- AbstractServerAction.h
- AbstractServerAction.cpp