cl::utfsm::acs::acg::core::CategoryManager Class Reference

Inheritance diagram for cl::utfsm::acs::acg::core::CategoryManager:
Inheritance graph
[legend]
Collaboration diagram for cl::utfsm::acs::acg::core::CategoryManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

List< Category > getAllCategories ()
Category getCategoryByPath (String path)
void loadFromCDB ()
boolean deleteCategory (Category c) throws NullPointerException, IllegalOperationException
boolean addCategory (Category c) throws IllegalOperationException, NullPointerException
void updateCategory (Category c, Category ci) throws NullPointerException, IllegalOperationException
void updateDefaultCategory (Category c)
void saveToCDB ()

Static Public Member Functions

static CategoryManager getInstance (CategoryDAO categoryDAO)
static void destroy ()

Private Member Functions

 CategoryManager (CategoryDAO categoryDAO)

Private Attributes

CategoryDAO _categoryDAO
List< Category > _categoryList
HashMap< String, ObjectState_objState

Static Private Attributes

static CategoryManager _instance

Detailed Description

Class used to manage all the information about categories that the ACG uses.

Author:
rtobar

Constructor & Destructor Documentation

cl::utfsm::acs::acg::core::CategoryManager::CategoryManager ( CategoryDAO  categoryDAO  )  [inline, private]

References _categoryDAO, _categoryList, and _objState.

Referenced by getInstance().


Member Function Documentation

boolean cl::utfsm::acs::acg::core::CategoryManager::addCategory ( Category  c  )  throws IllegalOperationException, NullPointerException [inline]

Add a new Category. If there is a Category with the same name that the given Category, the new Category cannot be added

Parameters:
c The Category to be added
Returns:
True If the Category is added , False otherwise
Exceptions:
IllegalOperationException If the Category to add already exists
NullPointerException If the Category is null

References _categoryList, _objState, cl::utfsm::acs::acg::core::ObjectState::create(), and cl::utfsm::acs::acg::core::ObjectState::update().

Referenced by cl::utfsm::acs::acg::gui::CategoriesView::createViewWidgets(), and cl::utfsm::acs::acg::core::CategoryManagerTest::testAddCategory().

boolean cl::utfsm::acs::acg::core::CategoryManager::deleteCategory ( Category  c  )  throws NullPointerException, IllegalOperationException [inline]

Deletes a category. The category to be deleted is checked against the existing Fault Families in order to preserve the consistency of the application (i.e., a category cannot be deleted if it currently being used by a Fault Family).

Parameters:
c The category to be deleted
Returns:
True if it deletes the given category, false otherwise
Exceptions:
NullPointerException If the given category is null
IllegalOperationException If the category is part of a existing Fault Family

References _categoryList, _objState, cl::utfsm::acs::acg::core::ObjectState::delete(), and cl::utfsm::acs::acg::core::AlarmManager::getAllAlarms().

Referenced by cl::utfsm::acs::acg::gui::CategoriesView::createViewWidgets(), and cl::utfsm::acs::acg::core::CategoryManagerTest::testDeleteCategory().

static void cl::utfsm::acs::acg::core::CategoryManager::destroy (  )  [inline, static]

Destroys the singleton instance of this class. This is needed to renew the internal reference to the CategoryDAO if a new connection to the DAL and the ACS Manager has been performed

References _instance.

List<Category> cl::utfsm::acs::acg::core::CategoryManager::getAllCategories (  )  [inline]
Category cl::utfsm::acs::acg::core::CategoryManager::getCategoryByPath ( String  path  )  [inline]
static CategoryManager cl::utfsm::acs::acg::core::CategoryManager::getInstance ( CategoryDAO  categoryDAO  )  [inline, static]
void cl::utfsm::acs::acg::core::CategoryManager::loadFromCDB (  )  [inline]

Performs a full reload of the contents of the Manager. All the current internal contents of the EntityManager are cleared, and replaced by the ones that are currently available on the CDB. Therefore, this call should be done with great care.

Implements cl::utfsm::acs::acg::core::EntityManager.

References _categoryDAO, _categoryList, and _objState.

Referenced by cl::utfsm::acs::acg::core::AlarmSystemManager::loadFromCDB(), cl::utfsm::acs::acg::core::CategoryManagerTest::setUp(), cl::utfsm::acs::acg::core::CategoryManagerTest::testGetAllCategories(), cl::utfsm::acs::acg::core::CategoryManagerTest::testGetCategoryByPath(), and cl::utfsm::acs::acg::core::CategoryManagerTest::testLoadFromCDB().

void cl::utfsm::acs::acg::core::CategoryManager::saveToCDB (  )  [inline]

Performs a full save of the contents of the Manager to the CDB. All the modified contents of the CDB are updated, and replaced by the ones that are currently available on the EntityManager. Therefore, this call should be done with great care.

Implements cl::utfsm::acs::acg::core::EntityManager.

References _categoryDAO, _categoryList, _objState, cl::utfsm::acs::acg::core::ObjectState::getAction(), and getCategoryByPath().

Referenced by cl::utfsm::acs::acg::core::AlarmSystemManager::saveToCDB().

void cl::utfsm::acs::acg::core::CategoryManager::updateCategory ( Category  c,
Category  ci 
) throws NullPointerException, IllegalOperationException [inline]
void cl::utfsm::acs::acg::core::CategoryManager::updateDefaultCategory ( Category  c  )  [inline]

Member Data Documentation

The singleton instance shared across the project

Referenced by destroy(), and getInstance().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2