org.caleigo.core
Class DataAccessManager

java.lang.Object
  extended byorg.caleigo.core.DataAccessManager
Direct Known Subclasses:
DataAccessManager.ConstantDataAccessManager

public abstract class DataAccessManager
extends java.lang.Object

Version:
1.00
Author:
Dennis Zikovic

Nested Class Summary
static class DataAccessManager.ConstantDataAccessManager
          This simple DataAccessManager restricts access for all managed elements to a single access level.
static interface DataAccessManager.IContentAccessVerifier
           
 
Field Summary
static int CONTENT_BASED
           
static int NONE
           
static int READ
           
static int WRITE
           
 
Constructor Summary
DataAccessManager()
           
 
Method Summary
abstract  boolean acceptsReplacement(DataAccessManager newManager)
          This method allows a current manager to reject replacement by another DataAccessManager.
abstract  int getAccessLevel(IDataSourceDescriptor dataSourceDescriptor)
          Returns the access level for the provided IDataSourceDescriptor defined as NONE, READ, WRITE or CONTENT_BASED.
abstract  int getAccessLevel(IEntityAction entityAction)
          Returns the access level for the provided IEntityAction defined as NONE, READ, WRITE or CONTENT_BASED.
abstract  int getAccessLevel(IEntityDescriptor entityDescriptor)
          Returns the access level for the provided IEntityDescriptor defined as NONE, READ, WRITE or CONTENT_BASED.
abstract  int getAccessLevel(IFieldDescriptor fieldDescriptor)
          Returns the access level for the provided IFieldDescriptor defined as NONE, READ, WRITE or CONTENT_BASED.
static DataAccessManager getManager()
          Returns the currently active DataAccessManager.
abstract  boolean hasReadAccess(IDataSource dataSource)
          Returns true if the user has read access to the provided IDataSource.
abstract  boolean hasReadAccess(IEntity entity)
          Returns true if the user has read access to the provided IEntity.
abstract  boolean hasReadAccess(IEntityAction entityAction, IEntity data)
          Returns true if the user has read access to the provided IEntityAction object in the data content scope of the provided IEntity object.
abstract  boolean hasReadAccess(IFieldDescriptor fieldDescriptor, IEntity data)
          Returns true if the user has read access to the provided fieldDescriptor in the data content scope of the provided IEntity object.
abstract  boolean hasWriteAccess(IDataSource dataSource)
          Returns true if the user has write access to the provided IDataSource.
abstract  boolean hasWriteAccess(IEntity entity)
          Returns true if the user has write access to the provided IEntity.
abstract  boolean hasWriteAccess(IEntityAction entityAction, IEntity data)
          Returns true if the user has write access to the provided IEntityAction object in the data content scope of the provided IEntity object.
abstract  boolean hasWriteAccess(IFieldDescriptor fieldDescriptor, IEntity data)
          Returns true if the user has write access to the provided fieldDescriptor in the data content scope of the provided IEntity object.
static void setDefaultManager(DataAccessManager newManager)
          Sets the default DataAccessManager object that will be used as the access manager for all threads that has not had another manager explicitly set.
static void setManager(DataAccessManager newManager)
          Sets the active DataAccessManager object that defines the current user's data access rights in the system.
static void setManagerReqursively(DataAccessManager newManager)
          Sets the active DataAccessManager object that defines the current user's data access rights in the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

READ

public static final int READ
See Also:
Constant Field Values

WRITE

public static final int WRITE
See Also:
Constant Field Values

CONTENT_BASED

public static final int CONTENT_BASED
See Also:
Constant Field Values
Constructor Detail

DataAccessManager

public DataAccessManager()
Method Detail

getManager

public static DataAccessManager getManager()
Returns the currently active DataAccessManager. Note that different managers based on the calling thread.


setDefaultManager

public static void setDefaultManager(DataAccessManager newManager)
Sets the default DataAccessManager object that will be used as the access manager for all threads that has not had another manager explicitly set.

The manager will also be inherited by future threads created in the calling thread or any of its unmodified child threads.


setManagerReqursively

public static void setManagerReqursively(DataAccessManager newManager)
Sets the active DataAccessManager object that defines the current user's data access rights in the system. This is done for the current thread and all the threads child threads that have not defined their own DataAccessManager.

The manager will also be inherited by future threads created in the calling thread or any of its unmodified child threads.


setManager

public static void setManager(DataAccessManager newManager)
Sets the active DataAccessManager object that defines the current user's data access rights in the system. This is done for the current thread ONLY and future changes to the manager in any parent threads will no longer affect the thhread that call this method.

The manager will also be inherited by future threads created in the calling thread or any of its unmodified child threads.


getAccessLevel

public abstract int getAccessLevel(IDataSourceDescriptor dataSourceDescriptor)
Returns the access level for the provided IDataSourceDescriptor defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.


getAccessLevel

public abstract int getAccessLevel(IEntityDescriptor entityDescriptor)
Returns the access level for the provided IEntityDescriptor defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.


getAccessLevel

public abstract int getAccessLevel(IFieldDescriptor fieldDescriptor)
Returns the access level for the provided IFieldDescriptor defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.


getAccessLevel

public abstract int getAccessLevel(IEntityAction entityAction)
Returns the access level for the provided IEntityAction defined as NONE, READ, WRITE or CONTENT_BASED. If the access is not content based no further check with hasReadAccess or hasWriteAccess is necessary wich can save alot of performance.


hasReadAccess

public abstract boolean hasReadAccess(IDataSource dataSource)
Returns true if the user has read access to the provided IDataSource.


hasReadAccess

public abstract boolean hasReadAccess(IEntity entity)
Returns true if the user has read access to the provided IEntity.


hasReadAccess

public abstract boolean hasReadAccess(IFieldDescriptor fieldDescriptor,
                                      IEntity data)
Returns true if the user has read access to the provided fieldDescriptor in the data content scope of the provided IEntity object.


hasReadAccess

public abstract boolean hasReadAccess(IEntityAction entityAction,
                                      IEntity data)
Returns true if the user has read access to the provided IEntityAction object in the data content scope of the provided IEntity object.


hasWriteAccess

public abstract boolean hasWriteAccess(IDataSource dataSource)
Returns true if the user has write access to the provided IDataSource.


hasWriteAccess

public abstract boolean hasWriteAccess(IEntity entity)
Returns true if the user has write access to the provided IEntity.


hasWriteAccess

public abstract boolean hasWriteAccess(IFieldDescriptor fieldDescriptor,
                                       IEntity data)
Returns true if the user has write access to the provided fieldDescriptor in the data content scope of the provided IEntity object.


hasWriteAccess

public abstract boolean hasWriteAccess(IEntityAction entityAction,
                                       IEntity data)
Returns true if the user has write access to the provided IEntityAction object in the data content scope of the provided IEntity object.


acceptsReplacement

public abstract boolean acceptsReplacement(DataAccessManager newManager)
This method allows a current manager to reject replacement by another DataAccessManager.



Copyright © 2005 Caleigo. All Rights Reserved.