com.googlecode.fascinator.access.derby
Class DerbyAccessControl

java.lang.Object
  extended by com.googlecode.fascinator.access.derby.DerbyAccessControl
All Implemented Interfaces:
AccessControl, Plugin

public class DerbyAccessControl
extends Object
implements AccessControl

This plugin is a Fascinator access control plugin using Derby database

Configuration

Standard configuration table:

Option Description Required Default
derbyHome Path in which derby database will be created and used Yes ${fascinator.home}/database

Examples

  1. Using Derby access control as the plugin in the Fascinator
          "accesscontrol": {
                 "type" : "derby",
                 "derby" : {
                     "derbyHome" : "${fascinator.home}/database"
                 }
             }
     

Wiki Link

None

Author:
Greg Pendlebury

Constructor Summary
DerbyAccessControl()
           
 
Method Summary
 void applySchema(AccessControlSchema newSecurity)
          Apply/store a new security implementation.
 AccessControlSchema getEmptySchema()
          Return an empty security schema for the portal to investigate and/or populate.
 String getId()
          Gets an identifier for this type of plugin.
 String getName()
          Gets a name for this plugin.
 PluginDescription getPluginDetails()
          Gets a PluginDescription object relating to this plugin.
 List<String> getPossibilities(String field)
          Retrieve a list of possible field values for a given field if the plugin supports this feature.
 List<String> getRoles(String recordId)
          A basic wrapper for getSchemas() to return just the roles of the schemas.
 List<AccessControlSchema> getSchemas(String recordId)
          Get a list of schemas that have been applied to a record.
 List<String> getUsers(String recordId)
           
 void init(File jsonFile)
          Initializes the plugin using the specified JSON configuration
 void init(String jsonString)
          Initializes the plugin using the specified JSON String
 void removeSchema(AccessControlSchema oldSecurity)
          Remove a security implementation.
 void shutdown()
          Shuts down the plugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyAccessControl

public DerbyAccessControl()
Method Detail

getId

public String getId()
Gets an identifier for this type of plugin. This should be a simple name such as "file-system" for a storage plugin, for example.

Specified by:
getId in interface Plugin
Returns:
the plugin type id

getName

public String getName()
Gets a name for this plugin. This should be a descriptive name.

Specified by:
getName in interface Plugin
Returns:
the plugin name

getPluginDetails

public PluginDescription getPluginDetails()
Gets a PluginDescription object relating to this plugin.

Specified by:
getPluginDetails in interface Plugin
Returns:
a PluginDescription

init

public void init(String jsonString)
          throws AccessControlException
Initializes the plugin using the specified JSON String

Specified by:
init in interface Plugin
Parameters:
jsonString - JSON configuration string
Throws:
PluginException - if there was an error in initialization
AccessControlException

init

public void init(File jsonFile)
          throws AccessControlException
Initializes the plugin using the specified JSON configuration

Specified by:
init in interface Plugin
Parameters:
jsonFile - JSON configuration file
Throws:
AccessControlException - if there was an error in initialization

shutdown

public void shutdown()
              throws AccessControlException
Shuts down the plugin

Specified by:
shutdown in interface Plugin
Throws:
AccessControlException - if there was an error during shutdown

getEmptySchema

public AccessControlSchema getEmptySchema()
Return an empty security schema for the portal to investigate and/or populate.

Specified by:
getEmptySchema in interface AccessControl
Returns:
An empty security schema

getSchemas

public List<AccessControlSchema> getSchemas(String recordId)
                                     throws AccessControlException
Get a list of schemas that have been applied to a record.

Specified by:
getSchemas in interface AccessControl
Parameters:
recordId - The record to retrieve information about.
Returns:
A list of access control schemas, possibly zero length.
Throws:
AccessControlException - if there was an error during retrieval.

applySchema

public void applySchema(AccessControlSchema newSecurity)
                 throws AccessControlException
Apply/store a new security implementation. The schema will already have a recordId as a property.

Specified by:
applySchema in interface AccessControl
Parameters:
newSecurity - The new schema to apply.
Throws:
AccessControlException - if storage of the schema fails.

removeSchema

public void removeSchema(AccessControlSchema oldSecurity)
                  throws AccessControlException
Remove a security implementation. The schema will already have a recordId as a property.

Specified by:
removeSchema in interface AccessControl
Parameters:
oldSecurity - The schema to remove.
Throws:
AccessControlException - if removal of the schema fails.

getUsers

public List<String> getUsers(String recordId)
                      throws AccessControlException
Specified by:
getUsers in interface AccessControl
Throws:
AccessControlException

getRoles

public List<String> getRoles(String recordId)
                      throws AccessControlException
A basic wrapper for getSchemas() to return just the roles of the schemas. Useful during index and/or audit when this is the only data required.

Specified by:
getRoles in interface AccessControl
Parameters:
recordId - The record to retrieve roles for.
Returns:
A list of Strings containing role names.
Throws:
AccessControlException - if there was an error during retrieval.

getPossibilities

public List<String> getPossibilities(String field)
                              throws AccessControlException
Retrieve a list of possible field values for a given field if the plugin supports this feature.

Specified by:
getPossibilities in interface AccessControl
Parameters:
field - The field name.
Returns:
A list of String containing possible values
Throws:
AccessControlException - if the field doesn't exist or there was an error during retrieval


Copyright © 2009-2014. All Rights Reserved.