OSB_LIB::StatusRequest Class Reference

Collaboration diagram for OSB_LIB::StatusRequest:

Collaboration graph
[legend]
List of all members.

Detailed Description

Preferred activation status.

The class describes the request to change the perferred activation status of a contract related classes.

Definition at line 78 of file statusrequest.h.

Public Types

Public Member Functions

Get data members:
Set data members:

Private Member Functions

Static Private Member Functions

Private Attributes

Friends

Classes


Member Typedef Documentation

typedef Id<StatusRequest> OSB_LIB::StatusRequest::Oid

Typesave unique identifier, link to database table.

Definition at line 88 of file statusrequest.h.


Member Enumeration Documentation

enum OSB_LIB::StatusRequest::Cascade

Type of cascade flag.

See cascade() for details.

Enumerator:
cscdNone  No cascading of status request.
cscdOwner  Owner of cascading status request.
cscdByParent  Status request cascaded by parent.

Definition at line 98 of file statusrequest.h.


Constructor & Destructor Documentation

OSB_LIB::StatusRequest::StatusRequest ( const Oid oid = Oid()  )  [explicit]

Constructor with optional object id.

OSB_LIB::StatusRequest::StatusRequest ( const StatusValue  s,
const StatusReason::Oid r 
)

Construct with requested status and reason.


Member Function Documentation

const DateTime& OSB_LIB::StatusRequest::applied (  )  const

Date and time when the requested status was applied.

StatusRequest::Cascade OSB_LIB::StatusRequest::cascade (  )  const [inline]

Flag if the request is cascaded.

The flag is used only for the initial activation, i.e., created to activated; else it is silently ignored.

Definition at line 478 of file statusrequest.h.

References cascade_.

const DateTime& OSB_LIB::StatusRequest::entered (  )  const

Date and time when the status request was entered.

const std::string& OSB_LIB::StatusRequest::errCode (  )  const

The code of the first encountered error during processing.

It is empty if the request was processed without errors.

GeValidFrom OSB_LIB::StatusRequest::geValidFrom (  )  const

Get predicate for greater-equal comparision of validFrom().

static void OSB_LIB::StatusRequest::handleObjectStatus ( ObjectStatus  os,
const Oid id 
) [static, private]

Evalute the object status of a request.

Parameters:
os Object status to evaluate.
id The id of the request for which os is valid.
Exceptions:
ObjectDeleted 
ObjectModified 
ObjectBusy if noWait is true and the request is locked by another database session.

void OSB_LIB::StatusRequest::incObjVs ( const OSB_DB::Session session  )  [private]

Increment the object version by 1.

Parameters:
session Database session to use.
Exceptions:
OsbException (internal error) if the update of the object version in the database fails.
The function should be used only after a successful call of a lock() function.

void OSB_LIB::StatusRequest::lock ( const OSB_DB::Session session,
bool  noWait 
) const [private]

Lock a request in the database.

Parameters:
session Database session to use.
noWait Don't wait for database locks?
Exceptions:
OsbException from handleObjectStatus().

static void OSB_LIB::StatusRequest::lock ( const OSB_DB::Session session,
const Oid id,
bool  noWait 
) [static, private]

Lock a request in the database.

Parameters:
session Database session to use.
id The object id of the request to lock.
noWait Don't wait for database locks?
Exceptions:
OsbException from handleObjectStatus(), (ObjectModified is not applicable).

const StatusRequest::Oid OSB_LIB::StatusRequest::oid (  )  const [inline]

Get the id of the status request.

Definition at line 468 of file statusrequest.h.

References oid_.

Referenced by OSB_LIB::StatusRequests::Cmp::operator()().

void OSB_LIB::StatusRequest::read ( const OSB_DB::Session session,
bool  lockFirst 
) [private]

Read the status request from the database.

