rapture.common.client.HttpScriptApi 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.ScriptApi;
import rapture.common.api.ScriptScriptApi;
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.ScriptResult;
import rapture.common.RaptureScriptLanguage;
import rapture.common.ScriptInterface;
import rapture.common.RaptureFolderInfo;
import rapture.common.RaptureSnippet;
import rapture.common.RaptureScript;
import rapture.common.RaptureScriptPurpose;
import rapture.common.shared.script.CreateScriptPayload;
import rapture.common.shared.script.CreateScriptLinkPayload;
import rapture.common.shared.script.RemoveScriptLinkPayload;
import rapture.common.shared.script.DoesScriptExistPayload;
import rapture.common.shared.script.DeleteScriptPayload;
import rapture.common.shared.script.GetScriptNamesPayload;
import rapture.common.shared.script.GetScriptPayload;
import rapture.common.shared.script.GetInterfacePayload;
import rapture.common.shared.script.PutScriptPayload;
import rapture.common.shared.script.PutRawScriptPayload;
import rapture.common.shared.script.RunScriptPayload;
import rapture.common.shared.script.RunScriptExtendedPayload;
import rapture.common.shared.script.CheckScriptPayload;
import rapture.common.shared.script.CreateREPLSessionPayload;
import rapture.common.shared.script.DestroyREPLSessionPayload;
import rapture.common.shared.script.EvaluateREPLPayload;
import rapture.common.shared.script.ArchiveOldREPLSessionsPayload;
import rapture.common.shared.script.CreateSnippetPayload;
import rapture.common.shared.script.GetSnippetChildrenPayload;
import rapture.common.shared.script.DeleteSnippetPayload;
import rapture.common.shared.script.GetSnippetPayload;
import rapture.common.shared.script.ListScriptsByUriPrefixPayload;
import rapture.common.shared.script.DeleteScriptsByUriPrefixPayload;
@SuppressWarnings("all")
public class HttpScriptApi extends BaseHttpApi implements ScriptApi, ScriptScriptApi {
private static final Logger log = Logger.getLogger(HttpScriptApi.class);
public HttpScriptApi(HttpLoginApi login) {
super(login, "script");
}
private static final class CreateScriptTypeReference extends TypeReference {
}
@Override
public RaptureScript createScript(CallingContext context, String scriptURI, RaptureScriptLanguage language, RaptureScriptPurpose purpose, String script) {
CreateScriptPayload requestObj = new CreateScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
requestObj.setLanguage(language);
requestObj.setPurpose(purpose);
requestObj.setScript(script);
return doRequest(requestObj, "CREATESCRIPT", new CreateScriptTypeReference()); }
@Override
public void createScriptLink(CallingContext context, String fromScriptURI, String toScriptURI) {
CreateScriptLinkPayload requestObj = new CreateScriptLinkPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setFromScriptURI(fromScriptURI);
requestObj.setToScriptURI(toScriptURI);
doRequest(requestObj, "CREATESCRIPTLINK", null); }
@Override
public void removeScriptLink(CallingContext context, String fromScriptURI) {
RemoveScriptLinkPayload requestObj = new RemoveScriptLinkPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setFromScriptURI(fromScriptURI);
doRequest(requestObj, "REMOVESCRIPTLINK", null); }
private static final class DoesScriptExistTypeReference extends TypeReference {
}
@Override
public Boolean doesScriptExist(CallingContext context, String scriptURI) {
DoesScriptExistPayload requestObj = new DoesScriptExistPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
return doRequest(requestObj, "DOESSCRIPTEXIST", new DoesScriptExistTypeReference()); }
@Override
public void deleteScript(CallingContext context, String scriptUri) {
DeleteScriptPayload requestObj = new DeleteScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptUri(scriptUri);
doRequest(requestObj, "DELETESCRIPT", null); }
private static final class GetScriptNamesTypeReference extends TypeReference> {
}
@Override
public List getScriptNames(CallingContext context, String scriptURI) {
GetScriptNamesPayload requestObj = new GetScriptNamesPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
return doRequest(requestObj, "GETSCRIPTNAMES", new GetScriptNamesTypeReference()); }
private static final class GetScriptTypeReference extends TypeReference {
}
@Override
public RaptureScript getScript(CallingContext context, String scriptURI) {
GetScriptPayload requestObj = new GetScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
return doRequest(requestObj, "GETSCRIPT", new GetScriptTypeReference()); }
private static final class GetInterfaceTypeReference extends TypeReference {
}
@Override
public ScriptInterface getInterface(CallingContext context, String scriptURI) {
GetInterfacePayload requestObj = new GetInterfacePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
return doRequest(requestObj, "GETINTERFACE", new GetInterfaceTypeReference()); }
private static final class PutScriptTypeReference extends TypeReference {
}
@Override
public RaptureScript putScript(CallingContext context, String scriptURI, RaptureScript script) {
PutScriptPayload requestObj = new PutScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
requestObj.setScript(script);
return doRequest(requestObj, "PUTSCRIPT", new PutScriptTypeReference()); }
private static final class PutRawScriptTypeReference extends TypeReference {
}
@Override
public RaptureScript putRawScript(CallingContext context, String scriptURI, String content, String language, String purpose, List param_types, List param_names) {
PutRawScriptPayload requestObj = new PutRawScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
requestObj.setContent(content);
requestObj.setLanguage(language);
requestObj.setPurpose(purpose);
requestObj.setParam_types(param_types);
requestObj.setParam_names(param_names);
return doRequest(requestObj, "PUTRAWSCRIPT", new PutRawScriptTypeReference()); }
private static final class RunScriptTypeReference extends TypeReference {
}
@Override
public String runScript(CallingContext context, String scriptURI, Map parameters) {
RunScriptPayload requestObj = new RunScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
requestObj.setParameters(parameters);
return doRequest(requestObj, "RUNSCRIPT", new RunScriptTypeReference()); }
private static final class RunScriptExtendedTypeReference extends TypeReference {
}
@Override
public ScriptResult runScriptExtended(CallingContext context, String scriptURI, Map parameters) {
RunScriptExtendedPayload requestObj = new RunScriptExtendedPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
requestObj.setParameters(parameters);
return doRequest(requestObj, "RUNSCRIPTEXTENDED", new RunScriptExtendedTypeReference()); }
private static final class CheckScriptTypeReference extends TypeReference {
}
@Override
public String checkScript(CallingContext context, String scriptURI) {
CheckScriptPayload requestObj = new CheckScriptPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setScriptURI(scriptURI);
return doRequest(requestObj, "CHECKSCRIPT", new CheckScriptTypeReference()); }
private static final class CreateREPLSessionTypeReference extends TypeReference {
}
@Override
public String createREPLSession(CallingContext context) {
CreateREPLSessionPayload requestObj = new CreateREPLSessionPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "CREATEREPLSESSION", new CreateREPLSessionTypeReference()); }
@Override
public void destroyREPLSession(CallingContext context, String sessionId) {
DestroyREPLSessionPayload requestObj = new DestroyREPLSessionPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setSessionId(sessionId);
doRequest(requestObj, "DESTROYREPLSESSION", null); }
private static final class EvaluateREPLTypeReference extends TypeReference {
}
@Override
public String evaluateREPL(CallingContext context, String sessionId, String line) {
EvaluateREPLPayload requestObj = new EvaluateREPLPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setSessionId(sessionId);
requestObj.setLine(line);
return doRequest(requestObj, "EVALUATEREPL", new EvaluateREPLTypeReference()); }
@Override
public void archiveOldREPLSessions(CallingContext context, Long ageInMinutes) {
ArchiveOldREPLSessionsPayload requestObj = new ArchiveOldREPLSessionsPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setAgeInMinutes(ageInMinutes);
doRequest(requestObj, "ARCHIVEOLDREPLSESSIONS", null); }
private static final class CreateSnippetTypeReference extends TypeReference {
}
@Override
public RaptureSnippet createSnippet(CallingContext context, String snippetURI, String snippet) {
CreateSnippetPayload requestObj = new CreateSnippetPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setSnippetURI(snippetURI);
requestObj.setSnippet(snippet);
return doRequest(requestObj, "CREATESNIPPET", new CreateSnippetTypeReference()); }
private static final class GetSnippetChildrenTypeReference extends TypeReference> {
}
@Override
public List getSnippetChildren(CallingContext context, String prefix) {
GetSnippetChildrenPayload requestObj = new GetSnippetChildrenPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setPrefix(prefix);
return doRequest(requestObj, "GETSNIPPETCHILDREN", new GetSnippetChildrenTypeReference()); }
@Override
public void deleteSnippet(CallingContext context, String snippetURI) {
DeleteSnippetPayload requestObj = new DeleteSnippetPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setSnippetURI(snippetURI);
doRequest(requestObj, "DELETESNIPPET", null); }
private static final class GetSnippetTypeReference extends TypeReference {
}
@Override
public RaptureSnippet getSnippet(CallingContext context, String snippetURI) {
GetSnippetPayload requestObj = new GetSnippetPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setSnippetURI(snippetURI);
return doRequest(requestObj, "GETSNIPPET", new GetSnippetTypeReference()); }
private static final class ListScriptsByUriPrefixTypeReference extends TypeReference
© 2015 - 2025 Weber Informatics LLC | Privacy Policy