org.mycore.backend.hibernate
Class MCRHIBRuleStore

java.lang.Object
  extended by org.mycore.access.mcrimpl.MCRRuleStore
      extended by org.mycore.backend.hibernate.MCRHIBRuleStore

public class MCRHIBRuleStore
extends MCRRuleStore

Hibernate implementation for RuleStore, storing access rules

Author:
Arne Seifert

Field Summary
 
Fields inherited from class org.mycore.access.mcrimpl.MCRRuleStore
logger, ruletablename, sqlDateformat
 
Constructor Summary
MCRHIBRuleStore()
           
 
Method Summary
 void createRule(MCRAccessRule rule)
          Method creates new rule in database by given rule-object
 void deleteRule(String ruleid)
          Method deletes accessrule for given ruleid
 boolean existsRule(String ruleid)
          Method checks existance of rule in db
 int getNextFreeRuleID(String prefix)
           
 MCRAccessRule getRule(String ruleid)
          Method returns MCRAccessRule by given id
 Collection<String> retrieveAllIDs()
           
 MCRAccessRule retrieveRule(String ruleid)
          Method returns accessrule for given ruleid
 Collection<String> retrieveRuleIDs(String ruleExpression, String description)
          Method retrieves the ruleIDs of rules, whose string-representation starts with given data
 void updateRule(MCRAccessRule rule)
          Method updates accessrule by given rule.
 
Methods inherited from class org.mycore.access.mcrimpl.MCRRuleStore
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRHIBRuleStore

public MCRHIBRuleStore()
Method Detail

createRule

public void createRule(MCRAccessRule rule)
Method creates new rule in database by given rule-object

Specified by:
createRule in class MCRRuleStore
Parameters:
rule - as MCRAccessRule

retrieveRuleIDs

public Collection<String> retrieveRuleIDs(String ruleExpression,
                                          String description)
Method retrieves the ruleIDs of rules, whose string-representation starts with given data

Specified by:
retrieveRuleIDs in class MCRRuleStore

updateRule

public void updateRule(MCRAccessRule rule)
Method updates accessrule by given rule. internal: get rule object from session set values, update via session

Specified by:
updateRule in class MCRRuleStore

deleteRule

public void deleteRule(String ruleid)
Method deletes accessrule for given ruleid

Specified by:
deleteRule in class MCRRuleStore

retrieveRule

public MCRAccessRule retrieveRule(String ruleid)
Method returns accessrule for given ruleid

Specified by:
retrieveRule in class MCRRuleStore
Parameters:
ruleid - as string
Returns:
MCRAccessRule object with database values or null

getRule

public MCRAccessRule getRule(String ruleid)
Method returns MCRAccessRule by given id

Specified by:
getRule in class MCRRuleStore
Parameters:
ruleid - as string
Returns:
MCRAccessRule

retrieveAllIDs

public Collection<String> retrieveAllIDs()
Specified by:
retrieveAllIDs in class MCRRuleStore

existsRule

public boolean existsRule(String ruleid)
                   throws MCRException
Method checks existance of rule in db

Specified by:
existsRule in class MCRRuleStore
Parameters:
ruleid - id as string
Returns:
boolean value
Throws:
MCRException

getNextFreeRuleID

public int getNextFreeRuleID(String prefix)
Specified by:
getNextFreeRuleID in class MCRRuleStore