Search in sources :

Example 1 with AuditApplication

use of org.alfresco.repo.audit.model.AuditApplication in project alfresco-repository by Alfresco.

the class AuditBootstrapTest method testAuditApplication_GetDataGenerators.

public void testAuditApplication_GetDataGenerators() {
    AuditApplication app = auditModelRegistry.getAuditApplicationByName(APPLICATION_TEST);
    assertNotNull(app);
    Map<String, DataGenerator> generators = app.getDataGenerators("/blah");
    assertNotNull("Should never get a null map", generators);
    assertTrue("Expected no generators", generators.isEmpty());
    generators = app.getDataGenerators("/test/1.1/2.1/3.1/4.1");
    assertEquals(1, generators.size());
    assertTrue(generators.containsKey("/test/time"));
    generators = app.getDataGenerators("/test/1.1/2.1/3.1/4.1");
    assertEquals(1, generators.size());
    assertTrue(generators.containsKey("/test/time"));
    generators = app.getDataGenerators("/test/1.1/2.2/3.2/4.1");
    assertEquals(2, generators.size());
    assertTrue(generators.containsKey("/test/time"));
    assertTrue(generators.containsKey("/test/1.1/2.2/3.2/4.1/time"));
}
Also used : DataGenerator(org.alfresco.repo.audit.generator.DataGenerator) AuditApplication(org.alfresco.repo.audit.model.AuditApplication)

Example 2 with AuditApplication

use of org.alfresco.repo.audit.model.AuditApplication in project alfresco-repository by Alfresco.

the class AuditBootstrapTest method testGetApplicationId.

public void testGetApplicationId() {
    AuditApplication app = auditModelRegistry.getAuditApplicationByName(APPLICATION_TEST);
    assertNotNull(app);
    Long appId = app.getApplicationId();
    assertNotNull("No audit application ID for " + APPLICATION_TEST, appId);
}
Also used : AuditApplication(org.alfresco.repo.audit.model.AuditApplication)

Example 3 with AuditApplication

use of org.alfresco.repo.audit.model.AuditApplication in project alfresco-repository by Alfresco.

the class AuditBootstrapTest method testAuditApplication_GetDataExtractors.

public void testAuditApplication_GetDataExtractors() {
    AuditApplication app = auditModelRegistry.getAuditApplicationByName(APPLICATION_TEST);
    assertNotNull(app);
    List<DataExtractorDefinition> extractors = app.getDataExtractors();
    assertNotNull("Should never get a null list", extractors);
    assertEquals("Expected 13 extractors", 13, extractors.size());
}
Also used : AuditApplication(org.alfresco.repo.audit.model.AuditApplication) DataExtractorDefinition(org.alfresco.repo.audit.model.AuditApplication.DataExtractorDefinition)

Example 4 with AuditApplication

use of org.alfresco.repo.audit.model.AuditApplication in project alfresco-repository by Alfresco.

the class AuditComponentImpl method resetDisabledPaths.

/**
 * {@inheritDoc}
 * @since 3.2
 */
public void resetDisabledPaths(String applicationName) {
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null) {
        if (logger.isDebugEnabled()) {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return;
    }
    Long disabledPathsId = application.getDisabledPathsId();
    propertyValueDAO.updateProperty(disabledPathsId, (Serializable) Collections.emptySet());
    // Done
    if (logger.isDebugEnabled()) {
        logger.debug("Removed all disabled paths for application " + applicationName);
    }
}
Also used : AuditApplication(org.alfresco.repo.audit.model.AuditApplication)

Example 5 with AuditApplication

use of org.alfresco.repo.audit.model.AuditApplication in project alfresco-repository by Alfresco.

the class AuditComponentImpl method getApplicationId.

private Long getApplicationId(String applicationName) {
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null) {
        if (logger.isDebugEnabled()) {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return null;
    }
    return application.getApplicationId();
}
Also used : AuditApplication(org.alfresco.repo.audit.model.AuditApplication)

Aggregations

AuditApplication (org.alfresco.repo.audit.model.AuditApplication)14 Serializable (java.io.Serializable)2 URL (java.net.URL)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 DataGenerator (org.alfresco.repo.audit.generator.DataGenerator)1 DataExtractorDefinition (org.alfresco.repo.audit.model.AuditApplication.DataExtractorDefinition)1