org.mycore.datamodel.classifications
Class MCRClassificationPool

java.lang.Object
  extended by org.mycore.datamodel.classifications.MCRClassificationPool

public class MCRClassificationPool
extends Object

Author:
Radi Radichev

Field Summary
(package private) static Logger LOGGER
           
 
Constructor Summary
MCRClassificationPool()
           
 
Method Summary
 void deleteClassification(MCRCategoryID cl)
          Delete a classfication from the pool
 Set<MCRCategoryID> getAllIDs()
          This method returns all ClassificationIDs.
 MCRCategory getClassificationAsPojo(MCRCategoryID clid, boolean writeAccess)
          This method checks to see if the classification which is expected is in the Session (when edited) or it takes the classification from the database
 HashSet<MCRCategoryID> getMovedCategories()
           
 boolean isEdited(MCRCategoryID classID)
          Check if the Classification with classID is already edited and in the session.
 boolean purgeAll()
          Cancel all changes.
 boolean saveAll()
          Save all changes to the database.
 void updateClassification(MCRCategory cl)
          Put the classification in the Session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

static Logger LOGGER
Constructor Detail

MCRClassificationPool

public MCRClassificationPool()
Method Detail

getAllIDs

public Set<MCRCategoryID> getAllIDs()
This method returns all ClassificationIDs. From the database and pool together.

Returns:

saveAll

public boolean saveAll()
Save all changes to the database.

Returns:

purgeAll

public boolean purgeAll()
Cancel all changes. Clear the hashtable.

Returns:

isEdited

public boolean isEdited(MCRCategoryID classID)
Check if the Classification with classID is already edited and in the session.

Parameters:
classID - Classification ID to check for
Returns:
true when Classification is edited, false when not.

updateClassification

public void updateClassification(MCRCategory cl)
Put the classification in the Session. This method is executed every time a Classification or a Category is edited

Parameters:
cl - Classification to be stored in the session.

deleteClassification

public void deleteClassification(MCRCategoryID cl)
Delete a classfication from the pool

Parameters:
cl -

getClassificationAsPojo

public MCRCategory getClassificationAsPojo(MCRCategoryID clid,
                                           boolean writeAccess)
This method checks to see if the classification which is expected is in the Session (when edited) or it takes the classification from the database

Parameters:
clid -
writeAccess -
Returns:
MCRCategory classif

getMovedCategories

public HashSet<MCRCategoryID> getMovedCategories()