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,105 @@
/*
* 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.model;
import java.io.File;
import java.net.URL;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.UnmarshalException;
import javax.xml.bind.Unmarshaller;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.audit.model._3.Audit;
import org.alfresco.util.PropertyCheck;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.ResourceUtils;
/**
* A component used to load Audit configuration XML documents.
*
* @author Derek Hulley
* @since 3.2
*/
public class AuditModelReader implements InitializingBean
{
private URL configUrl;
private AuditModelRegistry auditModelRegistry;
/**
* Set the XML location using <b>file:</b>, <b>classpath:</b> or any of the
* {@link ResourceUtils Spring-supported} formats.
*
* @param configUrl the location of the XML file
*/
public void setConfigUrl(URL configUrl)
{
this.configUrl = configUrl;
}
/**
*
* @param auditModelRegistry the registry that combines all loaded models
*/
public void setAuditModelRegistry(AuditModelRegistry auditModelRegistry)
{
this.auditModelRegistry = auditModelRegistry;
}
/**
* Pulls in the configuration and registers it
*/
public void afterPropertiesSet() throws Exception
{
PropertyCheck.mandatory(this, "configUrl", configUrl);
PropertyCheck.mandatory(this, "auditModelRegistry", auditModelRegistry);
File file = new File(configUrl.getFile());
if (!file.exists())
{
throw new AlfrescoRuntimeException("The Audit configuration XML was not found: " + configUrl);
}
// Load it
JAXBContext jaxbCtx = JAXBContext.newInstance("org.alfresco.repo.audit.model._3");
Unmarshaller jaxbUnmarshaller = jaxbCtx.createUnmarshaller();
try
{
@SuppressWarnings("unchecked")
JAXBElement<Audit> auditElement = (JAXBElement<Audit>) jaxbUnmarshaller.unmarshal(configUrl);
Audit audit = auditElement.getValue();
// Now register it
auditModelRegistry.registerModel(configUrl, audit);
}
catch (UnmarshalException e)
{
throw new AlfrescoRuntimeException(
"Failed to read Audit configuration XML: \n" +
" URL: " + configUrl + "\n" +
" Error: " + e.getMessage());
}
}
}

View File

@@ -0,0 +1,141 @@
/*
* 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.model;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.alfresco.repo.audit.extractor.DataExtractor;
import org.alfresco.repo.audit.generator.DataGenerator;
import org.alfresco.repo.audit.model._3.Application;
import org.alfresco.repo.audit.model._3.Audit;
import org.alfresco.repo.audit.model._3.DataExtractors;
import org.alfresco.repo.audit.model._3.DataGenerators;
/**
* Component used to store audit model definitions. It ensures that duplicate application and converter
* definitions are detected and provides a single lookup for code using the Audit model.
*
* @author Derek Hulley
* @since 3.2
*/
public class AuditModelRegistry
{
private final Map<URL, Audit> auditModelsByUrl;
private final Map<String, DataExtractor> dataExtractorsByName;
private final Map<String, DataGenerator> dataGeneratorsByName;
private final Map<String, Application> auditApplicationsByName;
public AuditModelRegistry()
{
auditModelsByUrl = new HashMap<URL, Audit>(7);
dataExtractorsByName = new HashMap<String, DataExtractor>(13);
dataGeneratorsByName = new HashMap<String, DataGenerator>(13);
auditApplicationsByName = new HashMap<String, Application>(7);
}
/**
* Register an audit model.
*
* @param configurationUrl the source of the configuration
* @param audit the unmarshalled instance tree
*/
public void registerModel(URL configurationUrl, Audit audit)
{
// Get the data extractors and check for duplicates
DataExtractors extractorsElement = audit.getDataExtractors();
List<org.alfresco.repo.audit.model._3.DataExtractor> converterElements = extractorsElement.getDataExtractor();
for (org.alfresco.repo.audit.model._3.DataExtractor converterElement : converterElements)
{
String name = converterElement.getName();
if (dataExtractorsByName.containsKey(name))
{
throw new AuditModelException("Audit data extractor '" + name + "' has already been defined.");
}
// Construct the converter
final DataExtractor dataExtractor;
try
{
Class<?> dataExtractorClazz = Class.forName(converterElement.getClazz());
dataExtractor = (DataExtractor) dataExtractorClazz.newInstance();
}
catch (ClassNotFoundException e)
{
throw new AuditModelException(
"Audit data extractor '" + name + "' class not found: " + converterElement.getClazz());
}
catch (Exception e)
{
throw new AuditModelException(
"Audit data extractor '" + name + "' could not be constructed: " + converterElement.getClazz());
}
dataExtractorsByName.put(name, dataExtractor);
}
// Get the data generators and check for duplicates
DataGenerators generatorsElement = audit.getDataGenerators();
List<org.alfresco.repo.audit.model._3.DataGenerator> generatorElements = generatorsElement.getDataGenerator();
for (org.alfresco.repo.audit.model._3.DataGenerator generatorElement : generatorElements)
{
String name = generatorElement.getName();
if (dataGeneratorsByName.containsKey(name))
{
throw new AuditModelException("Audit data generator '" + name + "' has already been defined.");
}
// Construct the converter
final DataGenerator dataGenerator;
try
{
Class<?> dataExtractorClazz = Class.forName(generatorElement.getClazz());
dataGenerator = (DataGenerator) dataExtractorClazz.newInstance();
}
catch (ClassNotFoundException e)
{
throw new AuditModelException(
"Audit data generator '" + name + "' class not found: " + generatorElement.getClazz());
}
catch (Exception e)
{
throw new AuditModelException(
"Audit data generator '" + name + "' could not be constructed: " + generatorElement.getClazz());
}
dataGeneratorsByName.put(name, dataGenerator);
}
// Get the application and check for duplicates
List<Application> applications = audit.getApplication();
for (Application application : applications)
{
String name = application.getName();
if (auditApplicationsByName.containsKey(name))
{
throw new AuditModelException("Audit application '" + name + "' has already been defined.");
}
auditApplicationsByName.put(name, application);
}
// Store the model
auditModelsByUrl.put(configurationUrl, audit);
}
}

