Public Member Functions | Static Public Member Functions

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

Inheritance diagram for cl.utfsm.acs.acg.core.CategoryManager:
cl.utfsm.acs.acg.core.EntityManager

List of all members.

Public Member Functions

List< Category > getAllCategories ()
Category getCategoryByPath (String path)
void loadFromCDB ()
String checkCDB ()
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 ()

Detailed Description

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

Author:
rtobar

Member Function Documentation

boolean cl.utfsm.acs.acg.core.CategoryManager.addCategory ( Category  c  )  throws IllegalOperationException, NullPointerException

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 cl.utfsm.acs.acg.core.ObjectState.create(), and cl.utfsm.acs.acg.core.ObjectState.update().

String cl.utfsm.acs.acg.core.CategoryManager.checkCDB (  ) 
boolean cl.utfsm.acs.acg.core.CategoryManager.deleteCategory ( Category  c  )  throws NullPointerException, IllegalOperationException

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 cl.utfsm.acs.acg.core.ObjectState.delete(), and cl.utfsm.acs.acg.core.AlarmManager.getAllAlarms().

static void cl.utfsm.acs.acg.core.CategoryManager.destroy (  )  [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

Category cl.utfsm.acs.acg.core.CategoryManager.getCategoryByPath ( String  path  ) 
void cl.utfsm.acs.acg.core.CategoryManager.loadFromCDB (  ) 

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 cl.utfsm.acs.acg.core.AlarmManager.getInstance().

Referenced by cl.utfsm.acs.acg.core.AlarmSystemManager.loadFromCDB().

void cl.utfsm.acs.acg.core.CategoryManager.saveToCDB (  ) 

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 cl.utfsm.acs.acg.core.ObjectState.getAction(), cl.utfsm.acs.acg.core.CategoryManager.getCategoryByPath(), and org.exolab.castor.core.exceptions.CastorException.printStackTrace().

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

void cl.utfsm.acs.acg.core.CategoryManager.updateDefaultCategory ( Category  c  ) 

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties