Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Safir::Dob::EntityRequestBase Class Referenceabstract

Interface to receive entity requests. More...

#include <Safir/Dob/Consumer.h>

Inheritance diagram for Safir::Dob::EntityRequestBase:
Collaboration diagram for Safir::Dob::EntityRequestBase:

Public Member Functions

virtual ~EntityRequestBase ()
 Virtual destructor is needed since we have virtual member functions. More...
 
virtual void OnCreateRequest (const Safir::Dob::EntityRequestProxy entityRequestProxy, Safir::Dob::ResponseSenderPtr responseSender)=0
 Called when someone requests an entity to be created. More...
 
virtual void OnUpdateRequest (const Safir::Dob::EntityRequestProxy entityRequestProxy, Safir::Dob::ResponseSenderPtr responseSender)=0
 Called when someone requests an entity to be updated. More...
 
virtual void OnDeleteRequest (const Safir::Dob::EntityRequestProxy entityRequestProxy, Safir::Dob::ResponseSenderPtr responseSender)=0
 Called when someone requests an entity to be deleted. More...
 
- Public Member Functions inherited from Safir::Dob::Internal::ConsumerBase
virtual ~ConsumerBase ()
 

Detailed Description

Interface to receive entity requests.

Constructor & Destructor Documentation

virtual Safir::Dob::EntityRequestBase::~EntityRequestBase ( )
virtual

Virtual destructor is needed since we have virtual member functions.

Member Function Documentation

virtual void Safir::Dob::EntityRequestBase::OnCreateRequest ( const Safir::Dob::EntityRequestProxy  entityRequestProxy,
Safir::Dob::ResponseSenderPtr  responseSender 
)
pure virtual

Called when someone requests an entity to be created.

If the handler is registered as "HandlerDecidesInstanceId" the request does not contain an instance id, and the handler must decide which instance to use and must send this back to the requestor using an EntityIdResponse.

If the handler is registered as "RequestorDecidesInstanceId" the request contains an instance id, which the handler must use if is going to accept the request. If the instance cannot be used an error response must be sent. The handler must not send EntityIdResponse on successful create requests when it is registered as "RequestorDecidesInstanceId".

The receiver of the callback must send a response using the responseSender. It is possible to store the responseSender and send the response later after this method has returned. The responseSender is a smart-pointer which means that it will handle deletion of the underlaying object on its own.

Parameters
[in]entityRequestProxy- Proxy object containing request and meta information.
[in]responseSender- Used to send the response for the received request.
virtual void Safir::Dob::EntityRequestBase::OnDeleteRequest ( const Safir::Dob::EntityRequestProxy  entityRequestProxy,
Safir::Dob::ResponseSenderPtr  responseSender 
)
pure virtual

Called when someone requests an entity to be deleted.

The receiver of the callback must send a response using the responseSender. It is possible to store the responseSender and send the response later after this method has returned. The responseSender is a smart-pointer which means that it will handle deletion of the underlaying object on its own.

Parameters
[in]entityRequestProxy- Proxy object containing request information.
[in]responseSender- Used to send the response for the received request.
virtual void Safir::Dob::EntityRequestBase::OnUpdateRequest ( const Safir::Dob::EntityRequestProxy  entityRequestProxy,
Safir::Dob::ResponseSenderPtr  responseSender 
)
pure virtual

Called when someone requests an entity to be updated.

The receiver of the callback must send a response using the responseSender. It is possible to store the responseSender and send the response later after this method has returned. The responseSender is a smart-pointer which means that it will handle deletion of the underlaying object on its own.

Parameters
[in]entityRequestProxy- Proxy object containing request and meta information.
[in]responseSender- Used to send the response for the received request.