View File

@@ -0,0 +1,60 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Application complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Application">
* &lt;complexContent>
* &lt;extension base="{http://www.alfresco.org/repo/audit/model/3.2}AuditPath">
* &lt;attribute name="name" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Application")
public class Application
extends AuditPath
{
@XmlAttribute(required = true)
protected String name;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
}

View File

@@ -0,0 +1,125 @@
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Audit complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Audit">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="DataExtractors" type="{http://www.alfresco.org/repo/audit/model/3.2}DataExtractors" minOccurs="0"/>
* &lt;element name="DataGenerators" type="{http://www.alfresco.org/repo/audit/model/3.2}DataGenerators" minOccurs="0"/>
* &lt;element name="Application" type="{http://www.alfresco.org/repo/audit/model/3.2}Application" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Audit", propOrder = {
"dataExtractors",
"dataGenerators",
"application"
})
public class Audit {
@XmlElement(name = "DataExtractors")
protected DataExtractors dataExtractors;
@XmlElement(name = "DataGenerators")
protected DataGenerators dataGenerators;
@XmlElement(name = "Application")
protected List<Application> application;
/**
* Gets the value of the dataExtractors property.
*
* @return
* possible object is
* {@link DataExtractors }
*
*/
public DataExtractors getDataExtractors() {
return dataExtractors;
}
/**
* Sets the value of the dataExtractors property.
*
* @param value
* allowed object is
* {@link DataExtractors }
*
*/
public void setDataExtractors(DataExtractors value) {
this.dataExtractors = value;
}
/**
* Gets the value of the dataGenerators property.
*
* @return
* possible object is
* {@link DataGenerators }
*
*/
public DataGenerators getDataGenerators() {
return dataGenerators;
}
/**
* Sets the value of the dataGenerators property.
*
* @param value
* allowed object is
* {@link DataGenerators }
*
*/
public void setDataGenerators(DataGenerators value) {
this.dataGenerators = value;
}
/**
* Gets the value of the application property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the application property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getApplication().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Application }
*
*
*/
public List<Application> getApplication() {
if (application == null) {
application = new ArrayList<Application>();
}
return this.application;
}
}

View File

@@ -0,0 +1,169 @@
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AuditPath complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="AuditPath">
* &lt;complexContent>
* &lt;extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
* &lt;sequence>
* &lt;element name="AuditSession" type="{http://www.alfresco.org/repo/audit/model/3.2}AuditSession" minOccurs="0"/>
* &lt;element name="RecordValue" type="{http://www.alfresco.org/repo/audit/model/3.2}RecordValue" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="GenerateValue" type="{http://www.alfresco.org/repo/audit/model/3.2}GenerateValue" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="AuditPath" type="{http://www.alfresco.org/repo/audit/model/3.2}AuditPath" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AuditPath", propOrder = {
"auditSession",
"recordValue",
"generateValue",
"auditPath"
})
@XmlSeeAlso({
Application.class
})
public class AuditPath
extends KeyedAuditDefinition
{
@XmlElement(name = "AuditSession")
protected AuditSession auditSession;
@XmlElement(name = "RecordValue")
protected List<RecordValue> recordValue;
@XmlElement(name = "GenerateValue")
protected List<GenerateValue> generateValue;
@XmlElement(name = "AuditPath")
protected List<AuditPath> auditPath;
/**
* Gets the value of the auditSession property.
*
* @return
* possible object is
* {@link AuditSession }
*
*/
public AuditSession getAuditSession() {
return auditSession;
}
/**
* Sets the value of the auditSession property.
*
* @param value
* allowed object is
* {@link AuditSession }
*
*/
public void setAuditSession(AuditSession value) {
this.auditSession = value;
}
/**
* Gets the value of the recordValue property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the recordValue property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRecordValue().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link RecordValue }
*
*
*/
public List<RecordValue> getRecordValue() {
if (recordValue == null) {
recordValue = new ArrayList<RecordValue>();
}
return this.recordValue;
}
/**
* Gets the value of the generateValue property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the generateValue property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getGenerateValue().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link GenerateValue }
*
*
*/
public List<GenerateValue> getGenerateValue() {
if (generateValue == null) {
generateValue = new ArrayList<GenerateValue>();
}
return this.generateValue;
}
/**
* Gets the value of the auditPath property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the auditPath property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAuditPath().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link AuditPath }
*
*
*/
public List<AuditPath> getAuditPath() {
if (auditPath == null) {
auditPath = new ArrayList<AuditPath>();
}
return this.auditPath;
}
}

View File

@@ -0,0 +1,69 @@
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AuditSession complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="AuditSession">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="GenerateValue" type="{http://www.alfresco.org/repo/audit/model/3.2}GenerateValue" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AuditSession", propOrder = {
"generateValue"
})
public class AuditSession {
@XmlElement(name = "GenerateValue")
protected List<GenerateValue> generateValue;
/**
* Gets the value of the generateValue property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the generateValue property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getGenerateValue().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link GenerateValue }
*
*
*/
public List<GenerateValue> getGenerateValue() {
if (generateValue == null) {
generateValue = new ArrayList<GenerateValue>();
}
return this.generateValue;
}
}

View File

@@ -0,0 +1,85 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DataExtractor complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="DataExtractor">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
* &lt;attribute name="class" type="{http://www.alfresco.org/repo/audit/model/3.2}ClassAttribute" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DataExtractor")
public class DataExtractor {
@XmlAttribute
protected String name;
@XmlAttribute(name = "class")
protected String clazz;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the clazz property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getClazz() {
return clazz;
}
/**
* Sets the value of the clazz property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setClazz(String value) {
this.clazz = value;
}
}

View File

@@ -0,0 +1,69 @@
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DataExtractors complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="DataExtractors">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="DataExtractor" type="{http://www.alfresco.org/repo/audit/model/3.2}DataExtractor" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DataExtractors", propOrder = {
"dataExtractor"
})
public class DataExtractors {
@XmlElement(name = "DataExtractor", required = true)
protected List<DataExtractor> dataExtractor;
/**
* Gets the value of the dataExtractor property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the dataExtractor property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDataExtractor().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DataExtractor }
*
*
*/
public List<DataExtractor> getDataExtractor() {
if (dataExtractor == null) {
dataExtractor = new ArrayList<DataExtractor>();
}
return this.dataExtractor;
}
}

View File

