OSB_LIB::FilterExpr Class Reference

Collaboration diagram for OSB_LIB::FilterExpr:

Collaboration graph
[legend]
List of all members.

Detailed Description

Filter expressions.

Filter expression can be expressed as filtercond, !filterexpr, (filterexpr), filterexpr && filterexpr, filterexpr || filterexpr, filterexpr ^ filterexpr.

e.g. serviceClass == 8 && tariffClass != 9 serviceClass == 8 is a filter condition (id - 1) mapped to the filter expression e1. tariffClass != 9 is a filter condition (id - 2) mapped to the filter expression e2. e3 = e1 && e2 For e3 left hand side filter expression is e1, right hand side filter expression is e2 and the operator is otAnd. For e1 filter condition id is 1 and the left, right hand side filter expression id is null. For e2 filter condition id is 2 and the left, right hand side filter expression id is null. e3 is the starting point of the example filter expression.

It contains the function eval to evaluate the filter expression. If the filter expression contains the left or right hand side expressions then it will apply the operator on the expressions else it will evaluate the filter condition.

Definition at line 898 of file filter.h.

Database operations:

Public Types

Public Member Functions

Read access to data members:
Modify data members.

Private Member Functions

Status changes.

Private Attributes

Friends


Member Typedef Documentation

typedef Id<FilterExpr> OSB_LIB::FilterExpr::Oid

Unique identification for filter expression object.

Definition at line 914 of file filter.h.


Constructor & Destructor Documentation

OSB_LIB::FilterExpr::FilterExpr ( const FilterExpr::Oid oid = Oid()  ) 

Constructor with Oid.

This constructor is used as default constructor as well as constructor with oid to construct the filter expression object.

Parameters:
oid Unique id of the filter expression object.

OSB_LIB::FilterExpr::FilterExpr ( const Oid oid,
const FilterCond::Oid fcId,
const FilterExpr::Oid lhsfeId,
const FilterExpr::Oid rhsfeId,
OperatorType  op = otUnknown 
)

Constructor with all info.

Parameters:
oid Unique id of the filter expression object.
fcId Filter Condition id.
lhsfeId Left hand side filter expression id.
rhsfeId Right hand side filter expression id.
op Operator Type to be used to evaluate the expression.

OSB_LIB::FilterExpr::~FilterExpr (  ) 

Destructor to destruct all the dynamically created objects.

This is used to destruct all the objects created dynamically.

OSB_LIB::FilterExpr::FilterExpr ( FilterExpr rhs  ) 

Constructor with reference to the filter expression object.

This will copy the filter expression attributes and all the internal objects.

Parameters:
rhs Filter expression to use.

OSB_LIB::FilterExpr::FilterExpr ( const FilterExpr rhs  ) 

Copy constructor to copy all the internal objects.

This will copy the filter expression attributes and all the internal objects.

Parameters:
rhs Filter expression to use.


Member Function Documentation

void OSB_LIB::FilterExpr::build (  ) 

Build this filter expression.

This will create the left hand side, right hand side filter expressions or filter condition according to the mapping to this filter expression.

bool OSB_LIB::FilterExpr::eval ( const Cdr cdr,
const UsedService us 
)

Evaluation of Cdr, UsedService.

This will evaluate the given Cdr and UsedService with the configured filter expressions and filter condition and returns the result.

Parameters:
cdr Cdr object for evaluation.
us UsedService in the cdr object for evaluation.
Returns:
True if the UsedService matches this expression else false.

const FilterCond::Oid& OSB_LIB::FilterExpr::fcId (  )  const

Return the condition id mapped to this filter expression.

bool OSB_LIB::FilterExpr::freeze ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from editable to standby.

In order to set the status from editable to standby, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container of error messages if any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to standby else false.

bool OSB_LIB::FilterExpr::insert ( const OSB_DB::Session session  )  [private]

Insert the filter expression into the database.

This will insert the filter expression into the database using filter expression gateway. The object id will be set for this object only after the insertion.

Parameters:
session Database session to use.
Exceptions:
Exception if error in database.
Returns:
True if the filter expression inserted successfully else false.

bool OSB_LIB::FilterExpr::isReleased ( const OSB_DB::Session session  ) 

Checks the object is released.

This will check the status, if the status is released then it will return true else false.

Returns:
True if the object is released else false.

const Oid& OSB_LIB::FilterExpr::lhsfeId (  )  const

Return the left hand side filter expression id mapped to this filter expression.

long OSB_LIB::FilterExpr::objVs (  )  const

Return the object version.

const Oid& OSB_LIB::FilterExpr::oid (  )  const

Return the object id of this filter expression.

OperatorType OSB_LIB::FilterExpr::optype (  )  const

