OSB_LIB::RequestHandler Class Reference

Collaboration diagram for OSB_LIB::RequestHandler:

Collaboration graph
[legend]
List of all members.

Detailed Description

Process status requests of contract related entities.

Todo:
Declare a class Impl to hide implementation details (and to avoid exhaustive documentation:-) and define/use in the cc-file.
Todo:
The current processing logic breaks in the moment we really have >1 entity linked to a request.
Then we first need to set the preferred status of all entities and the apply the request for the cascading root only.

Definition at line 89 of file requesthandler.h.

Public Types

Public Member Functions

Support for RQS CORBA server.

Private Member Functions

Private Attributes

Classes


Member Enumeration Documentation

enum OSB_LIB::RequestHandler::Result

Possible results from status request processing:.

Enumerator:
resOk  Processing successful.
resProcessed  Request was already processed.
resSkipped  Processing skipped.

Either the request is in the future or not the next of the related entity.

resError  Request processed with errors.

Definition at line 92 of file requesthandler.h.


Constructor & Destructor Documentation

OSB_LIB::RequestHandler::RequestHandler ( AnCList ancList = 0  )  [explicit]

Constructor with optional A&C-list to use.

OSB_LIB::RequestHandler::~RequestHandler (  ) 

Destructor: delete A&C-list if applicable.

OSB_LIB::RequestHandler::RequestHandler ( const RequestHandler  )  [private]

Prevent copying until needed: not implemented.


Member Function Documentation

bool OSB_LIB::RequestHandler::changeAsStatus ( const OSB_DB::Session session,
Associate assoc,
StatusRequest request,
OsbErrors errors 
) [private]

Change the effective status of locked associate.

bool OSB_LIB::RequestHandler::changeCoStatus ( const OSB_DB::Session session,
Contract co,
StatusRequest request,
OsbErrors errors 
) [private]

Change the effective status of locked contract.

bool OSB_LIB::RequestHandler::changePpnStatus ( const OSB_DB::Session session,
PersProduct pp,
const Id< ProductNode > &  pnId,
StatusRequest request,
OsbErrors errors 
) [private]

Change the effective status of locked pers. node.

bool OSB_LIB::RequestHandler::changePpStatus ( const OSB_DB::Session session,
PersProduct pp,
StatusRequest request,
OsbErrors errors 
) [private]

Change the effective status of locked pers. product.

Result OSB_LIB::RequestHandler::changeStatus ( const OSB_DB::Session session,
StatusRequest request,
OsbErrors errors,
Tracker tracker 
) [private]

Change the status of the entity owning a request.

Result OSB_LIB::RequestHandler::checkEntities ( const StatusRequest request,
OsbErrors errors 
) [private]

Check the entities linked to a request.

bool OSB_LIB::RequestHandler::delRequest ( const OSB_DB::Session session,
const Id< StatusRequest > &  srqId 
)

Remove a status request from the database.

Parameters:
session Database session to use.
srqId Object id of the status request to delete.
Returns:
true if was removed from the database by the call to this function, else false.

void OSB_LIB::RequestHandler::finalizeRequest ( const OSB_DB::Session session,
const Result  result,
StatusRequest request,
OsbErrors errors 
) [private]

Store the request result in the database.

The function only has an effect if the request was processed, i.e., its result is not skipped or already done.

Note there was an error the caller of process() must first rollback the database transactions and afterwards update the request's status in the database and commit.

Associate& OSB_LIB::RequestHandler::lockAs ( const OSB_DB::Session session,
Id< Associate asId,
bool  lockParent 
) [private]

Lock and read an associate.

Contract& OSB_LIB::RequestHandler::lockCo ( const OSB_DB::Session session,
Id< Contract coId,
bool  lockParent 
) [private]

Lock and read a contract.

PersProduct& OSB_LIB::RequestHandler::lockPp ( const OSB_DB::Session session,
Id< PersProduct ppId,
bool  lockParent 
) [private]

Lock and read a pers. product.

Result OSB_LIB::RequestHandler::lockRequest ( const OSB_DB::Session session,
StatusRequest request 
) [private]

Lock a request in the database.

RequestHandler& OSB_LIB::RequestHandler::operator= ( const RequestHandler  )  [private]

Prevent assignment until needed: not implemented.

Result OSB_LIB::RequestHandler::process ( const OSB_DB::Session session,
StatusRequest request,
OsbErrors errors,
Tracker tracker = 0 
)

Process a status request.

Parameters:
session Database session to use.
request Status request to process.
errors Gets errors and warnings.
tracker Get notifications who is being processed.
request must exist in the database. Callers need not to read the status request itself: the function reads and locks the request.

If the function returns resError the caller must first rollback the transactions and then call StatusRequest::updApplied() on request.

Result OSB_LIB::RequestHandler::setAsPrefStatus ( const OSB_DB::Session session,
Associate as,
StatusRequest request,
OsbErrors errors 
) [private]

Set the preferred status of a locked associate.

Result OSB_LIB::RequestHandler::setCoPrefStatus ( const OSB_DB::Session session,
Contract co,
StatusRequest request,
OsbErrors errors 
) [private]

Set the preferred status of a locked contract.

Result OSB_LIB::RequestHandler::setPpnPrefStatus ( const OSB_DB::Session session,
PersProduct pp,
const Id< ProductNode > &  pnId,
StatusRequest request,
OsbErrors errors 
) [private]

Set the preferred status of a locked pers. node.

Result OSB_LIB::RequestHandler::setPpPrefStatus ( const OSB_DB::Session session,
PersProduct pp,
StatusRequest request,
OsbErrors errors 
) [private]

Set the preferred status of a locked pers. product.

Result OSB_LIB::RequestHandler::setPrefStatus ( const OSB_DB::Session session,
StatusRequest request,
OsbErrors errors,
Tracker tracker 
) [private]

Set the preferred status of all entities linked to a request.


Member Data Documentation

AnCList* OSB_LIB::RequestHandler::ancList_ [private]

Pointer to the A&C-list to use.

Definition at line 296 of file requesthandler.h.

LockList* OSB_LIB::RequestHandler::locks_ [private]

List of locked entities.

Definition at line 302 of file requesthandler.h.

bool OSB_LIB::RequestHandler::ownAncList_ [private]

Flag if the A&C-list is owned by the request handler.

Definition at line 298 of file requesthandler.h.

RequestLinks* OSB_LIB::RequestHandler::rqLinks_ [private]

List of entities linked to a request.

Definition at line 300 of file requesthandler.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:12:52 2006 for OSB Library by  doxygen 1.4.7