@@ -0,0 +1,85 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DataGenerator complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="DataGenerator">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
* &lt;attribute name="class" type="{http://www.alfresco.org/repo/audit/model/3.2}ClassAttribute" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DataGenerator")
public class DataGenerator {
@XmlAttribute
protected String name;
@XmlAttribute(name = "class")
protected String clazz;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the clazz property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getClazz() {
return clazz;
}
/**
* Sets the value of the clazz property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setClazz(String value) {
this.clazz = value;
}
}

View File

@@ -0,0 +1,69 @@
package org.alfresco.repo.audit.model._3;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DataGenerators complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="DataGenerators">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="DataGenerator" type="{http://www.alfresco.org/repo/audit/model/3.2}DataGenerator" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DataGenerators", propOrder = {
"dataGenerator"
})
public class DataGenerators {
@XmlElement(name = "DataGenerator", required = true)
protected List<DataGenerator> dataGenerator;
/**
* Gets the value of the dataGenerator property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the dataGenerator property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDataGenerator().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DataGenerator }
*
*
*/
public List<DataGenerator> getDataGenerator() {
if (dataGenerator == null) {
dataGenerator = new ArrayList<DataGenerator>();
}
return this.dataGenerator;
}
}

View File

@@ -0,0 +1,60 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for GenerateValue complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="GenerateValue">
* &lt;complexContent>
* &lt;extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
* &lt;attribute name="dataGenerator" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GenerateValue")
public class GenerateValue
extends KeyedAuditDefinition
{
@XmlAttribute(required = true)
protected String dataGenerator;
/**
* Gets the value of the dataGenerator property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDataGenerator() {
return dataGenerator;
}
/**
* Sets the value of the dataGenerator property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDataGenerator(String value) {
this.dataGenerator = value;
}
}

View File

@@ -0,0 +1,64 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for KeyedAuditDefinition complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="KeyedAuditDefinition">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="key" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}KeyAttribute" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyedAuditDefinition")
@XmlSeeAlso({
GenerateValue.class,
AuditPath.class,
RecordValue.class
})
public class KeyedAuditDefinition {
@XmlAttribute(required = true)
protected String key;
/**
* Gets the value of the key property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getKey() {
return key;
}
/**
* Sets the value of the key property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setKey(String value) {
this.key = value;
}
}

View File

@@ -0,0 +1,133 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the org.alfresco.repo.audit.model._3 package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
private final static QName _Audit_QNAME = new QName("http://www.alfresco.org/repo/audit/model/3.2", "Audit");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.alfresco.repo.audit.model._3
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link DataExtractors }
*
*/
public DataExtractors createDataExtractors() {
return new DataExtractors();
}
/**
* Create an instance of {@link AuditPath }
*
*/
public AuditPath createAuditPath() {
return new AuditPath();
}
/**
* Create an instance of {@link DataGenerators }
*
*/
public DataGenerators createDataGenerators() {
return new DataGenerators();
}
/**
* Create an instance of {@link KeyedAuditDefinition }
*
*/
public KeyedAuditDefinition createKeyedAuditDefinition() {
return new KeyedAuditDefinition();
}
/**
* Create an instance of {@link RecordValue }
*
*/
public RecordValue createRecordValue() {
return new RecordValue();
}
/**
* Create an instance of {@link DataGenerator }
*
*/
public DataGenerator createDataGenerator() {
return new DataGenerator();
}
/**
* Create an instance of {@link AuditSession }
*
*/
public AuditSession createAuditSession() {
return new AuditSession();
}
/**
* Create an instance of {@link GenerateValue }
*
*/
public GenerateValue createGenerateValue() {
return new GenerateValue();
}
/**
* Create an instance of {@link DataExtractor }
*
*/
public DataExtractor createDataExtractor() {
return new DataExtractor();
}
/**
* Create an instance of {@link Application }
*
*/
public Application createApplication() {
return new Application();
}
/**
* Create an instance of {@link Audit }
*
*/
public Audit createAudit() {
return new Audit();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Audit }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.alfresco.org/repo/audit/model/3.2", name = "Audit")
public JAXBElement<Audit> createAudit(Audit value) {
return new JAXBElement<Audit>(_Audit_QNAME, Audit.class, null, value);
}
}

View File

@@ -0,0 +1,60 @@
package org.alfresco.repo.audit.model._3;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for RecordValue complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="RecordValue">
* &lt;complexContent>
* &lt;extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
* &lt;attribute name="dataExtractor" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RecordValue")
public class RecordValue
extends KeyedAuditDefinition
{
@XmlAttribute(required = true)
protected String dataExtractor;
/**
* Gets the value of the dataExtractor property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDataExtractor() {
return dataExtractor;
}
/**
* Sets the value of the dataExtractor property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDataExtractor(String value) {
this.dataExtractor = value;
}
}

View File

@@ -0,0 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.alfresco.org/repo/audit/model/3.2", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.alfresco.repo.audit.model._3;