All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rapture.common.client.HttpAuditApi Maven / Gradle / Ivy

/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2011-2016 Incapture Technologies LLC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/**
 * This file is autogenerated and any changes will be overwritten.
 */

package rapture.common.client;

import java.util.List;
import java.util.Map;
import rapture.common.api.AuditApi;
import rapture.common.api.ScriptAuditApi;
import rapture.common.CallingContext;
import rapture.common.model.GeneralResponse;
import rapture.common.model.BasePayload;
import rapture.common.exception.RaptureException;
import rapture.common.impl.jackson.JacksonUtil;

import com.fasterxml.jackson.core.type.TypeReference;

import org.apache.log4j.Logger;

import rapture.common.model.AuditLogEntry;
import rapture.common.RaptureFolderInfo;
import rapture.common.AuditLogConfig;

import rapture.common.shared.audit.SetupPayload;

import rapture.common.shared.audit.CreateAuditLogPayload;

import rapture.common.shared.audit.DoesAuditLogExistPayload;

import rapture.common.shared.audit.GetChildrenPayload;

import rapture.common.shared.audit.DeleteAuditLogPayload;

import rapture.common.shared.audit.GetAuditLogPayload;

import rapture.common.shared.audit.WriteAuditEntryPayload;

import rapture.common.shared.audit.WriteAuditEntryDataPayload;

import rapture.common.shared.audit.GetRecentLogEntriesPayload;

import rapture.common.shared.audit.GetEntriesSincePayload;

import rapture.common.shared.audit.GetRecentUserActivityPayload;


@SuppressWarnings("all")
public class HttpAuditApi extends BaseHttpApi implements AuditApi, ScriptAuditApi {
        private static final Logger log = Logger.getLogger(HttpAuditApi.class);

	public HttpAuditApi(HttpLoginApi login) {
		super(login, "audit");
	}
		
	    
	    @Override
	    public void setup(CallingContext context, Boolean force) {
	        SetupPayload requestObj = new SetupPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setForce(force);
	        doRequest(requestObj, "SETUP", null);    }

	    
	    @Override
	    public void createAuditLog(CallingContext context, String name, String config) {
	        CreateAuditLogPayload requestObj = new CreateAuditLogPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setName(name);
	        requestObj.setConfig(config);
	        doRequest(requestObj, "CREATEAUDITLOG", null);    }

	    private static final class DoesAuditLogExistTypeReference extends TypeReference {
	    }    
	    @Override
	    public Boolean doesAuditLogExist(CallingContext context, String logURI) {
	        DoesAuditLogExistPayload requestObj = new DoesAuditLogExistPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        return doRequest(requestObj, "DOESAUDITLOGEXIST", new DoesAuditLogExistTypeReference());    }

	    private static final class GetChildrenTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getChildren(CallingContext context, String prefix) {
	        GetChildrenPayload requestObj = new GetChildrenPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPrefix(prefix);
	        return doRequest(requestObj, "GETCHILDREN", new GetChildrenTypeReference());    }

	    
	    @Override
	    public void deleteAuditLog(CallingContext context, String logURI) {
	        DeleteAuditLogPayload requestObj = new DeleteAuditLogPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        doRequest(requestObj, "DELETEAUDITLOG", null);    }

	    private static final class GetAuditLogTypeReference extends TypeReference {
	    }    
	    @Override
	    public AuditLogConfig getAuditLog(CallingContext context, String logURI) {
	        GetAuditLogPayload requestObj = new GetAuditLogPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        return doRequest(requestObj, "GETAUDITLOG", new GetAuditLogTypeReference());    }

	    
	    @Override
	    public void writeAuditEntry(CallingContext context, String logURI, String category, int level, String message) {
	        WriteAuditEntryPayload requestObj = new WriteAuditEntryPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        requestObj.setCategory(category);
	        requestObj.setLevel(level);
	        requestObj.setMessage(message);
	        doRequest(requestObj, "WRITEAUDITENTRY", null);    }

	    
	    @Override
	    public void writeAuditEntryData(CallingContext context, String logURI, String category, int level, String message, Map data) {
	        WriteAuditEntryDataPayload requestObj = new WriteAuditEntryDataPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        requestObj.setCategory(category);
	        requestObj.setLevel(level);
	        requestObj.setMessage(message);
	        requestObj.setData(data);
	        doRequest(requestObj, "WRITEAUDITENTRYDATA", null);    }

	    private static final class GetRecentLogEntriesTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getRecentLogEntries(CallingContext context, String logURI, int count) {
	        GetRecentLogEntriesPayload requestObj = new GetRecentLogEntriesPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        requestObj.setCount(count);
	        return doRequest(requestObj, "GETRECENTLOGENTRIES", new GetRecentLogEntriesTypeReference());    }

	    private static final class GetEntriesSinceTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getEntriesSince(CallingContext context, String logURI, AuditLogEntry when) {
	        GetEntriesSincePayload requestObj = new GetEntriesSincePayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setLogURI(logURI);
	        requestObj.setWhen(when);
	        return doRequest(requestObj, "GETENTRIESSINCE", new GetEntriesSinceTypeReference());    }

	    private static final class GetRecentUserActivityTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getRecentUserActivity(CallingContext context, String user, int count) {
	        GetRecentUserActivityPayload requestObj = new GetRecentUserActivityPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setUser(user);
	        requestObj.setCount(count);
	        return doRequest(requestObj, "GETRECENTUSERACTIVITY", new GetRecentUserActivityTypeReference());    }

	
	    @Override
	    public void setup(Boolean force) {
	        setup(null,force);    }

	    @Override
	    public void createAuditLog(String name, String config) {
	        createAuditLog(null,name,config);    }

	    @Override
	    public Boolean doesAuditLogExist(String logURI) {
	        return doesAuditLogExist(null,logURI);    }

	    @Override
	    public List getChildren(String prefix) {
	        return getChildren(null,prefix);    }

	    @Override
	    public void deleteAuditLog(String logURI) {
	        deleteAuditLog(null,logURI);    }

	    @Override
	    public AuditLogConfig getAuditLog(String logURI) {
	        return getAuditLog(null,logURI);    }

	    @Override
	    public void writeAuditEntry(String logURI, String category, int level, String message) {
	        writeAuditEntry(null,logURI,category,level,message);    }

	    @Override
	    public void writeAuditEntryData(String logURI, String category, int level, String message, Map data) {
	        writeAuditEntryData(null,logURI,category,level,message,data);    }

	    @Override
	    public List getRecentLogEntries(String logURI, int count) {
	        return getRecentLogEntries(null,logURI,count);    }

	    @Override
	    public List getEntriesSince(String logURI, AuditLogEntry when) {
	        return getEntriesSince(null,logURI,when);    }

	    @Override
	    public List getRecentUserActivity(String user, int count) {
	        return getRecentUserActivity(null,user,count);    }

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy