The class stores the personalization of a product item.
Definition at line 79 of file persitem.h.
typedef std::auto_ptr<PersProductItem> OSB_LIB::PersProductItem::AutoPtr |
Short-cut for an auto pointer.
For details see quality manual, implementation patterns: Virtual copy construction.
Reimplemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersDevice, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersResource, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
Definition at line 108 of file persitem.h.
Typesave unique id, database link.
A pers. product item is uniquely identified by it's primary key in the database. Derived classes may reuse this object id as their own unique identifier or alternatively define a proprietary type.
Definition at line 100 of file persitem.h.
OSB_LIB::PersProductItem::PersProductItem | ( | const PersProductItem & | rhs | ) | [protected] |
Copying for derived classes only.
const DateTime& OSB_LIB::PersProductItem::assignDate | ( | ) | const [inline] |
virtual bool OSB_LIB::PersProductItem::canConfig | ( | ) | const [pure virtual] |
Personalize item can be config or not.
Implemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
virtual bool OSB_LIB::PersProductItem::changeAssignTs | ( | const OSB_DB::Session & | session, | |
const DateTime & | newTs | |||
) | [private, virtual] |
Change the assignment date to a pers. node.
session | Database session to use. | |
newTs | Date and time of the new assignment. |
OsbException | if the new assignment period would overlap and create a conflict with other assignments, e.g., at any moment in time resources may be assigned to only one pers. product and node. |
Reimplemented in OSB_LIB::PersDevice, and OSB_LIB::PersResource.
bool OSB_LIB::PersProductItem::changeAssignTsBase | ( | const OSB_DB::Session & | session, | |
const DateTime & | newTs | |||
) | [protected] |
Change the assignment date to a pers. node, support for derived classes.
Checks the correctness of the new assignment date and updates the datebase and object accordingly.
session | Database session to use. | |
newTs | Date and time of the new assignment. |
OsbException | as specified for changeAssingTs(), see there, in particular if newTs is greater than deassignDate_. |
PersProductItem::AutoPtr OSB_LIB::PersProductItem::changeConfig | ( | const OSB_DB::Session & | session | ) | [private] |
Change the config of a pers. product item.
The function is called when the status of the pers node is not created. It will change the configuration by creating a new pers. product item.
The function first calls deassignOld(...) to deassign the old one, if this is successful, calls insert(...) to create a new item instead.
session | Database session to use. |
OsbException |
|
AutoPtr OSB_LIB::PersProductItem::clone | ( | ) | const |
Virtual copy construction.
For details see quality manual, implementation patterns.
Reimplemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersDevice, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersResource, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
virtual PersProductItem* OSB_LIB::PersProductItem::clone_ | ( | ) | const [protected, pure virtual] |
Internal virtual copy constructor.
For details see quality manual, implementation patterns.
Implemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
const DateTime& OSB_LIB::PersProductItem::deassignDate | ( | ) | const [inline] |
virtual bool OSB_LIB::PersProductItem::deassignOld | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Deassign the pers. product item in the database.
The function is called when the status of the pers node is not created.
It calls deassignOldBase() to set the deassign date of the base class.
Derived class may reimplement it if they have specific things to do.
session | Database session to use. |
Reimplemented in OSB_LIB::PersDevice, and OSB_LIB::PersResource.
bool OSB_LIB::PersProductItem::deassignOldBase | ( | const OSB_DB::Session & | session | ) | [protected] |
Deassign the common pers. product item in the database.
The function is called when the status of the parent(pers node) is not created. See overwriteBase() for detail.
session | Database session to use. |
virtual bool OSB_LIB::PersProductItem::delSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Delete type specific entries from the database.
session | Database session to use. |
Implemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
bool OSB_LIB::PersProductItem::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert a pers. product item to the database.
The function frist calls OSB_DB::PersProductGw::insPersProductItem() to store the base class data members. In the second step the virtual function insSpecific() is called to insert item type specific data.
Exception savety: The item's object id remains unchanged if the product item was not inserted into the database. This is the case when the function returns false or if an exception is thrown.
session | Database session to use. |
OsbException |
|
virtual bool OSB_LIB::PersProductItem::insSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Insert type specific members to the database.
session | Database session to use. |
Implemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
const Oid& OSB_LIB::PersProductItem::oid | ( | ) | const [inline] |
PersProductItem& OSB_LIB::PersProductItem::operator= | ( | const PersProductItem & | rhs | ) | [protected] |
Assignment or derived classes only.
virtual bool OSB_LIB::PersProductItem::overwrite | ( | const OSB_DB::Session & | session | ) | [private, virtual] |
Overwrite a pers. product item in the database.
This function is called only when the status of the pers. node is created.
It first calls overwriteBase() to overwrite the members of the base class and, if this is successful, calls the virtual function updSpecific() to update item type specific data members.
Derived class may reimplement it if they have other different things to do.
session | Database session to use. |
Reimplemented in OSB_LIB::PersDevice, and OSB_LIB::PersResource.
bool OSB_LIB::PersProductItem::overwriteBase | ( | const OSB_DB::Session & | session | ) | [protected] |
Overwrite common pers item data in the database.
This function is call only when the parent(pers node) is created.
session | Database session to use. |
class PersResource : public PersProductItem { friend class Gateway; public: bool overwrite(const Session& session) { bool rc = overwriteBase(session); if (rc) { Gateway gw(session); rc = gw.overwritePersRes(*this); } return rc; } };
const Id2<PersProductNode>& OSB_LIB::PersProductItem::persNodeId | ( | ) | const |
Object id of the related personalized product node.
virtual std::string OSB_LIB::PersProductItem::personalization | ( | ) | const [pure virtual] |
Visual description of the personalization.
Provides the personalization of the product item as string. The content and format depend on the actual, real type of the personalized item.
Implemented in OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersUimCard, OSB_LIB::PersResource, OSB_LIB::PersService, and OSB_LIB::PersTariffSystem.
Id<PersProduct> OSB_LIB::PersProductItem::persProductId | ( | ) | const |
Object id of the personalized product.
Id<ProductNode> OSB_LIB::PersProductItem::productNodeId | ( | ) | const |
Get id of related product node.
bool OSB_LIB::PersProductItem::read | ( | const OSB_DB::Session & | session, | |
bool | baseRead = false | |||
) |
Read a pers. product item from the database.
If the base part is not already read, the function uses OSB_DB::PersProductGw::fetch(const Session&, PersProductItem&) to read data members of the base class. Afterwards it calls the virtual function readSpecific() to retrieve item type specific data.
session | Database session to use. | |
baseRead | Flag if the members of the base class have already been read (from PRODUCT_ITEM). |
OsbException |
|
virtual bool OSB_LIB::PersProductItem::readSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Read type specific data members from database.
session | Database session to use. |
Implemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
bool OSB_LIB::PersProductItem::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Delete a pers. product item from the database.
The function first calls the virtual function delSpecific() to delete item type specific data. Afterwards OSB_DB::PersProductGw::delPersProductItem() is used to remove the personalized item from the database.
On successful deletion, the object id of the pers. product item is unset to indicate that it does no more exist in the database.
session | Database session to use. |
OsbException |
|
void OSB_LIB::PersProductItem::setConfig | ( | bool | canConfig | ) | [protected] |
Set the flag of config.
bool OSB_LIB::PersProductItem::update | ( | const OSB_DB::Session & | session, | |
long | objVs, | |||
bool | uptodate | |||
) |
Update a pers. product item in the database.
The function first calls OSB_DB::PersProductGw::updPersProductItem() to update the members of the base class and, if this is successful, calls the virtual function updSpecific() to update item type specific data members.
session | Database session to use. | |
objVs | Old Object version. It will be updated to the new one. | |
uptodate | Return true if the object version is uptodate. |
OsbException |
|
virtual bool OSB_LIB::PersProductItem::updSpecific | ( | const OSB_DB::Session & | session | ) | [private, pure virtual] |
Update type specific members in the database.
session | Database session to use. |
Implemented in OSB_LIB::PersAn, OSB_LIB::PersCallingCard, OSB_LIB::PersCredit, OSB_LIB::PersE164Item, OSB_LIB::PersIpGroup, OSB_LIB::PersUimCard, OSB_LIB::PersService, OSB_LIB::PersTrunk, and OSB_LIB::PersTariffSystem.
friend class OSB_DB::PersProductGw [friend] |
The database gateway needs to set private members during I/O operations.
Definition at line 84 of file persitem.h.
friend class PersProductNode [friend] |
Allow to set the pers. node object id during assignment and to change the assignment date.
Definition at line 89 of file persitem.h.
Date and time when the pers. product item was assigned to the personalized product.
Definition at line 509 of file persitem.h.
Referenced by assignDate().
bool OSB_LIB::PersProductItem::canConfig_ [protected] |
Date and time when the personalized product item was deassigned or deactivated the last time.
If the deassignment date is not set (NULL in the database) the member is DateTime::notSet().
Definition at line 517 of file persitem.h.
Referenced by deassignDate().
Oid OSB_LIB::PersProductItem::oid_ [private] |
Object id of the personalized product node to which the item belongs.
Definition at line 502 of file persitem.h.