diff --git a/.classpath b/.classpath index 243cbebc41..bf7cfd6245 100644 --- a/.classpath +++ b/.classpath @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/.externalToolBuilders/JibX.launch b/.externalToolBuilders/JibX.launch index 7ef90b1e04..9ce98180d7 100644 --- a/.externalToolBuilders/JibX.launch +++ b/.externalToolBuilders/JibX.launch @@ -1,33 +1,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/alfresco/audit-services-context.xml b/config/alfresco/audit-services-context.xml index 57b937343f..c91e2e877d 100644 --- a/config/alfresco/audit-services-context.xml +++ b/config/alfresco/audit-services-context.xml @@ -72,5 +72,18 @@ + + + + + + + + + + classpath:alfresco/audit/alfresco-audit-repository.xml + + + \ No newline at end of file diff --git a/config/alfresco/audit/alfresco-audit-3.2.xsd b/config/alfresco/audit/alfresco-audit-3.2.xsd new file mode 100644 index 0000000000..db39e32c93 --- /dev/null +++ b/config/alfresco/audit/alfresco-audit-3.2.xsd @@ -0,0 +1,121 @@ + + + + + Schema to define audit configuration (V3.2). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/alfresco/audit/alfresco-audit-repository.xml b/config/alfresco/audit/alfresco-audit-repository.xml new file mode 100644 index 0000000000..b9f17ec74d --- /dev/null +++ b/config/alfresco/audit/alfresco-audit-repository.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/audit/AuditComponent.java b/source/java/org/alfresco/repo/audit/AuditComponent.java index c70b24ba59..a8e8ba84f5 100644 --- a/source/java/org/alfresco/repo/audit/AuditComponent.java +++ b/source/java/org/alfresco/repo/audit/AuditComponent.java @@ -25,24 +25,30 @@ package org.alfresco.repo.audit; import java.util.List; +import java.util.Map; +import org.alfresco.repo.audit.model._3.AuditPath; import org.alfresco.service.cmr.audit.AuditInfo; import org.alfresco.service.cmr.repository.NodeRef; import org.aopalliance.intercept.MethodInvocation; /** * The audit component. Used by the AuditService and AuditMethodInterceptor to insert audit entries. + *

+ * The V3.2 audit functionality is contained within the same component. When the newer audit + * implementation has been tested and approved, then older ones will be deprecated as necessary. * * @author Andy Hind + * @author Derek Hulley */ public interface AuditComponent { /** * Audit entry point for method interceptors. * - * @param methodInvocation * @return - the return onbject from the normal invocation of the audited method. - * @throws Throwable + * + * @since 2.1 */ public Object audit(MethodInvocation methodInvocation) throws Throwable; @@ -55,6 +61,8 @@ public interface AuditComponent * a node ref to use as the key for filtering etc * @param args - * an arbitrary list of parameters + * + * @since 2.1 */ public void audit(String source, String description, NodeRef key, Object... args); @@ -64,7 +72,30 @@ public interface AuditComponent * @param nodeRef - * the node ref for which we want the audit trail * @return - a list of AuditInfo objects that represent the audit trail for the given node reference. + * + * @since 2.1 */ public List getAuditTrail(NodeRef nodeRef); + /** + * Start an audit session for the given root path. All later audit operations on the resulting + * session will be relative to this root path. + * + * @param rootPath a base path of {@link AuditPath} key entries concatenated with . (period) + * @return Returns the unique session identifier + */ + public Long startAuditSession(String rootPath); + + /** + * Record a set of values against the given session. + * + * @param sessionId a pre-existing audit session to continue with + * @param values the values to audit mapped by {@link AuditPath} key relative to the session + * root path + * + * @see #startAuditSession() + * + * @since 3.2 + */ + public void audit(Long sessionId, Map values); } diff --git a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java index ec8db0840e..35310108b0 100644 --- a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java +++ b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java @@ -30,6 +30,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Date; import java.util.List; +import java.util.Map; import org.alfresco.repo.audit.model.AuditEntry; import org.alfresco.repo.audit.model.TrueFalseUnset; @@ -56,8 +57,12 @@ import org.apache.commons.logging.LogFactory; /** * The default audit component implementation. TODO: Implement before, after and exception filtering. At the moment * these filters are ignored. TODO: Respect audit internal - at the moment audit internal is fixed to false. + *

+ * The V3.2 audit functionality is contained within the same component. When the newer audit + * implementation has been tested and approved, then older ones will be deprecated as necessary. * * @author Andy Hind + * @author Derek Hulley */ public class AuditComponentImpl implements AuditComponent { @@ -752,4 +757,17 @@ public class AuditComponentImpl implements AuditComponent return result; } + /* + * V3.2 from here on. Put all fixes to the older audit code before this point, please. + */ + + public Long startAuditSession(String rootPath) + { + throw new UnsupportedOperationException(); + } + + public void audit(Long sessionId, Map values) + { + throw new UnsupportedOperationException(); + } } diff --git a/source/java/org/alfresco/repo/audit/extractor/DataExtractor.java b/source/java/org/alfresco/repo/audit/extractor/DataExtractor.java new file mode 100644 index 0000000000..2d2d67ea9a --- /dev/null +++ b/source/java/org/alfresco/repo/audit/extractor/DataExtractor.java @@ -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. + *

