OSB_LIB::PersProductNode Class Reference

Collaboration diagram for OSB_LIB::PersProductNode:

Collaboration graph
[legend]
List of all members.

Detailed Description

Personalized nodes of a product.

A personalized product node is be created if two situations:

Remarks:
Copy constructor, destructor and assignment by compiler.

Definition at line 81 of file persproduct.h.

Public Types

Public Member Functions

Read access to data members
Personalized product item
Status changes:

Private Member Functions

Status changes:
They can only be called by the pers. product
which is the locking point for pers. nodes.

Maintain personalized product item

Private Attributes

Friends


Member Typedef Documentation

typedef Id2<PersProductNode> OSB_LIB::PersProductNode::Oid

Unique object identification: personalized product and product node.

A personalized product node is identified by:

Definition at line 95 of file persproduct.h.


Constructor & Destructor Documentation

OSB_LIB::PersProductNode::PersProductNode ( const Oid id  )  [inline]

Constructor with object id.

Definition at line 101 of file persproduct.h.


Member Function Documentation

const Id<PersProductItem> OSB_LIB::PersProductNode::addPersItem ( const OSB_DB::Session session,
std::auto_ptr< PersProductItem apPpi 
) [private]

Add an item to the personalized product node.

Add a personalized item entry to the database. Also add it to the persItems_ list. Pers. item id and pers. node id of the item will be set if successful.
The action is not allowed when the node is deactivated.

Parameters:
session Database session to use.
apPpi Auto pointer of the pers. item to add.
Returns:
The object id of the added pers. item,
It is not set if apPpi can not be added.
Exceptions:
OsbException 
  • personalized product node is deactivated
  • as specified by the gateway class.

void OSB_LIB::PersProductNode::assignItem ( std::auto_ptr< PersProductItem persItem  ) 

Assign a new pers. product item.

The function set the pers. product node id of persItem and adds it to the pers. product items list.

