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 () |
Class used to manage all the information about categories that the ACG uses.
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
c | The Category to be added |
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 | ( | ) |
References cl.utfsm.acs.acg.core.AlarmManager.getFaultFamily().
Referenced by cl.utfsm.acs.acg.core.AlarmSystemManager.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).
c | The category to be deleted |
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
List<Category> cl.utfsm.acs.acg.core.CategoryManager.getAllCategories | ( | ) |
Category cl.utfsm.acs.acg.core.CategoryManager.getCategoryByPath | ( | String | path | ) |
static CategoryManager cl.utfsm.acs.acg.core.CategoryManager.getInstance | ( | CategoryDAO | categoryDAO | ) | [static] |
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.updateCategory | ( | Category | c, | |
Category | ci | |||
) | throws NullPointerException, IllegalOperationException |
References cl.utfsm.acs.acg.core.ObjectState.create(), cl.utfsm.acs.acg.core.ObjectState.delete(), and cl.utfsm.acs.acg.core.ObjectState.update().
Referenced by cl.utfsm.acs.acg.core.AlarmManager.deleteFaultFamily(), cl.utfsm.acs.acg.core.AlarmManager.updateFaultFamily(), and cl.utfsm.acs.acg.gui.CategoriesView.updateName().
void cl.utfsm.acs.acg.core.CategoryManager.updateDefaultCategory | ( | Category | c | ) |