+ * 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 null) + * @return Returns true 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; +} diff --git a/source/java/org/alfresco/repo/audit/extractor/SimpleValueDataExtractor.java b/source/java/org/alfresco/repo/audit/extractor/SimpleValueDataExtractor.java new file mode 100644 index 0000000000..0cd2e93b73 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/extractor/SimpleValueDataExtractor.java @@ -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 true always + */ + public boolean isSupported(Object data) + { + return true; + } + + /** + * Just returns the value unchanged + */ + public Object convert(Object in) throws Throwable + { + return in; + } +} diff --git a/source/java/org/alfresco/repo/audit/generator/AuthenticatedUserDataGenerator.java b/source/java/org/alfresco/repo/audit/generator/AuthenticatedUserDataGenerator.java new file mode 100644 index 0000000000..1f7de8ee14 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/generator/AuthenticatedUserDataGenerator.java @@ -0,0 +1,44 @@ +/* + * 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.generator; + +import org.alfresco.repo.security.authentication.AuthenticationUtil; + +/** + * Gives back the currently-authenticated user. + * + * @author Derek Hulley + * @since 3.2 + */ +public class AuthenticatedUserDataGenerator implements DataGenerator +{ + /** + * @return Returns the currently-authenticated user + */ + public Object getData() throws Throwable + { + return AuthenticationUtil.getFullyAuthenticatedUser(); + } +} diff --git a/source/java/org/alfresco/repo/audit/generator/DataGenerator.java b/source/java/org/alfresco/repo/audit/generator/DataGenerator.java new file mode 100644 index 0000000000..f1933d5074 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/generator/DataGenerator.java @@ -0,0 +1,46 @@ +/* + * 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.generator; + +/** + * Interface for Audit data value generators.These are used to produce auditable data values + * extract auditable values from nothing; typically these values are derived from the system + * state or from the thread context. + *

+ * null values will be ignored by the audit framework. + * + * @author Derek Hulley + * @since 3.2 + */ +public interface DataGenerator +{ + /** + * Get the data generated by the instance. + * + * @return Returns the generated data + * @throws Throwable All exceptions are handled by the framework + */ + public Object getData() throws Throwable; +} diff --git a/source/java/org/alfresco/repo/audit/generator/SystemTimeDataGenerator.java b/source/java/org/alfresco/repo/audit/generator/SystemTimeDataGenerator.java new file mode 100644 index 0000000000..698a5c2444 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/generator/SystemTimeDataGenerator.java @@ -0,0 +1,44 @@ +/* + * 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.generator; + +import java.util.Date; + +/** + * Gives back the currently time. + * + * @author Derek Hulley + * @since 3.2 + */ +public class SystemTimeDataGenerator implements DataGenerator +{ + /** + * @return Returns the current time + */ + public Object getData() throws Throwable + { + return new Date(); + } +} diff --git a/source/java/org/alfresco/repo/audit/generator/TransactionIdDataGenerator.java b/source/java/org/alfresco/repo/audit/generator/TransactionIdDataGenerator.java new file mode 100644 index 0000000000..ade808b765 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/generator/TransactionIdDataGenerator.java @@ -0,0 +1,44 @@ +/* + * 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.generator; + +import org.alfresco.repo.transaction.AlfrescoTransactionSupport; + +/** + * Gives back the currently transaction ID. + * + * @author Derek Hulley + * @since 3.2 + */ +public class TransactionIdDataGenerator implements DataGenerator +{ + /** + * @return Returns the current transaction ID (null if not in a transction) + */ + public Object getData() throws Throwable + { + return AlfrescoTransactionSupport.getTransactionId(); + } +} diff --git a/source/java/org/alfresco/repo/audit/model/AuditModelReader.java b/source/java/org/alfresco/repo/audit/model/AuditModelReader.java new file mode 100644 index 0000000000..fd3dfdb09f --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/AuditModelReader.java @@ -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 file:, classpath: 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 auditElement = (JAXBElement) 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()); + } + } +} diff --git a/source/java/org/alfresco/repo/audit/model/AuditModelRegistry.java b/source/java/org/alfresco/repo/audit/model/AuditModelRegistry.java new file mode 100644 index 0000000000..565e808c63 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/AuditModelRegistry.java @@ -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 auditModelsByUrl; + private final Map dataExtractorsByName; + private final Map dataGeneratorsByName; + private final Map auditApplicationsByName; + + public AuditModelRegistry() + { + auditModelsByUrl = new HashMap(7); + dataExtractorsByName = new HashMap(13); + dataGeneratorsByName = new HashMap(13); + auditApplicationsByName = new HashMap(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 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 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 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); + } +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/Application.java b/source/java/org/alfresco/repo/audit/model/_3/Application.java new file mode 100644 index 0000000000..2237f46be8 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/Application.java @@ -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; + + +/** + *

Java class for Application complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Application">
+ *   <complexContent>
+ *     <extension base="{http://www.alfresco.org/repo/audit/model/3.2}AuditPath">
+ *       <attribute name="name" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/Audit.java b/source/java/org/alfresco/repo/audit/model/_3/Audit.java new file mode 100644 index 0000000000..4d45ea6ba3 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/Audit.java @@ -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; + + +/** + *

Java class for Audit complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Audit">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="DataExtractors" type="{http://www.alfresco.org/repo/audit/model/3.2}DataExtractors" minOccurs="0"/>
+ *         <element name="DataGenerators" type="{http://www.alfresco.org/repo/audit/model/3.2}DataGenerators" minOccurs="0"/>
+ *         <element name="Application" type="{http://www.alfresco.org/repo/audit/model/3.2}Application" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + + /** + * 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. + * + *

+ * 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 set method for the application property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getApplication().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Application } + * + * + */ + public List getApplication() { + if (application == null) { + application = new ArrayList(); + } + return this.application; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java b/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java new file mode 100644 index 0000000000..1fc0deb79c --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/AuditPath.java @@ -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; + + +/** + *

Java class for AuditPath complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AuditPath">
+ *   <complexContent>
+ *     <extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
+ *       <sequence>
+ *         <element name="AuditSession" type="{http://www.alfresco.org/repo/audit/model/3.2}AuditSession" minOccurs="0"/>
+ *         <element name="RecordValue" type="{http://www.alfresco.org/repo/audit/model/3.2}RecordValue" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="GenerateValue" type="{http://www.alfresco.org/repo/audit/model/3.2}GenerateValue" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="AuditPath" type="{http://www.alfresco.org/repo/audit/model/3.2}AuditPath" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + @XmlElement(name = "GenerateValue") + protected List generateValue; + @XmlElement(name = "AuditPath") + protected List 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. + * + *

+ * 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 set method for the recordValue property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getRecordValue().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link RecordValue } + * + * + */ + public List getRecordValue() { + if (recordValue == null) { + recordValue = new ArrayList(); + } + return this.recordValue; + } + + /** + * Gets the value of the generateValue property. + * + *

+ * 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 set method for the generateValue property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getGenerateValue().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link GenerateValue } + * + * + */ + public List getGenerateValue() { + if (generateValue == null) { + generateValue = new ArrayList(); + } + return this.generateValue; + } + + /** + * Gets the value of the auditPath property. + * + *

+ * 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 set method for the auditPath property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAuditPath().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link AuditPath } + * + * + */ + public List getAuditPath() { + if (auditPath == null) { + auditPath = new ArrayList(); + } + return this.auditPath; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/AuditSession.java b/source/java/org/alfresco/repo/audit/model/_3/AuditSession.java new file mode 100644 index 0000000000..a0e29f5f26 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/AuditSession.java @@ -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; + + +/** + *

Java class for AuditSession complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AuditSession">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="GenerateValue" type="{http://www.alfresco.org/repo/audit/model/3.2}GenerateValue" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AuditSession", propOrder = { + "generateValue" +}) +public class AuditSession { + + @XmlElement(name = "GenerateValue") + protected List generateValue; + + /** + * Gets the value of the generateValue property. + * + *

+ * 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 set method for the generateValue property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getGenerateValue().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link GenerateValue } + * + * + */ + public List getGenerateValue() { + if (generateValue == null) { + generateValue = new ArrayList(); + } + return this.generateValue; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java b/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java new file mode 100644 index 0000000000..746584e92e --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/DataExtractor.java @@ -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; + + +/** + *

Java class for DataExtractor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="DataExtractor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
+ *       <attribute name="class" type="{http://www.alfresco.org/repo/audit/model/3.2}ClassAttribute" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java b/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java new file mode 100644 index 0000000000..580f855b2e --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/DataExtractors.java @@ -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; + + +/** + *

Java class for DataExtractors complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="DataExtractors">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="DataExtractor" type="{http://www.alfresco.org/repo/audit/model/3.2}DataExtractor" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "DataExtractors", propOrder = { + "dataExtractor" +}) +public class DataExtractors { + + @XmlElement(name = "DataExtractor", required = true) + protected List dataExtractor; + + /** + * Gets the value of the dataExtractor property. + * + *

+ * 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 set method for the dataExtractor property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getDataExtractor().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link DataExtractor } + * + * + */ + public List getDataExtractor() { + if (dataExtractor == null) { + dataExtractor = new ArrayList(); + } + return this.dataExtractor; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java b/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java new file mode 100644 index 0000000000..3c8ef65b28 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/DataGenerator.java @@ -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; + + +/** + *

Java class for DataGenerator complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="DataGenerator">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
+ *       <attribute name="class" type="{http://www.alfresco.org/repo/audit/model/3.2}ClassAttribute" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java b/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java new file mode 100644 index 0000000000..5ba54660d2 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/DataGenerators.java @@ -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; + + +/** + *

Java class for DataGenerators complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="DataGenerators">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="DataGenerator" type="{http://www.alfresco.org/repo/audit/model/3.2}DataGenerator" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "DataGenerators", propOrder = { + "dataGenerator" +}) +public class DataGenerators { + + @XmlElement(name = "DataGenerator", required = true) + protected List dataGenerator; + + /** + * Gets the value of the dataGenerator property. + * + *

+ * 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 set method for the dataGenerator property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getDataGenerator().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link DataGenerator } + * + * + */ + public List getDataGenerator() { + if (dataGenerator == null) { + dataGenerator = new ArrayList(); + } + return this.dataGenerator; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java b/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java new file mode 100644 index 0000000000..8fcd9206d5 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/GenerateValue.java @@ -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; + + +/** + *

Java class for GenerateValue complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="GenerateValue">
+ *   <complexContent>
+ *     <extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
+ *       <attribute name="dataGenerator" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java b/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java new file mode 100644 index 0000000000..40a4caad43 --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/KeyedAuditDefinition.java @@ -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; + + +/** + *

Java class for KeyedAuditDefinition complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="KeyedAuditDefinition">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="key" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}KeyAttribute" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java b/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java new file mode 100644 index 0000000000..69c9a919ef --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/ObjectFactory.java @@ -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. + *

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 createAudit(Audit value) { + return new JAXBElement(_Audit_QNAME, Audit.class, null, value); + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java b/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java new file mode 100644 index 0000000000..8bb94a6f3c --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/RecordValue.java @@ -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; + + +/** + *

Java class for RecordValue complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="RecordValue">
+ *   <complexContent>
+ *     <extension base="{http://www.alfresco.org/repo/audit/model/3.2}KeyedAuditDefinition">
+ *       <attribute name="dataExtractor" use="required" type="{http://www.alfresco.org/repo/audit/model/3.2}NameAttribute" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@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; + } + +} diff --git a/source/java/org/alfresco/repo/audit/model/_3/package-info.java b/source/java/org/alfresco/repo/audit/model/_3/package-info.java new file mode 100644 index 0000000000..344f160efc --- /dev/null +++ b/source/java/org/alfresco/repo/audit/model/_3/package-info.java @@ -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;