The function has no effect if the content of `persItem' is 0.

Remarks:
Callers of this member that need to work with the personalized item after calling the function should store the content of the auto pointer:
            PersProductNode pn(...);
            // Get an auto pointer of a pers. product item:
            PersProductItem::AutoPtr aItem = ...;
            // Work with the pers. item through the auto pointer:
            aItem->doSomething();
            PersProductItem* pItem = aItem.get();
            // Sets content of auto pointer to 0:
            pn.assignItem(aItem);
            // Work with the pers. item through the remembered pointer:
            pItem->doSomeOtherThing();
Parameters:
persItem Auto pointer with the pers. product item to assign.

bool OSB_LIB::PersProductNode::changeStatus ( const OSB_DB::Session session,
StatusChange change,
OsbErrors errors 
) [private]

Change the effective status of the pers. node.

Parameters:
session Database session to use.
change Copy of the status change to process, it contains the max. allowed effective status.
errors Gets errors and warnings.
Returns:
true if no error occurred during processing, else false.
Note:
Even if the function returns true, errors still may contain warnings.

const DateTime& OSB_LIB::PersProductNode::created (  )  const [inline]

Get the creating date of the personalized product node.

Definition at line 125 of file persproduct.h.

References created_.

bool OSB_LIB::PersProductNode::delPersItem ( const OSB_DB::Session session,
const Id< PersProductItem > &  ppiId 
) [private]

Remove a personalized product item.

Remove an entry from database, also remove it from list.

Parameters:
session Database session to use.
ppiId Object id of pers item to remove.
Returns:
true for success, false if the pers. item can not be found or its removal fails.
Exceptions:
OsbException 
  • object version of pers product conflict
  • as specified by the gateway class (see there).

const Status& OSB_LIB::PersProductNode::effStatus (  )  const [inline]

Get effective status.

Definition at line 131 of file persproduct.h.

References effStatus_.

const DateTime& OSB_LIB::PersProductNode::effStatusDate (  )  const [inline]

Get the date when effective status was (last) set.

Definition at line 137 of file persproduct.h.

References effStatusDate_.

const PersProductItem* OSB_LIB::PersProductNode::findPersItem ( const Id< PersProductItem > &  ppiId  )  const

Find a personalized product item by id.

Parameters:
ppiId Id of personalized product item to search for.
Returns:
Pointer to personalized product item or
NULL if no personalized item exists.

const PersProductItem& OSB_LIB::PersProductNode::getPersItem ( const Id< PersProductItem > &  ppiId  )  const

Find a personalized product item by id.

Parameters:
ppiId Id of personalized product item to search for.
Returns:
Reference to the found personalized product item.
Exceptions:
OsbException 
  • pers item not found.

const Oid& OSB_LIB::PersProductNode::oid (  )  const [inline]

Get object id.

Definition at line 107 of file persproduct.h.

References oid_.

const PersProductItems& OSB_LIB::PersProductNode::persItems (  )  const [inline]

Get list of personalized items of the pers. node.

Definition at line 119 of file persproduct.h.

References persItems_.

PersProduct::Oid OSB_LIB::PersProductNode::persProductId (  )  const [inline]

Get id of personalized product.

Definition at line 1507 of file persproduct.h.

References oid_.

const Status& OSB_LIB::PersProductNode::prefStatus (  )  const [inline]

Get prefer status.

Definition at line 143 of file persproduct.h.

References prefStatus_.

const DateTime& OSB_LIB::PersProductNode::prefStatusDate (  )  const [inline]

Get the date when the perferred status was (first) requested.

Definition at line 149 of file persproduct.h.

References prefStatusDate_.

ProductNode::Oid OSB_LIB::PersProductNode::productNodeId (  )  const [inline]

Get id of the related product node.

Remarks:
This id does not include the id of the "original" product that was subscribed. This id must be retrieved from the personalized product itself.

Definition at line 1513 of file persproduct.h.

References oid_.

bool OSB_LIB::PersProductNode::read ( const OSB_DB::Session session  ) 

Read the pers. node from the database.

Parameters:
session Database session to use.
Returns:
true if the pers. node was found, else false.
In the latter case the pers. node remains unchanged.
Exceptions:
OsbException in case of an illegal perferred or effective status.
It is unspecified if some data of the pers. node have changed.

void OSB_LIB::PersProductNode::readStatusChanges ( const OSB_DB::Session session,
const Period period 
)

Read status changes for a time period.

The function gets the status changes for a personalized product node.

Parameters:
session Database session to use.
period Time period covered by the status requests,
the upper boundary is not included.

void OSB_LIB::PersProductNode::readStatusRequests ( const OSB_DB::Session session,
const Period period 
)

Get status requests for a period of time.

The function reads the status requests for a personalized product node.

Parameters:
session Database session to use.
period Time period covered by the status requests,
the upper boundary is not included.

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

Delete a pers. product node from the database.

The function calls OSB_DB::PersProductGw::delPersProductNode() to remove the personalized node from the database.

Parameters:
session Database session to use.
Returns:
true if the pers node was found and deleted from the database.
Exceptions:
OsbException 
  • as specified by the gateway class
  • type specific exceptions out of delSpecific(...).

bool OSB_LIB::PersProductNode::requestStatus ( const OSB_DB::Session session,
const ProductNode node,
StatusRequest request,
OsbErrors errors 
) [private]

Change the preferred status of the pers. product node.

Parameters:
session Database session to use.
node Related product node, it is needed to check the correct configuration of the pers. node.
request Preferred status to set, see below.
errors Get warnings and errors during processing.
Returns:
true if the request is accepted, else false.
When calling the function, status must have the requested status set; if the status date is not set the system date is used.
If successful the request id, the requested date/time and the entry timestamp will be set.

OsbError OSB_LIB::PersProductNode::setPrefStatus ( const OSB_DB::Session session,
const StatusRequest request 
) [private]

Set the preferred status of the pers. node.

Parameters:
session Database session to use.
request Status request that triggered the change of the preferred status.
Returns:
The first encountered error.
Note:
Called by PersProduct only.

const StatusChanges& OSB_LIB::PersProductNode::statusChanges (  )  const [inline]

Read access to status changes.

Definition at line 155 of file persproduct.h.

References chngs_.

const StatusRequests& OSB_LIB::PersProductNode::statusRequests (  )  const [inline]

List of status requests.

Definition at line 161 of file persproduct.h.

References reqs_.

Id<PersProductItem> OSB_LIB::PersProductNode::updPersItem ( const OSB_DB::Session session,
PersProductItem ppi 
) [private]

Update a pers product item.

It will update a pers product item if the status of the node is created. Otherwise the old pers product item will be deassigned, a new pers product item create instead.

Parameters:
session Database session to use.
ppi Pers product item to update.
Returns:
The object id of the newly added pers. item,
It is not set if apPpi can not be added.


Friends And Related Function Documentation

friend class OSB_DB::PersProductGw [friend]

Definition at line 82 of file persproduct.h.

friend class PersProduct [friend]

Allow to insert or remove pers. node.

Definition at line 84 of file persproduct.h.


Member Data Documentation

StatusChanges OSB_LIB::PersProductNode::chngs_ [private]

List of status changes for the personalized product node.

Definition at line 428 of file persproduct.h.

Referenced by statusChanges().

DateTime OSB_LIB::PersProductNode::created_ [private]

Creation date.

Definition at line 418 of file persproduct.h.

Referenced by created().

Status OSB_LIB::PersProductNode::effStatus_ [private]

The effective status of the personalized product node.

Definition at line 424 of file persproduct.h.

Referenced by effStatus().

DateTime OSB_LIB::PersProductNode::effStatusDate_ [private]

Date and time when the effective status was set.

Definition at line 426 of file persproduct.h.

Referenced by effStatusDate().

Oid OSB_LIB::PersProductNode::oid_ [private]

Composed unique object id, database link.

Definition at line 416 of file persproduct.h.

Referenced by oid(), persProductId(), and productNodeId().

PersProductItems OSB_LIB::PersProductNode::persItems_ [private]

List of personalized product items of the pers. node.

Definition at line 432 of file persproduct.h.

Referenced by persItems().

Status OSB_LIB::PersProductNode::prefStatus_ [private]

The preferred status for the personalized product node.

Definition at line 420 of file persproduct.h.

Referenced by prefStatus().

DateTime OSB_LIB::PersProductNode::prefStatusDate_ [private]

Date and time when the preferred status was requested.

Definition at line 422 of file persproduct.h.

Referenced by prefStatusDate().

StatusRequests OSB_LIB::PersProductNode::reqs_ [private]

List of status requests.

Definition at line 430 of file persproduct.h.

Referenced by statusRequests().


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