OSB_DB::ResourceGw Class Reference

List of all members.

Detailed Description

Access to table NETWORK_RESOURCE.

Definition at line 64 of file resource-gw.h.

Public Member Functions

Private Member Functions

Friends


Member Function Documentation

bool OSB_DB::ResourceGw::fetch ( const Session session,
OSB_LIB::Resource resource 
) const [private]

Read a resource from the database.

The function reads a resource as identified by its object id from the table NETWORK_RESOURCE.

Parameters:
session Database session to use.
resource Resource to populate.
Returns:
true if the resource was found in the database, else false.

OSB_LIB::Period OSB_DB::ResourceGw::getBounds ( const Session session,
const OSB_LIB::ResourceKey resourceKey,
const OSB_LIB::DateTime timestamp 
)

Get assignment boundaries of a resource.

The function determines the end of the previous and begin of the next assignment of a resource to a pers. product.

Parameters:
session Database session to use.
resourceKey Resource key for which to determine the personalized product.
timestamp Timestamp for which to search.
Returns:
A period who's from timestamp contains the end of the resource's previous assignment (or min. date time) and who's to timestamp contains the start of the next assignment (or max. date time).

OSB_LIB::Id<OSB_LIB::PersProduct> OSB_DB::ResourceGw::getPersProduct ( const Session session,
const OSB_LIB::ResourceKey resourceKey,
const OSB_LIB::DateTime timestamp,
OSB_LIB::Period assigned 
) const

Get the id of the personalized product.

Uses the resource key (resource type, resource number, the id of the network and network element) to determine the personalized product that has (had) the resource assigned at ts.

Parameters:
session Database session to use.
resourceKey Resource key to look for.
timestamp Date and time for which the personalized product should be determined. If ts is not set, the behavior of the function is undefined.
assigned Gets the time period containing timestamp, during which the resource was assigned to the personalized product.
If no pers. product is assigned to the resource at ts, the period will contain the end of the previous assignment and the begin of the next assignment.
Exceptions:
OsbException if more than one personalized product is found.
Returns:
The id of the personalized product having the resource assigned at ts. It is not set if at time ts the resource was not assigned.

bool OSB_DB::ResourceGw::getPersResourceStatus ( const Session session,
const OSB_LIB::Resource::Oid rid,
const OSB_LIB::DateTime ts,
OSB_LIB::Status status 
) [private]

Get the pers resource and its current status.

The function is implemented as explained for OSB_LIB::Resource::getPersResourceStatus(), see there for a detailed explanation of the parameters.

Parameters:
session Database session to use.
rid Resource for which to determine the status of the personalized node.
ts Timestamp for which to search.
status Gets the current effective status of the pers. node the which the resource is assigned at ts.
Exceptions:
OsbException 
  • if more than one pers. product node is found.
Returns:
True if the pers resource is found, false if at timestamp the resource is not assigned. In the latter case status is not modified.

bool OSB_DB::ResourceGw::getQuarantineDays ( const Session session,
OSB_LIB::ResourceType  rt,
long days 
) const [private]

Set the quarantine status a of resource in the database.

Parameters:
session Database session to use.
rt Resource type to look-up
days Gets the number of quarantine days, -1 if the resource type can not be reassigned.
Returns:
true if the number of quarantine days for rt could be determined, else false.

bool OSB_DB::ResourceGw::incObjVs ( const Session session,
OSB_LIB::Resource resource 
) [private]

Increment the object version of the resource in the database.

Parameters:
session Database session to use.
resource Resource for which to increment the object version. If the function returns true its object version is set to the new version in the database.
Returns:
true if increased, else false. The latter (usually) means that the resource was modified or deleted in the database.

bool OSB_DB::ResourceGw::insert ( const Session session,
OSB_LIB::Resource resource 
) const [private]

Insert a resource into the database.

Parameters:
session Database session to use.
resource Resource to insert.
Returns:
true in case of success, else false.
Exceptions:
OsbException 
  • resource number empty
  • resource number too long.
DbException 
  • unknown unique constraint violation.
If successful, the function set the object id of the resource.

OSB_LIB::ObjectStatus OSB_DB::ResourceGw::lock ( const Session session,
const OSB_LIB::Resource resource,
bool  noWait 
) [private]

Check the current object version of resource.

Parameters:
session Database session to use.
resource Resource to lock.
noWait Don't wait if locked by another session?
Returns:
The object version of resource as compared to its version in the database.

bool OSB_DB::ResourceGw::remove ( const Session session,
const OSB_LIB::Resource resource 
) const [private]

Delete a resource from the database.

Parameters:
session Database session to use.
resource Resource to delete.
Returns:
true if the resource does no more exist in the database after the function returns, else false.

bool OSB_DB::ResourceGw::updAssigned ( const Session session,
const OSB_LIB::Resource resource 
) const [private]

Set the first assignment date of the resource.

Parameters:
session Database session to use.
resource Resource for which to update the first assignment date.
Returns:
true if the resource was updated, else false.

bool OSB_DB::ResourceGw::updData ( const Session session,
const OSB_LIB::Resource resource 
) const [private]

Update resource data in the database.

Parameters:
session Database session to use.
resource Resource to update.
Returns:
true if the resource data was updated, else false.

void OSB_DB::ResourceGw::updStatus ( const Session session,
const OSB_LIB::Resource resource 
) const [private]

Update the status of a resource in the database.

Parameters:
session Database session to use.
resource Resource to update the status.
Updates the resource's status and quarantine end in the database as set in resource.


Friends And Related Function Documentation

friend class OSB_LIB::Resource [friend]

Only class Resource should use this gateway.

Definition at line 66 of file resource-gw.h.


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