OSB_LIB::FilterManager Class Reference

Collaboration diagram for OSB_LIB::FilterManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

This maintains all the objects (Filter, FilterVersion, FilterExpr and FilterCond) and managing the objects by inserting the new object, updating the existing object and removing the existing object.

Definition at line 2065 of file filter.h.

Public Member Functions

Static Public Member Functions

Private Member Functions

Private Attributes

Static Private Attributes


Constructor & Destructor Documentation

OSB_LIB::FilterManager::FilterManager (  )  [private]

Constructor to avoid multiple instance.


Member Function Documentation

void OSB_LIB::FilterManager::buildFilterVersions (  )  [private]

Rebuild all the filter versions.

This will rebuild all the filter versions if there is any change in the filter expressions or filter conditions.

Filter::Oid OSB_LIB::FilterManager::creFilter ( OSB_DB::Session session,
std::string &  name,
std::string &  des 
)

This will create a new filter object with the given data and insert it into the database.

Parameters:
session Database session to use.
name Name of the filter.
des Description for the filter.
Exceptions:
Exception for the following:
  • Unique key violation.
Returns:
Unique object id for the new filter.

FilterCond::Oid OSB_LIB::FilterManager::creFilterCond ( OSB_DB::Session session,
FilterType  ft,
long  targetId,
OperatorType  op 
)

This will create a new filter condition object with the given data and insert it into the database.

Parameters:
session Database session to use.
ft Type of filter condition.
targetId Target id of the filter condition object.
op Operator to apply to evaluate the filter condition.
Returns:
Unique object id for the new filter condition.

FilterExpr::Oid OSB_LIB::FilterManager::creFilterExpr ( OSB_DB::Session session,
const FilterCond::Oid fcId = FilterCond::Oid(),
const FilterExpr::Oid lhsfeId = FilterExpr::Oid(),
const FilterExpr::Oid rhsfeId = FilterExpr::Oid(),
OperatorType  op = otUnknown 
)

This will create a new filter expression object with the given data and insert it into the database.

Parameters:
session Database session to use.
fcId Filter Condition id.
lhsfeId Left hand side filter expression id.
rhsfeId Right hand side filter expression id.
op Operator to evaluate this filter expression.
Exceptions:
Exception for foreign key violation.
Returns:
Filter expression object id.

FilterVersion::Oid OSB_LIB::FilterManager::creFilterVersion ( OSB_DB::Session session,
const Filter::Oid filtId,
const std::string &  name 
)

This will create a new filter version object with the given data and insert it into the database.

Parameters:
session Database session to use.
filtId Id of the filter.
name Name of the filter version.
Exceptions:
Exception for the following:
  • Unique key violation,
  • Foreign key violation
Returns:
Unique object id for the new filter version.

void OSB_LIB::FilterManager::delFilter ( OSB_DB::Session session,
const Filter::Oid oid 
)

This will remove the filter.

Parameters:
session Database session to use.
oid Unique object id to identify the filter.
Exceptions:
Exception if object not found.

void OSB_LIB::FilterManager::delFilterCond ( OSB_DB::Session session,
const FilterCond::Oid oid 
)

This will remove the filter condition.

Parameters:
session Database session to use.
oid Unique object id to identify the filter condition.
Exceptions:
Exception if object not found.

void OSB_LIB::FilterManager::delFilterExpr ( OSB_DB::Session session,
const FilterExpr::Oid oid 
)

This will remove the filter expression.

Parameters:
session Database session to use.
oid Unique object id to identify the filter expression.
Exceptions:
Exception if object not found.

void OSB_LIB::FilterManager::delFilterVersion ( OSB_DB::Session session,
const FilterVersion::Oid oid 
)

This will remove the filter version object.

Parameters:
session Database session to use.
oid Unique object id to identify the filter version.
Exceptions:
Exception if object not found.

const Filter* OSB_LIB::FilterManager::findFilter ( const Filter::Oid oid  ) 

Find the filter object for the given object id.