Parameters:
session Database session to use.
lockFirst Flag to lock the request before reading.
Exceptions:
OsbException if the request does not exist in the database.
OsbException from handleObjectStatus() if lockFirst is true.

void OSB_LIB::StatusRequest::read ( const OSB_DB::Session session  ) 

Read the status request from the database.

Parameters:
session Database session to use.
Exceptions:
OsbException if the request does not exist in the database.

const StatusReason::Oid OSB_LIB::StatusRequest::reason (  )  const

Reason for the requested status.

bool OSB_LIB::StatusRequest::remove ( const OSB_DB::Session session  )  [private]

Remove the status request from the database.

Parameters:
session Database session to use.
Returns:
true if was removed from the database by the call to this function, else false.
Exceptions:
OsbException from incObjVs().

const StatusValue OSB_LIB::StatusRequest::reqStatus (  )  const

Requested status of entity.

void OSB_LIB::StatusRequest::setCascade ( Cascade  cascade  ) 

Set the cascading flag, see cascade() for details.

Use cscdOwner to request a cascading initial activation, cscdByParent is used internally by the contractual entities.

void OSB_LIB::StatusRequest::setReqStatus ( const Status status  ) 

Set the requested status and reason.

void OSB_LIB::StatusRequest::setValidFrom ( const DateTime validFrom  ) 

Set date and time for the requested status.

const Status & OSB_LIB::StatusRequest::status (  )  const [inline]

Requested status and reason of entity.

Definition at line 473 of file statusrequest.h.

References reqStatus_.

void OSB_LIB::StatusRequest::updApplied ( const OSB_DB::Session session,
bool  noWait 
)

Mark the request as applied.

Parameters:
session Database session to use.
noWait Don't wait for database locks?
Exceptions:
OsbException from lock(const OSB_DB::Session&, bool) const, see there.
When calling the function, applied_ and errCode_ must be set to appropriate values.

const DateTime & OSB_LIB::StatusRequest::validFrom (  )  const [inline]

Date and time when the requested status becomes valid.

Definition at line 483 of file statusrequest.h.

References validFrom_.

Referenced by OSB_LIB::StatusRequests::Cmp::operator()(), and OSB_LIB::StatusRequest::GeValidFrom::operator()().


Friends And Related Function Documentation

friend struct ::StatusRequestRow [friend]

Allow to set all data members.

Definition at line 84 of file statusrequest.h.

friend class OSB_DB::StatusRequestGw [friend]

Allow to set the object id.

Definition at line 80 of file statusrequest.h.

friend class RequestHandler [friend]

Allow locking, removal and to set applied, error code.

Definition at line 82 of file statusrequest.h.


Member Data Documentation

DateTime OSB_LIB::StatusRequest::applied_ [private]

Date and time when the requested status was applied.

Definition at line 299 of file statusrequest.h.

Cascade OSB_LIB::StatusRequest::cascade_ [private]

Cascade flag, see cascade for details.

Definition at line 295 of file statusrequest.h.

Referenced by cascade().

DateTime OSB_LIB::StatusRequest::entered_ [private]

Date and time when the status request was entered.

Definition at line 301 of file statusrequest.h.

std::string OSB_LIB::StatusRequest::errCode_ [private]

The code of the first encountered error during processing.

Definition at line 303 of file statusrequest.h.

long OSB_LIB::StatusRequest::objVs_ [private]

The object version of the status request.

Definition at line 291 of file statusrequest.h.

Oid OSB_LIB::StatusRequest::oid_ [private]

Unique identification: database link.

Definition at line 289 of file statusrequest.h.

Referenced by oid().

Status OSB_LIB::StatusRequest::reqStatus_ [private]

Requested status of entity.

Definition at line 293 of file statusrequest.h.

Referenced by status().

DateTime OSB_LIB::StatusRequest::validFrom_ [private]

Date and time when the requested status becomes valid.

Definition at line 297 of file statusrequest.h.

Referenced by validFrom().


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