com.cafesoft.cams.access
Class AbstractAccessControlRulePersistenceManager

java.lang.Object
  |
  +--com.cafesoft.cams.access.AbstractAccessControlRulePersistenceManager
All Implemented Interfaces:
AccessControlRulePersistenceManager

public abstract class AbstractAccessControlRulePersistenceManager
extends Object
implements AccessControlRulePersistenceManager

AbstractAccessControlRulePersistenceManager provides generic method implementations for AccessControlRulePersistenceManager. Most or all AccessControlRulePersistenceManager implementations should extend this class and implement the abstract methods.


Field Summary
protected  Config config
          The Config from which resources are made available.
protected  boolean debug
          A flag that enables/disables DEBUG-level messages
protected  Logger logger
          Logger for this object
 
Constructor Summary
AbstractAccessControlRulePersistenceManager()
           
 
Method Summary
abstract  AccessControlRule acrCreate()
          Create a new/empty AccessControlRule.
abstract  AccessControlRule acrLoad(Object object)
          Load an AccessControlRule from persistent storage.
abstract  void acrRemove(AccessControlRule acr)
          Remove an AccessControlRule from persistent storage.
abstract  void acrStore(AccessControlRule acr, Object dest)
          Store an AccessControlRule to persistent storage.
 void initialize(Config config)
          Initialize the AccessControlRulePersistenceManager.
 boolean setDebug(boolean enable)
          Enable or disable debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug
A flag that enables/disables DEBUG-level messages


config

protected Config config
The Config from which resources are made available.


logger

protected Logger logger
Logger for this object

Constructor Detail

AbstractAccessControlRulePersistenceManager

public AbstractAccessControlRulePersistenceManager()
Method Detail

setDebug

public boolean setDebug(boolean enable)
Enable or disable debugging.

Parameters:
enable - if true, enable debugging, else disable debugging.
Returns:
the previous value of the debug flag, which is useful for restoring the debug state if temporarily changed.

initialize

public void initialize(Config config)
                throws ConfigException
Initialize the AccessControlRulePersistenceManager.

Specified by:
initialize in interface AccessControlRulePersistenceManager
Parameters:
config - the configuration object through which parameters and context are available.
Throws:
ConfigException - if an error initializing this AccessControlRulePersistenceManager.

acrCreate

public abstract AccessControlRule acrCreate()
Create a new/empty AccessControlRule.

Specified by:
acrCreate in interface AccessControlRulePersistenceManager
Returns:
a new/empty AccessControlRule instance.

acrLoad

public abstract AccessControlRule acrLoad(Object object)
                                   throws PersistenceException
Load an AccessControlRule from persistent storage.

Specified by:
acrLoad in interface AccessControlRulePersistenceManager
Parameters:
object - the Object referencing the AccessControlRule to be created. This may be a String, and XML DOM Element, or any other Object suitable for the storage location of the AccessControlRule.
Returns:
the AccessControlRule instance.
Throws:
PersistenceException - if an error creating the new AccessControlRule.
IllegalArgumentException - if the parameter is null or it's type is not supported by the factory implementation.

acrStore

public abstract void acrStore(AccessControlRule acr,
                              Object dest)
                       throws PersistenceException
Store an AccessControlRule to persistent storage.

Specified by:
acrStore in interface AccessControlRulePersistenceManager
Parameters:
acr - the AccessControlRule to be stored.
dest - an object that may be needed for some AccessControlRule storage destination types. For example, if the AccessControlRule is a file, then a PrintStream might be provided. Some storage destinations (e.g. a relational database), may not use this parameter.
Throws:
PersistenceException - if an error storing the AccessControlRule.
IllegalArgumentException - if a required parameter is null, or it's type is not supported by the implementation.

acrRemove

public abstract void acrRemove(AccessControlRule acr)
                        throws PersistenceException
Remove an AccessControlRule from persistent storage.

Specified by:
acrRemove in interface AccessControlRulePersistenceManager
Parameters:
acr - the AccessControlRule to be removed from persistent storage.
Returns:
the AccessControlRule instance.
Throws:
PersistenceException - if an error creating the new AccessControlRule.
IllegalArgumentException - if the parameter is null or it's type is not supported by the factory implementation.


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.