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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy