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

rapture.common.client.HttpPluginApi 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.PluginApi;
import rapture.common.api.ScriptPluginApi;
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.PluginConfig;
import rapture.common.PluginTransportItem;
import rapture.common.PluginManifest;

import rapture.common.shared.plugin.GetInstalledPluginsPayload;

import rapture.common.shared.plugin.GetPluginManifestPayload;

import rapture.common.shared.plugin.RecordPluginPayload;

import rapture.common.shared.plugin.InstallPluginPayload;

import rapture.common.shared.plugin.InstallPluginItemPayload;

import rapture.common.shared.plugin.UninstallPluginPayload;

import rapture.common.shared.plugin.UninstallPluginItemPayload;

import rapture.common.shared.plugin.DeletePluginManifestPayload;

import rapture.common.shared.plugin.GetPluginItemPayload;

import rapture.common.shared.plugin.VerifyPluginPayload;

import rapture.common.shared.plugin.CreateManifestPayload;

import rapture.common.shared.plugin.AddManifestItemPayload;

import rapture.common.shared.plugin.AddManifestDataFolderPayload;

import rapture.common.shared.plugin.RemoveManifestDataFolderPayload;

import rapture.common.shared.plugin.SetManifestVersionPayload;

import rapture.common.shared.plugin.RemoveItemFromManifestPayload;

import rapture.common.shared.plugin.ExportPluginPayload;


@SuppressWarnings("all")
public class HttpPluginApi extends BaseHttpApi implements PluginApi, ScriptPluginApi {
        private static final Logger log = Logger.getLogger(HttpPluginApi.class);

	public HttpPluginApi(HttpLoginApi login) {
		super(login, "plugin");
	}
		
	    private static final class GetInstalledPluginsTypeReference extends TypeReference> {
	    }    
	    @Override
	    public List getInstalledPlugins(CallingContext context) {
	        GetInstalledPluginsPayload requestObj = new GetInstalledPluginsPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        return doRequest(requestObj, "GETINSTALLEDPLUGINS", new GetInstalledPluginsTypeReference());    }

	    private static final class GetPluginManifestTypeReference extends TypeReference {
	    }    
	    @Override
	    public PluginManifest getPluginManifest(CallingContext context, String manifestUri) {
	        GetPluginManifestPayload requestObj = new GetPluginManifestPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setManifestUri(manifestUri);
	        return doRequest(requestObj, "GETPLUGINMANIFEST", new GetPluginManifestTypeReference());    }

	    
	    @Override
	    public void recordPlugin(CallingContext context, PluginConfig plugin) {
	        RecordPluginPayload requestObj = new RecordPluginPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPlugin(plugin);
	        doRequest(requestObj, "RECORDPLUGIN", null);    }

	    
	    @Override
	    public void installPlugin(CallingContext context, PluginManifest manifest, Map payload) {
	        InstallPluginPayload requestObj = new InstallPluginPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setManifest(manifest);
	        requestObj.setPayload(payload);
	        doRequest(requestObj, "INSTALLPLUGIN", null);    }

	    
	    @Override
	    public void installPluginItem(CallingContext context, String pluginName, PluginTransportItem item) {
	        InstallPluginItemPayload requestObj = new InstallPluginItemPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setItem(item);
	        doRequest(requestObj, "INSTALLPLUGINITEM", null);    }

	    
	    @Override
	    public void uninstallPlugin(CallingContext context, String name) {
	        UninstallPluginPayload requestObj = new UninstallPluginPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setName(name);
	        doRequest(requestObj, "UNINSTALLPLUGIN", null);    }

	    
	    @Override
	    public void uninstallPluginItem(CallingContext context, PluginTransportItem item) {
	        UninstallPluginItemPayload requestObj = new UninstallPluginItemPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setItem(item);
	        doRequest(requestObj, "UNINSTALLPLUGINITEM", null);    }

	    
	    @Override
	    public void deletePluginManifest(CallingContext context, String manifestUri) {
	        DeletePluginManifestPayload requestObj = new DeletePluginManifestPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setManifestUri(manifestUri);
	        doRequest(requestObj, "DELETEPLUGINMANIFEST", null);    }

	    private static final class GetPluginItemTypeReference extends TypeReference {
	    }    
	    @Override
	    public PluginTransportItem getPluginItem(CallingContext context, String uri) {
	        GetPluginItemPayload requestObj = new GetPluginItemPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setUri(uri);
	        return doRequest(requestObj, "GETPLUGINITEM", new GetPluginItemTypeReference());    }

