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"));
}
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);
}
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());
}
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);
}
}
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();
}
Aggregations