Returns the operator type to evaluate the expression.

void OSB_LIB::FilterExpr::print (  ) 

This is for debugging purpose.

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

Read the filter expression from the database.

This is used to read the filter expression from the database using filter expression gateway. Before fetching from the database the object id should be set. Object id is used to identify the object.

Parameters:
session Database session to use.
Exceptions:
Exception if object not found.
Returns:
True if the filter expression read successfully else false.

bool OSB_LIB::FilterExpr::release ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from standby to release.

In order to set the status from standby to release, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container of error messages if any.
Exceptions:
OsbException for the following errors:
  • Object is not in status standby
  • Release date is not in future
  • All configured objects are not released.
Returns:
True if status changed to release else false.

const Date& OSB_LIB::FilterExpr::releaseDate (  )  const

Return the release date of the object.

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

Remove the filter expression from the database.

This will remove the filter expression from the database using filter expression gateway. The object id is used to identify the object for deletion.

Parameters:
session Database session to use.
Exceptions:
Exception for the following errors:
  • Object not found,
  • Foreign key exception
Returns:
True if the filter expression removed successfully else false.

bool OSB_LIB::FilterExpr::revoke ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from release to standby.

In order to get the status from release to standby, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container of error messages is any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to standby else false.

const Oid& OSB_LIB::FilterExpr::rhsfeId (  )  const

Return the right hand side filter expression id mapped to this filter expression.

bool OSB_LIB::FilterExpr::setFcId ( const FilterCond::Oid fcId  ) 

Set the filter condition id.

bool OSB_LIB::FilterExpr::setLhsFeId ( const Oid lhsId  ) 

Set the left hand side filter expression id.

bool OSB_LIB::FilterExpr::setOperator ( OperatorType  op  ) 

Set the operator.

bool OSB_LIB::FilterExpr::setReleaseDate ( const Date date  ) 

Set the release date.

bool OSB_LIB::FilterExpr::setRhsFeId ( const Oid rhsId  ) 

Set the right hand side filter expression id.

CfgStatus OSB_LIB::FilterExpr::status (  )  const

Return the status of the object.

bool OSB_LIB::FilterExpr::unfreeze ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from standby to editable.

In order to get the status from standby to editable, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container of error messages is any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to editable else false.

bool OSB_LIB::FilterExpr::update ( const OSB_DB::Session session  )  [private]

Update the filter expression in the database.

This will update the filter expression in the database with the current value using filter expression gateway. The object id is used to identify the object for updation.

Parameters:
session Database session to use.
Exceptions:
Exception if object not found.
Returns:
True if the filter expression updated successfully else false.


Friends And Related Function Documentation

friend class FilterManager [friend]

This is used to configure and manage the filter expression.

Definition at line 910 of file filter.h.

friend struct OSB_DB::FilterExprGw [friend]

This will perform all the database operations for the filter expression.

Definition at line 904 of file filter.h.


Member Data Documentation

FilterCond* OSB_LIB::FilterExpr::fc_ [private]

Pointer to the filter condition object.

Definition at line 1220 of file filter.h.

FilterCond::Oid OSB_LIB::FilterExpr::fcId_ [private]

Filter condition which is mapped to this filter expression. All the leaf node filter expressions are mapped to any one of the FilterCond otherwise its empty.

Definition at line 1217 of file filter.h.

FilterExpr* OSB_LIB::FilterExpr::lhsfe_ [private]

Pointer to the left hand side filter expression object.

Definition at line 1226 of file filter.h.

FilterExpr::Oid OSB_LIB::FilterExpr::lhsfeId_ [private]

Id of the left hand side filter expression.

Definition at line 1223 of file filter.h.

long OSB_LIB::FilterExpr::objVs_ [private]

Object version to ensure the object in the database and the object in the system are same.

Definition at line 1241 of file filter.h.

Oid OSB_LIB::FilterExpr::oid_ [private]

Unique id to identify the filter expression object.

Definition at line 1210 of file filter.h.

OperatorType OSB_LIB::FilterExpr::op_ [private]

Type of Operator (e.g. &&,||,^,!).

Definition at line 1235 of file filter.h.

Date OSB_LIB::FilterExpr::releaseDate_ [private]

Release date of this filter version object.

Definition at line 1247 of file filter.h.

FilterExpr* OSB_LIB::FilterExpr::rhsfe_ [private]

Pointer to the right hand side filter expression object.

Definition at line 1232 of file filter.h.

FilterExpr::Oid OSB_LIB::FilterExpr::rhsfeId_ [private]

Id of the right hand side filter expression.

Definition at line 1229 of file filter.h.

CfgStatus OSB_LIB::FilterExpr::status_ [private]

Status of the object.

Definition at line 1244 of file filter.h.


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