Getting Audit Applications - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

Getting the audit application metadata uses the getAuditApp method of the AuditApi.

For more information about this ReST API endpoint, see Get Audit Application Metadata.

For a description of the common parameters, such as fields, see Common Parameters.

import org.alfresco.core.handler.AuditApi;
import org.alfresco.core.model.AuditApp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.List;

@Component
public class GetAuditAppCmd {
    static final Logger LOGGER = LoggerFactory.getLogger(GetAuditAppCmd.class);

    @Autowired
    AuditApi auditApi;

    public void execute(String auditAppId) throws IOException {
        List<String> fields = null;
        List<String> include = null;

        AuditApp auditApp = auditApi.getAuditApp(auditAppId, fields, include).getBody();
        LOGGER.info("Got audit app metadata  {}", auditApp);
    }
}