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>
Public Member Functions | |
AbstractServerAction (ServerActionConfig &actionConfig, const AbstractServiceLocator *serviceLocator, const std::map< std::string, const AbstractServiceLocator * > serviceLocatorRelatedClasses) | |
virtual | ~AbstractServerAction () |
virtual void | execute (RequestEvent *evt, AbstractDevice &dev, const rdaData &filter, rdaData &data, IOType ioType, RequestType reqType)=0 |
This method is executed by a property when it's requested and it isn't global. | |
virtual bool | needFilter () |
virtual void | performCommit (MultiplexingContext &transactionCtxt, AbstractDevice *transactionDevice)=0 |
virtual void | performRollback (MultiplexingContext &transactionCtxt, AbstractDevice *transactionDevice)=0 |
const std::string & | getName () |
virtual void | printConfig (FesaStream *configStream) |
this method prints the action configuration into the stream passed by argument | |
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 | |
Static Public Member Functions | |
static void | releaseStaticObjects () |
Protected Member Functions | |
void | checkInvalidatingFields (AbstractDevice *device, MultiplexingContext *ctx) |
this function is supposed to throw the exception when any of the invalidating fault-fields or alarm-fields is raised (set to true) | |
void | notify (MultiplexingContext &transactionCtxt, AbstractDevice &device, RequestType reqType=GET) |
this method notifies the properties in the server action | |
Protected Attributes | |
std::vector< std::string > | notifiedPropertiesCol_ |
std::vector< std::string > | disablingFieldNamesCol_ |
std::vector< std::string > | disablingGlobalFieldNamesCol_ |
bool | partialSetIsAllowed_ |
true if the property can be partially set | |
bool | needFilter_ |
true if the action contains filter | |
bool | autoNotification_ |
bool | transactionalSetIsAllowed_ |
bool | defaultImpl_ |
true if the server action has a default implementation | |
AbstractDevice * | pGlobalDevice_ |
Pointer to the Global Device. | |
NotificationProducer * | theNotificationProducer_ |
the notification producer is used to send properties' notifications to the server side |
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.
Definition at line 81 of file AbstractServerAction.h.
fesa::AbstractServerAction::AbstractServerAction | ( | ServerActionConfig & | actionConfig, | |
const AbstractServiceLocator * | serviceLocator, | |||
const std::map< std::string, const AbstractServiceLocator * > | serviceLocatorRelatedClasses | |||
) |
actionConfig | which contains all the attributes to create the action |
Definition at line 22 of file AbstractServerAction.cpp.
References fesa::NotificationProducer::getInstance(), and theNotificationProducer_.
fesa::AbstractServerAction::~AbstractServerAction | ( | ) | [virtual] |
Definition at line 33 of file AbstractServerAction.cpp.
void fesa::AbstractServerAction::checkInvalidatingFields | ( | AbstractDevice * | device, | |
MultiplexingContext * | ctx | |||
) | [protected] |
this function is supposed to throw the exception when any of the invalidating fault-fields or alarm-fields is raised (set to true)
Definition at line 43 of file AbstractServerAction.cpp.
References disablingFieldNamesCol_, disablingGlobalFieldNamesCol_, FesaErrorActionDisabledByFaultField, fesa::FaultField< DataType >::getDescription(), fesa::AbstractServerEquipment::getDeviceClassFromDeviceName(), fesa::DataStore::getField(), fesa::AbstractServerEquipment::getInstance(), fesa::AbstractDevice::getName(), fesa::FaultField< DataType >::isRaised(), and pGlobalDevice_.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute().
virtual void fesa::AbstractServerAction::execute | ( | RequestEvent * | evt, | |
AbstractDevice & | dev, | |||
const rdaData & | filter, | |||
rdaData & | data, | |||
IOType | ioType, | |||
RequestType | reqType | |||
) | [pure virtual] |
This method is executed by a property when it's requested and it isn't global.
evt | ||
dev | ||
filter | ||
data | ||
ioType | ||
updateFlags |
Implemented in fesa::GetDiagnosticSetting, fesa::ServerAction< DeviceType, DataType, FilterType >, and fesa::SetDiagnosticSetting.
Referenced by fesa::Property::get(), and fesa::Property::set().
const std::string & fesa::AbstractServerAction::getName | ( | ) | [inline] |
Reimplemented from fesa::AbstractAction.
Definition at line 199 of file AbstractServerAction.h.
References fesa::AbstractAction::name_.
Referenced by fesa::SetDiagnosticSetting::execute(), and fesa::GetDiagnosticSetting::execute().
bool fesa::AbstractServerAction::needFilter | ( | ) | [virtual] |
Reimplemented in fesa::GetDiagnosticSetting, and fesa::SetDiagnosticSetting.
Definition at line 125 of file AbstractServerAction.cpp.
References needFilter_.
Referenced by fesa::Property::needFilter().
void fesa::AbstractServerAction::notify | ( | MultiplexingContext & | transactionCtxt, | |
AbstractDevice & | device, | |||
RequestType | reqType = GET | |||
) | [protected] |
this method notifies the properties in the server action
transactionCtxt | the multiplexing context to be notified | |
device | to be notified |
Definition at line 74 of file AbstractServerAction.cpp.
References fesa::AbstractServerEquipment::getDeviceClassFromDeviceName(), fesa::AbstractServerEquipment::getInstance(), fesa::AbstractDeviceClass::getName(), fesa::AbstractDevice::getName(), notifiedPropertiesCol_, fesa::NotificationProducer::sendManualNotification(), and theNotificationProducer_.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute().
virtual void fesa::AbstractServerAction::performCommit | ( | MultiplexingContext & | transactionCtxt, | |
AbstractDevice * | transactionDevice | |||
) | [pure virtual] |
virtual void fesa::AbstractServerAction::performRollback | ( | MultiplexingContext & | transactionCtxt, | |
AbstractDevice * | transactionDevice | |||
) | [pure virtual] |
void fesa::AbstractServerAction::printConfig | ( | FesaStream * | configStream | ) | [virtual] |
this method prints the action configuration into the stream passed by argument
configStream | in which the information will be printed |
Definition at line 93 of file AbstractServerAction.cpp.
References defaultImpl_, disablingFieldNamesCol_, disablingGlobalFieldNamesCol_, fesa::AbstractAction::name_, and notifiedPropertiesCol_.
Referenced by fesa::Property::printConfig().
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
fesaStream | in which the information will be printed |
Definition at line 120 of file AbstractServerAction.cpp.
void fesa::AbstractServerAction::releaseStaticObjects | ( | ) | [static] |
Definition at line 38 of file AbstractServerAction.cpp.
Referenced by fesa::AbstractServerEquipment::~AbstractServerEquipment().
bool fesa::AbstractServerAction::autoNotification_ [protected] |
Definition at line 163 of file AbstractServerAction.h.
bool fesa::AbstractServerAction::defaultImpl_ [protected] |
true if the server action has a default implementation
Definition at line 170 of file AbstractServerAction.h.
Referenced by printConfig().
std::vector<std::string> fesa::AbstractServerAction::disablingFieldNamesCol_ [protected] |
Definition at line 149 of file AbstractServerAction.h.
Referenced by checkInvalidatingFields(), and printConfig().
std::vector<std::string> fesa::AbstractServerAction::disablingGlobalFieldNamesCol_ [protected] |
Definition at line 151 of file AbstractServerAction.h.
Referenced by checkInvalidatingFields(), and printConfig().
bool fesa::AbstractServerAction::needFilter_ [protected] |
true if the action contains filter
Definition at line 161 of file AbstractServerAction.h.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute(), and needFilter().
std::vector<std::string> fesa::AbstractServerAction::notifiedPropertiesCol_ [protected] |
Definition at line 147 of file AbstractServerAction.h.
Referenced by notify(), and printConfig().
bool fesa::AbstractServerAction::partialSetIsAllowed_ [protected] |
true if the property can be partially set
Definition at line 156 of file AbstractServerAction.h.
Referenced by fesa::ServerAction< DeviceType, DataType, FilterType >::execute().
fesa::AbstractServerAction::pGlobalDevice_ [protected] |
Pointer to the Global Device.
Definition at line 176 of file AbstractServerAction.h.
Referenced by checkInvalidatingFields().
the notification producer is used to send properties' notifications to the server side
Definition at line 181 of file AbstractServerAction.h.
Referenced by AbstractServerAction(), and notify().
bool fesa::AbstractServerAction::transactionalSetIsAllowed_ [protected] |
Definition at line 165 of file AbstractServerAction.h.