OSB_LIB::IpGroup Class Reference

Inheritance diagram for OSB_LIB::IpGroup:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::IpGroup:

Collaboration graph
[legend]
List of all members.

Detailed Description

Group IP4 address resources.

This is user created, non-prepaid, network specific, re-usable resource.

Definition at line 201 of file ipaddress.h.

Direction.

Configuration:

Public Types

Public Member Functions

Read access to data members:
Database transactions:

Private Member Functions

Private Attributes

Static Private Attributes

Friends

Classes


Member Typedef Documentation

typedef std::list<AssignedIp4> OSB_LIB::IpGroup::AssignedIp4s

STL-container for assigned IP4 addresses.

Definition at line 250 of file ipaddress.h.


Member Enumeration Documentation

enum OSB_LIB::IpGroup::Direction

The direction of the assignment of an IP address.

Enumerator:
dirUnknown  Unknown direction of IP assignment.
dirIn  Incoming IP assignment.
dirOut  Outgoing IP assignment.

Definition at line 214 of file ipaddress.h.


Constructor & Destructor Documentation

OSB_LIB::IpGroup::IpGroup ( const Oid id = Oid()  ) 

Constructor with optional object id.

OSB_LIB::IpGroup::IpGroup ( const Number rn,
const Id< Network > &  nw 
)

Constructor with resource number and optional network id.

Parameters:
rn The resource number.
nw The id of the network that owns the IP group.


Member Function Documentation

bool OSB_LIB::IpGroup::addIp4 ( const OSB_DB::Session session,
const Date start,
Ip4Address ip4,
Direction  dir 
)

Assign an IP4 to an IP group.

Parameters:
session Database session to use.
start Start date of assignment period.
ip4 IP4 to assign.
dir Direction to assign.
Returns:
true if the IP4 address was assigned, else false.
Exceptions:
OsbException 
  • different network that the IP4 address and the IP group belong to
The function calls IpGroup::assign to add to list. It also updates the status of IP4 address to rsAssigned and store to database.

bool OSB_LIB::IpGroup::assign ( const AssignedIp4 assignedIp4  )  [private]

Add an IP4 address to the group.

Parameters:
assignedIp4 Assigned ip4Address object to added.
Returns:
false if the added IP4 address was already assigned, else true. In either case ip4 is in the list of assigned IP4 addresses after the function returns.

const AssignedIp4s& OSB_LIB::IpGroup::assignedIp4s (  )  const

List with the id's of the assigned IP4 addresses.

bool OSB_LIB::IpGroup::changeIp4Status ( const OSB_DB::Session session,
Ip4Address ip4 
) const [private]

Change the status of an IP4 address.

Parameters:
session Database session to use.
ip4 IP4 address for which to change the status.
Returns:
true if the status of the IP address was changed, else false (if the group's status is undefined).
This function is called if the only current assigment of an IP4 address is terminated.

const AssignedIp4s OSB_LIB::IpGroup::curAssignedIp4s (  )  const

List with current assigned IP4 addresses.

bool OSB_LIB::IpGroup::deassign ( const Ip4Address ip4,
Direction  dir 
) [private]

Deassign an IP4 address from the group.

Set the end date of the assignment to the current date, also update the IP4 object in list.

Parameters:
ip4 IP4 address to be deassigned.
dir Deassigned direction.
Returns:
true if the removed IP4 address was previously assigned, else false.

bool OSB_LIB::IpGroup::delIp4 ( const OSB_DB::Session session,
Ip4Address ip4,
Direction  dir 
)

Deassign an IP4 from an IP group.

Parameters:
session Database session to use.
ip4 IP4 to deassign.
dir Direction to deassign.
Returns:
true if the IP4 address was deassigned, else false.
Exceptions:
OsbException if the id of previously assigned IP group does not match the current IP group.
The function calls IpGroup::deassign to remove IP4 from list. It also updates the status of IP4 address according to the status of the IP group and the status of the pers. IP group if the IP group is rsAssigned. All these changes will be stored to database.

const std::string& OSB_LIB::IpGroup::des (  )  const

Description.

static Direction OSB_LIB::IpGroup::direction ( char  c  )  [static]

Convert a char to direction.

Parameters:
c Value to convert.
Returns:
The corresponding direction. Its value is dirUnknown if `c' is not supported.

bool OSB_LIB::IpGroup::insert ( const OSB_DB::Session session  )  [virtual]

Insert the resource into the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Implements OSB_LIB::Resource.

bool OSB_LIB::IpGroup::read ( const OSB_DB::Session session  )  [virtual]

Read the resource from the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Implements OSB_LIB::Resource.

bool OSB_LIB::IpGroup::remove ( const OSB_DB::Session session  )  [virtual]

Delete the resource from the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Implements OSB_LIB::Resource.

void OSB_LIB::IpGroup::setDes ( const std::string &  des  ) 

Set the description.

void OSB_LIB::IpGroup::sortIp4sByPriority (  ) 

Ascending sort of assigned IP4 addresses by priority:

void OSB_LIB::IpGroup::sortIp4sByResNum ( bool  desc = false  ) 

Sort assigned IP4 addresses by resource number.

Parameters:
desc Flag to sort in descending (true) or ascending (false) order.

static char OSB_LIB::IpGroup::toChar ( Direction  dir  )  [static]

Convert a direction into a char.

Parameters:
dir Direction to convert.
Returns:
The corresponsing char value. Its value is (char)dirUnknown if `dir' is not supported.

Type OSB_LIB::IpGroup::typeId (  )  const [virtual]

Type of the IP group resource: rtIpGroup.

Implements OSB_LIB::Resource.

void OSB_LIB::IpGroup::updData ( const OSB_DB::Session session  )  [virtual]

Update the resource in the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.
Exceptions:
OsbException from lock().
OsbException from incObjVs().

Implements OSB_LIB::Resource.


Friends And Related Function Documentation

friend class OSB_DB::IpGroupGw [friend]

The gateway must be able to set the data members.

Definition at line 203 of file ipaddress.h.


Member Data Documentation

AssignedIp4s OSB_LIB::IpGroup::assignedIp4s_ [private]

List of assigned IP4 addresses.

Definition at line 387 of file ipaddress.h.

std::string OSB_LIB::IpGroup::des_ [private]

Description of the IP group resource.

Definition at line 385 of file ipaddress.h.

const Type OSB_LIB::IpGroup::typeId_ = rtIpGroup [static, private]

Identification of the resource type.

Definition at line 206 of file ipaddress.h.


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