	    private static final class VerifyPluginTypeReference extends TypeReference> {
	    }    
	    @Override
	    public Map verifyPlugin(CallingContext context, String plugin) {
	        VerifyPluginPayload requestObj = new VerifyPluginPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPlugin(plugin);
	        return doRequest(requestObj, "VERIFYPLUGIN", new VerifyPluginTypeReference());    }

	    
	    @Override
	    public void createManifest(CallingContext context, String pluginName) {
	        CreateManifestPayload requestObj = new CreateManifestPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        doRequest(requestObj, "CREATEMANIFEST", null);    }

	    
	    @Override
	    public void addManifestItem(CallingContext context, String pluginName, String uri) {
	        AddManifestItemPayload requestObj = new AddManifestItemPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setUri(uri);
	        doRequest(requestObj, "ADDMANIFESTITEM", null);    }

	    
	    @Override
	    public void addManifestDataFolder(CallingContext context, String pluginName, String uri) {
	        AddManifestDataFolderPayload requestObj = new AddManifestDataFolderPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setUri(uri);
	        doRequest(requestObj, "ADDMANIFESTDATAFOLDER", null);    }

	    
	    @Override
	    public void removeManifestDataFolder(CallingContext context, String pluginName, String uri) {
	        RemoveManifestDataFolderPayload requestObj = new RemoveManifestDataFolderPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setUri(uri);
	        doRequest(requestObj, "REMOVEMANIFESTDATAFOLDER", null);    }

	    
	    @Override
	    public void setManifestVersion(CallingContext context, String pluginName, String version) {
	        SetManifestVersionPayload requestObj = new SetManifestVersionPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setVersion(version);
	        doRequest(requestObj, "SETMANIFESTVERSION", null);    }

	    
	    @Override
	    public void removeItemFromManifest(CallingContext context, String pluginName, String uri) {
	        RemoveItemFromManifestPayload requestObj = new RemoveItemFromManifestPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setUri(uri);
	        doRequest(requestObj, "REMOVEITEMFROMMANIFEST", null);    }

	    private static final class ExportPluginTypeReference extends TypeReference {
	    }    
	    @Override
	    public String exportPlugin(CallingContext context, String pluginName, String path) {
	        ExportPluginPayload requestObj = new ExportPluginPayload();
	        requestObj.setContext(context == null ? this.getContext() : context);
	        requestObj.setPluginName(pluginName);
	        requestObj.setPath(path);
	        return doRequest(requestObj, "EXPORTPLUGIN", new ExportPluginTypeReference());    }

	
	    @Override
	    public List getInstalledPlugins() {
	        return getInstalledPlugins(null);    }

	    @Override
	    public PluginManifest getPluginManifest(String manifestUri) {
	        return getPluginManifest(null,manifestUri);    }

	    @Override
	    public void recordPlugin(PluginConfig plugin) {
	        recordPlugin(null,plugin);    }

	    @Override
	    public void installPlugin(PluginManifest manifest, Map payload) {
	        installPlugin(null,manifest,payload);    }

	    @Override
	    public void installPluginItem(String pluginName, PluginTransportItem item) {
	        installPluginItem(null,pluginName,item);    }

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

	    @Override
	    public void uninstallPluginItem(PluginTransportItem item) {
	        uninstallPluginItem(null,item);    }

	    @Override
	    public void deletePluginManifest(String manifestUri) {
	        deletePluginManifest(null,manifestUri);    }

	    @Override
	    public PluginTransportItem getPluginItem(String uri) {
	        return getPluginItem(null,uri);    }

	    @Override
	    public Map verifyPlugin(String plugin) {
	        return verifyPlugin(null,plugin);    }

	    @Override
	    public void createManifest(String pluginName) {
	        createManifest(null,pluginName);    }

	    @Override
	    public void addManifestItem(String pluginName, String uri) {
	        addManifestItem(null,pluginName,uri);    }

	    @Override
	    public void addManifestDataFolder(String pluginName, String uri) {
	        addManifestDataFolder(null,pluginName,uri);    }

	    @Override
	    public void removeManifestDataFolder(String pluginName, String uri) {
	        removeManifestDataFolder(null,pluginName,uri);    }

	    @Override
	    public void setManifestVersion(String pluginName, String version) {
	        setManifestVersion(null,pluginName,version);    }

	    @Override
	    public void removeItemFromManifest(String pluginName, String uri) {
	        removeItemFromManifest(null,pluginName,uri);    }

	    @Override
	    public String exportPlugin(String pluginName, String path) {
	        return exportPlugin(null,pluginName,path);    }

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy