Personal tools

Ace:Expanding the Audit Manager

From Adapt

Revision as of 20:01, 8 May 2009 by Toaster (talk | contribs)
Jump to: navigation, search

Overview

The Audit Manager is designed to be somewhat easy to expand. Storage types are added by extending the StorageAccess class, registering your new driver in the StorageAccessFactory, and lastly creating a configuration page for your storage.

Extend StorageAccess

StorageAccess provides an abstract class that all storage types must implement. Methods to be implemented are listed below.

void setParameters(Map m)
Store parameters from the supplied map to configure an instance of your resource.
String checkParameters(Map m, String path)
Called to determine if user supplied parameters are valid.
void remove(EntityManager em)
String getPage()
AuditIterable<FileBean> getWorkList(String startPath, PathFilter filter)
InputStream getItemInputStream(String itemPath) throws IOException

Listing files to be audited

Create Configuration Page

Register your resource

In edu.umiacs.ace.monitor.audit.StorageAccessFactory, you will need to add a line in the static block near the top. Add a new line to insert your new driver into the list of available drivers. implementationMap contains a mapping of string (descriptive name) to the implementing class.

    static
    {
        implementationMap.put("irods", IrodsAccess.class);
        implementationMap.put("local", LocalFileAccess.class);
        implementationMap.put("srb", SrbAccess.class);
    }