Parameters:
oid Unique object id to identify the filter object.
Exceptions:
Exception if object not found.
Returns:
Const pointer to the filter object.

const FilterCond* OSB_LIB::FilterManager::findFilterCond ( const FilterCond::Oid oid  ) 

Find the filter condition object for the given object id.

Parameters:
oid Unique object id to identify the filter condition object.
Exceptions:
Exception if object not found.
Returns:
Const pointer to the filter condition object.

const FilterExpr* OSB_LIB::FilterManager::findFilterExpr ( const FilterExpr::Oid oid  ) 

Find the filter expression object for the given object id.

Parameters:
oid Unique object id to identify the filter expression object.
Exceptions:
Exception if object not found.
Returns:
Const pointer to the filter version object.

const FilterVersion* OSB_LIB::FilterManager::findFilterVersion ( const FilterVersion::Oid oid  ) 

Find the filter version object for the given object id.

Parameters:
oid Unique object id to identify the filter version object.
Exceptions:
Exception if object not found.
Returns:
Const pointer to the filter version object.

size_t OSB_LIB::FilterManager::freezeFilterCond ( OSB_DB::Session session,
const FilterCond::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'editable' to 'standby'.

Parameters:
session Database session.
oid Id of the filter condition to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::freezeFilterExpr ( OSB_DB::Session session,
const FilterExpr::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'editable' to 'standby'.

Parameters:
session Database session.
oid Id of the filter expression to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::freezeFilterVersion ( OSB_DB::Session session,
const FilterVersion::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'editable' to 'standby'.

Parameters:
session Database session.
oid Id of the filter version to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

const Filter& OSB_LIB::FilterManager::getFilter ( const Filter::Oid oid  ) 

Get the filter object using object id and return the reference to that object.

Parameters:
oid Unique object id to identify the filter object.
Exceptions:
Exception if object not found.
Returns:
Const reference to the filter object.

const FilterCond& OSB_LIB::FilterManager::getFilterCond ( const FilterCond::Oid oid  ) 

Get the filter condition object using object id and return the reference to that object.

Parameters:
oid Unique object id to identify the filter condition object.
Exceptions:
Exception if object not found.
Returns:
Const reference to the filter condition object.

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

Get the filter expression object using object id and return the reference to that object.

Parameters:
oid Unique object id to identify the filter expression object.
Exceptions:
Exception if object not found.
Returns:
Const reference to the filter expression object.

static FilterManager* OSB_LIB::FilterManager::getFilterManager (  )  [static]

Returns the same instance of filter manager to everyone.

Returns:
Instance of filter manager.

const FilterVersion& OSB_LIB::FilterManager::getFilterVersion ( const FilterVersion::Oid oid  ) 

Get the filter version object using object id and return the reference to that object.

Parameters:
oid Unique object id to identify the filter version object.
Exceptions:
Exception if object not found.
Returns:
Const reference to the filter version object.

void OSB_LIB::FilterManager::print (  ) 

This is for debugging purpose.

void OSB_LIB::FilterManager::read ( const OSB_DB::Session session  ) 

Intially load FilterManager from database.

Parameters:
session Database session to use.
Exceptions:
OsbException when encounter problems during fetching database.

void OSB_LIB::FilterManager::readFilter ( const OSB_DB::Session session  )  [private]

Intially load filters from database.

Parameters:
session The database session.
Exceptions:
OsbException when encounter problems during fetching database.

void OSB_LIB::FilterManager::readFilterCond ( const OSB_DB::Session session  )  [private]

Intially load filter conditions from database.

Parameters:
session The database session.
Exceptions:
OsbException when encounter problems during fetching database.

void OSB_LIB::FilterManager::readFilterExpr ( const OSB_DB::Session session  )  [private]

Intially load filter expressions from database.

Parameters:
session The database session.
Exceptions:
OsbException when encounter problems during fetching database.

void OSB_LIB::FilterManager::readFilterVersion ( const OSB_DB::Session session  )  [private]

Intially load filter versions from database.

Parameters:
session The database session.
Exceptions:
OsbException when encounter problems during fetching database.

size_t OSB_LIB::FilterManager::releaseFilterCond ( OSB_DB::Session session,
const FilterCond::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'standby' to 'release'.

Parameters:
session Database session.
oid Id of the filter condition to change.
errors Container of error messages.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::releaseFilterExpr ( OSB_DB::Session session,
const FilterExpr::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'standby' to 'release'.

Parameters:
session Database session.
oid Id of the filter expression to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::releaseFilterVersion ( OSB_DB::Session session,
const FilterVersion::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'standby' to 'release'.

Parameters:
session Database session.
oid Id of the filter version to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::revokeFilterCond ( OSB_DB::Session session,
const FilterCond::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'release' to 'standby'.

Parameters:
session Database session.
oid Id of the filter condition to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::revokeFilterExpr ( OSB_DB::Session session,
const FilterExpr::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'release' to 'standby'.

Parameters:
session Database session.
oid Id of the filter expression to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::revokeFilterVersion ( OSB_DB::Session session,
const FilterVersion::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'release' to 'standby'.

Parameters:
session Database session.
oid Id of the filter version to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::unfreezeFilterCond ( OSB_DB::Session session,
const FilterCond::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'standby' to 'editable'.

Parameters:
session Database session.
oid Id of the filter condition to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::unfreezeFilterExpr ( OSB_DB::Session session,
const FilterExpr::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'standby' to 'editable'.

Parameters:
session Database session.
oid Id of the filter expression to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

size_t OSB_LIB::FilterManager::unfreezeFilterVersion ( OSB_DB::Session session,
const FilterVersion::Oid oid,
std::vector< OsbError > &  errors 
)

Change the object status from 'standby' to 'editable'.

Parameters:
session Database session.
oid Id of the filter version to change.
errors Container of error messanges.
Returns:
Number of error messages generated.

OsbError OSB_LIB::FilterManager::updFilter ( OSB_DB::Session session,
Filter filt 
)

This will update the filter with the given filter informations.

Parameters:
session Database session to use.
filt Filter object to use.
Exceptions:
Exception for the following:
  • Object not found.
  • Unique key violation.
Returns:
OsbError set to zero if success else with error code.

OsbError OSB_LIB::FilterManager::updFilterCond ( OSB_DB::Session session,
FilterCond fc 
)

This will update the filter condition with the available informations.

Parameters:
session Database session to use.
fc Filter condition object to use.
Exceptions:
Exception if object not found.
Returns:
OsbError set to zero if success else with error code.

OsbError OSB_LIB::FilterManager::updFilterExpr ( OSB_DB::Session session,
FilterExpr fe 
)

This will update the filter expression with the available informations.

Parameters:
session Database session to use.
fe Filter expression object to use.
Exceptions:
Exception if object not found.
Returns:
OsbError set to zero if success else with error code.

OsbError OSB_LIB::FilterManager::updFilterVersion ( OSB_DB::Session session,
FilterVersion fv 
)

This will update the filter version with the available information.

Parameters:
session Database session to use.
fv FilterVersion object to use.
Exceptions:
Exception if object not found.
Returns:
OsbError set to zero if success else with error code.


Member Data Documentation

FilterConds OSB_LIB::FilterManager::filterconds_ [private]

This contains all the filter condition objects.

Definition at line 2588 of file filter.h.

FilterExprs OSB_LIB::FilterManager::filterexprs_ [private]

This contains all the filter expression objects.

Definition at line 2585 of file filter.h.

FilterManager* OSB_LIB::FilterManager::filtermgr_ [static, private]

Pointer the filter manager instance.

Definition at line 2591 of file filter.h.

Filters OSB_LIB::FilterManager::filters_ [private]

This contains all the filter objects.

Definition at line 2579 of file filter.h.

FilterVersions OSB_LIB::FilterManager::filterVs_ [private]

This contains all the filter version objects.

Definition at line 2582 of file filter.h.


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