New audit config using 3.2 XSD

- Added helper classes for auto-generating code (core project)
 - Audit configuration is loaded using a separate bean and unmarshalled using JAXB
 - First cut of data extractors and generators that will be required


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15842 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-08-20 16:06:31 +00:00
parent a96352a781
commit dd54579244
28 changed files with 1866 additions and 48 deletions

View File

@@ -0,0 +1,57 @@
/*
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.audit.extractor;
/**
* Interface for Audit data value extractors. These are used to extract auditable values
* from those arguments, return values, exceptions and any other value passed into the audit
* components for recording.
* <p/>
* The framework will first determine if data passed into the instance is {@link #isSupported(Object) supported}
* and will then pass it in for {@link #convert(Object) conversion} to the type that will be
* recorded.
*
* @author Derek Hulley
* @since 3.2
*/
public interface DataExtractor
{
/**
* Determines if the extractor will be able to pull any data from the given value.
*
* @param data the data that might be useful to this extractor (could be <tt>null</tt>)
* @return Returns <tt>true</tt> if the data is meaningful to this extractor
*/
public boolean isSupported(Object data);
/**
* Convert an value passed into the audit components into a value to be recorded.
*
* @param value the value to convert
* @return the (potentially) converted value
* @throws Throwable All errors will be handled by the calling framework
*/
public Object convert(Object value) throws Throwable;
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.audit.extractor;
/**
* An extractor that supports all values and does not conversion.
* This implementation can be used as a base class, although there is little
* abstraction necessary for the converters in general.
*
* @author Derek Hulley
* @since 3.2
*/
public class SimpleValueDataExtractor implements DataExtractor
{
/**
* @return Returns <tt>true</tt> always
*/
public boolean isSupported(Object data)
{
return true;
}
/**
* Just returns the value unchanged
*/
public Object convert(Object in) throws Throwable
{
return in;
}
}