public class ScriptRunner extends ServiceEndpoint implements ScriptingInvocationService
| Constructor and Description |
|---|
ScriptRunner(AppContext context,
java.lang.String providerAddress) |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.concurrent.CompletableFuture<T> |
callScript(java.lang.String name,
com.fasterxml.jackson.databind.JsonNode params,
java.lang.String targetDid,
java.lang.String targetAppDid,
java.lang.Class<T> resultType)
Invoke the execution of a specified script registered previously by the vault
owner, where the script is defined with certain preset routines.
|
<T> java.util.concurrent.CompletableFuture<T> |
callScriptUrl(java.lang.String name,
java.lang.String params,
java.lang.String targetDid,
java.lang.String targetAppDid,
java.lang.Class<T> resultType)
Executes a previously registered server side script with a direct URL
where the values can be passed as part of the query.
|
<T> java.util.concurrent.CompletableFuture<T> |
downloadFile(java.lang.String transactionId,
java.lang.Class<T> resultType)
Invoke the execution of the script to download a file in the streaming mode.
|
<T> java.util.concurrent.CompletableFuture<T> |
uploadFile(java.lang.String transactionId,
java.lang.Class<T> resultType)
Invoke the execution of the script to upload a file in the streaming mode.
|
getAccessToken, getAppContext, getAppDid, getAppInstanceDid, getLatestCommitId, getNodeVersion, getProviderAddress, getServiceDid, getServiceInstanceDid, getStorage, getUserDid, refreshAccessTokencreateService, openConnectionpublic ScriptRunner(AppContext context, java.lang.String providerAddress)
public <T> java.util.concurrent.CompletableFuture<T> callScript(java.lang.String name,
com.fasterxml.jackson.databind.JsonNode params,
java.lang.String targetDid,
java.lang.String targetAppDid,
java.lang.Class<T> resultType)
ScriptingInvocationServicecallScript in interface ScriptingInvocationServiceT - String, byte[], JsonNode, Readername - The name of script to invoke.params - The parameters as input to the invocation.targetDid - The script owner's user did. Skipped when owner calls.targetAppDid - The script owner's application did. Skipped when owner calls.resultType - String, byte[], JsonNode, Readerpublic <T> java.util.concurrent.CompletableFuture<T> callScriptUrl(java.lang.String name,
java.lang.String params,
java.lang.String targetDid,
java.lang.String targetAppDid,
java.lang.Class<T> resultType)
T - String, byte[], JsonNode, Reader, Write, OutputStream, Reader, InputStreamname - The call's script nameparams - The parameters for the script.targetDid - The script owner's user did.targetAppDid - The script owner's application did.resultType - String, byte[], JsonNode, Reader, Write, OutputStream, Reader, InputStreampublic <T> java.util.concurrent.CompletableFuture<T> downloadFile(java.lang.String transactionId,
java.lang.Class<T> resultType)
ScriptingInvocationServicedownloadFile in interface ScriptingInvocationServiceT - Reader or InputStream classtransactionId - The streaming identifier to the upload processresultType - Reader or InputStream classpublic <T> java.util.concurrent.CompletableFuture<T> uploadFile(java.lang.String transactionId,
java.lang.Class<T> resultType)
ScriptingInvocationServiceuploadFile in interface ScriptingInvocationServiceT - Reader or InputStream classtransactionId - The streaming identifier to the upload processresultType - Reader or InputStream class