Public Interfaces
This chapter contains information about the public interfaces part of the com.technia.tias.executor.api.
package. The JS executor within TIF cloud has one object bound to the code named context
. This context
object is of type ExecutionContext. From this context object you will be able to access different APIs in orderto perform the job.
Configuration
Represents a Configuration instance
Since 2022-09-15
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
id() |
UUID |
Returns the internal ID of the configuration. |
|
name() |
String |
Returns the name of the configuration. |
|
content() |
String |
Returns the content of the configuration. |
|
type() |
String |
Returns the type of the configuration |
|
properties() |
Map< String, String > |
Returns the properties of this configuration. |
ConfigurationResolver
The configuration resolver is used to resolve other Configuration instances.
Since 2022-02-01
ConverterAPI
The converter API contains various methods for converting files between different formats.
Since 2023-10-02
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
convertToPDF() |
Obtains the PDF converter API. NOTE: If you do not have the correct license for the PDF converter, this method will throw an exception when called.Creates a request object, which will allow you to convert an Office document, such as a DOCX, XLSX, etc file into PDF.The generated PDF file may contain watermarks based on image and/or text. Moreover, the generated PDF file can be signed using a digital certificate.The PDF conversion itself can be preceded by setting document properties, in case the input file is a Microsoft Word or Excel file. The properties are set and fields can be configured to be updated prior to the PDF conversion in order to reflect values from the properties. |
Data
A Data instance holds data associated with a job. A job can get data as input and return data as output. It is also possible for a particular job to generate other Data content as part of the execution.
Since 2022-01-31
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getName() |
String |
Returns the name of this data instance. |
|
getType() |
Returns the type for this data instance, if known. |
||
getDescription() |
String |
Returns the description for this data instance, if known. |
|
getInputStream() |
InputStream |
This method returns an InputStream from which you can read all the bytes of this data instance. |
|
getContentType() |
String |
Returns the content type of the data, if known. |
|
getContentEncoding() |
String |
Returns the content encoding if known.In most cases UTF8 will be used if this information is not provided and there is a need to convert bytes into characters or vice versa. |
|
getContentAsString() |
String |
Tries to convert the data into a String using the encoding as specified via the |
|
getSize() |
long |
Returns the size of the data content if known. A negative value can be returned to indicate that the size is not known. |
DataRef
A Data reference is a reference to o Data instance. A reference only provides the meta data and not the actual content of the data. To load the actual content of the data/file, use the DataStorage API available on the ExecutionContext.
Since 2022-02-18
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
id() |
UUID |
Returns the ID of the referenced Data instance |
|
name() |
String |
Returns the name |
|
description() |
String |
Returns the description (if known) |
|
size() |
long |
Returns the size of the data |
|
dataType() |
Returns the type of data this is, one of INBOUND, OUTBOUND or OTHER is returns |
||
contentType() |
String |
Returns the content type (if known) |
|
contentEncoding() |
String |
Returns the content encoding (if known) |
DataStorage
API for reading and storing Data instances.
Since 2022-01-31
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
list() |
Lists all data associated with the current job. Note that this method returns the meta-data only. To retrieve the actual content for a Data instance you need to query that separately via the |
||
store(Data data) |
UUID |
Stores the given data |
|
load(UUID byId) |
Loads data by its ID. Null is returned if there is no such Data |
|
|
load(String byName) |
Loads data by its name. |
|
|
delete(UUID byId) |
boolean |
Deletes a data instance by its ID |
|
delete(String byName) |
boolean |
Deletes a data instance by its name |
|
change(UUID id, String newName, DataType newType) |
- |
This function allows renaming and/or re-typing a specific file. |
|
newStringDataBuilder() |
Creates and return a new |
||
newByteArrayDataBuilder() |
Creates and return a new |
DocumentHelperService
This service helps out when working with documents and files from TIAS.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getFileContent(String documentId, String fileId) |
byte[] |
Returns the content of a file as a byte-array. |
|
download(String documentId, String fileId, boolean lock) |
Downloads or check-outs the given file into a local-file |
|
|
uploadNew(LocalFileAPI.LocalFile localFile, String documentId, String checkinFileName, String checkinComments) |
- |
Uploads the local file as a new file into the given Document object. |
|
uploadFileVersion(LocalFileAPI.LocalFile localFile, String documentId, String fileId, String checkinFileName, String checkinComments, boolean keepLocked) |
- |
Creates a new version of an existing file.If you know the ID of the file to be revised, supply the |
|
DsxAPI
API to access the DS REST API.
Since 2022-02-03
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getTenantSession() |
TenantSession |
#getTenantSession(AppService)DeprecatedThis method will be removed! Use the getTenantSession taking an argument. |
|
getTenantSession(String appId) |
TenantSession |
Returns the |
|
getTenantSession(AppService appService) |
TenantSession |
Returns a session to the specified AppService. |
|
getSpaceService() |
SpaceService |
Returns the space service. |
|
getExchangeService() |
ExchangeService |
Returns the Exchange service provider |
|
getDocumentHelperService() |
DocumentHelperService |
Returns the document helper service that simplifies working with files stored in the DS File Store. |
DsxUrls
Holds various DSX URLs that is required to know when accessing the DS tenant.
Since 2022-09-15
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
passport() |
String |
Returns the passport URL |
|
space() |
String |
Returns the 3d-space URL |
|
swym() |
String |
Returns the swym URL |
|
exchange() |
String |
Returns the exchange URL |
|
compass() |
String |
Returns the compass URL |
|
drive() |
String |
Returns the 3d-drive URL |
Environment
Holds environmental data that is needed in the Executor.
Since 2022-02-02
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getDSXTenantName() |
String |
Returns the name of the DSX tenant. |
|
dsxUrls() |
Returns all configured DSX URLs |
||
get(String name) |
String |
Returns the value of the environment variable with the given name. Null is returned in case there is no env variable with such name. |
|
get(String name, String defaultValue) |
String |
Returns the value of the environment variable with the given name. In case there is no env variable with the given name, the provided default value is returned. |
|
getEnvVariables() |
Set< String > |
Returns the names of the environment variables. |
|
getSecret(String name) |
String |
Returns the value of a secret variable.Use secret variables with caution, for example the value should never be logged etc. Also, every usage of a secret variable is tracked/logged. |
|
getMacroResolver() |
Returns a |
||
isFeatureInstalled(String featureId) |
boolean |
Checks if a given feature is available. |
|
ExecutionContext
When executing an integration job, the ExecutionContext provides access to various services and APIs needed to conduct for example HTTP calls, performing JSON serialization or deserialization, access data from the 3DEXPERIENCE platform via the DSX-REST API’s or performing some conversion or other computation. There are also APIs available for accessing environment variables, secret variables or for logging of actions performed by the executor. Also, there are APIs allowing you to access any input parameters, variables or payload that has been passed into the job. If the job was triggered by an event, the event details is also available via the ExecutionContext API. The ExecutionContext also provides APIs to return the result from the job execution via the ExecutionResult API. There you can set the success flag, provide a result code and with a message / detailed message including any outgoing payload data. The result of a job execution can be associated with so called outbound payload data. Commonly, a job is associated with one outbound payload data, but you are not limited to that. If a job is associated with multiple outbound payload data files, these are typically avaiable / returned as a ZIP archive when delivered back to the caller.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
input() |
Returns an object holding any input data available to the job. The input may vary depending on how the job was invoked. For example, if the job was triggered by a REST call, then the input data may hold various request headers, variables, parameters and/or request payload. However, if the job was triggered by, for example, a Scheduled Task or an Event from the 3DEXPERIENCE platform, then the input contains different kinds of data. |
||
result() |
Returns an object allowing to specify the result/outcome from the execution of this job. |
||
localFileAPI() |
Returns an object that allows working wil local file resource. A local file resource will only live during the execution of a job, hence this should not be used for anything else than just processing of data related to the execution of the job. |
||
dsxAPI() |
Returns an object that provides access to the 3D-Experience REST API. |
||
httpAPI() |
Returns an object that provides functionality to perform HTTP(S) calls from the executor. |
||
jsonAPI() |
Returns an object that provides functionality related to converting objects back/forth JSON representation. |
||
xmlAPI() |
Returns an object that provides functionality related to XML document parsing, transformation and processing. |
||
jobAPI() |
Returns an object that provides functionality related to Job handling within TIAS. |
||
utilsAPI() |
Returns an object that provides miscellaneous utility functions related to commonly used tasks done as part of executing a Job. |
||
property(String key) |
String |
Returns the value of the property by first querying the underlying configuration for a property with the given key. If the configuration does not provide a value for the given key, then the environment will be queried. |
|
configuration() |
Returns the |
||
configurationResolver() |
Returns an object that can be used to obtain content of other |
||
logger() |
Returns a logger, which the executor may use to associate log-data with the current job. Do not log sensitive data to the logger such as credentials or other tokens, etc. |
||
dataStorage() |
Returns an object that provides functionality related to storage of |
||
environment() |
Returns an |
||
jobRequestMessage() |
Returns an object that describes the job-request it-self. For example, this object contains the ID of the job being executed, among others. |
||
converterAPI() |
Returns an API object, which provides conversion capabilities. |
||
configData() |
< T > T |
Optional configuration data attached with the execution of the job. This value might be null in most cases, but for example, when using the Custom Feature concept - this method will provide the configuration data from this method. |
|
extension() |
For executor implementations part of a TIF extension, this API provides access to metadata from the extension itself. For example, accessing the UI Configuration values and definition, among others.NOTE: This method returns NULL if the code is not part of an extension. |
||
exit() |
- |
Calling exit will terminate any further execution of the ongoing job-executor. The state of the job will be determined by the |
|
sleep(long milliSeconds) |
- |
Pauses the execution of this job for the requested number of milliseconds.The value is in milliseconds and may not be less than 1 ms or greater than 30,000 ms (30 seconds). If so, an exception will be thrown and the execution will exit.Notice also that if you call this method repeatedly, the total time paused MAY not exceed 5 minutes. If so, an exception will be thrown. |
|
ExecutionInput
Contains methods to access all necessary input data for the current Job.
Since 2022-06-21
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getParentJobId() |
UUID |
If this job was triggered by another job, then the ID of that parent job is available from this method. In any other case, null is returned. |
|
path() |
String |
For example, if the job was invoked via a REST call then this method returns the path used. |
|
header(String name) |
List< String > |
Returns the headers associated with the given name. If there are no headers available with the specified name, then this method returns an empty list, never null. |
|
firstHeader(String name) |
String |
Returns the first header value associated with the given name. Note that if no header is present with the given name, null will be returned from this method. |
|
getHeaders() |
Map< String, List< String > > |
Returns the optional headers that may have been passed along when the job was invoked. |
|
param(String name) |
List< String > |
Returns the parameter associated with the given name. If there are no parameter available with the specified name, then this method returns an empty list, never null. |
|
firstParam(String name) |
String |
Returns the first parameter value associated with the given name. Note that if no parameter is present with the given name, null will be returned from this method. |
|
getParameters() |
Map< String, List< String > > |
Returns all optional parameters passed along when the job was created. |
|
variable(String name) |
String |
Returns the variable associated with the given name. If there is no variable available with the specified name, then this method returns null. |
|
getVariables() |
Map< String, String > |
Returns all optional variables that were resolved when the job was created. Variables are typically those that are resolved from the URL when the job was requested via a REST call and the URL contained macros / URI variables. |
|
data() |
Returns the input data if available. |
||
isProcessingReply() |
boolean |
Returns true if we are processing a reply, e.g. this job is a result of an execution of an asynchronous reply. |
|
isRetry() |
boolean |
Returns true if this execution is a retry attempt, e.g. for some reason the previous execution failed and we are now trying to recover from that state. Note that it is the executor that is responsible for handling retries in a reliable way. |
|
getRetryAttempt() |
int |
If this is a retry attempt, this method will return the attempt no. |
ExecutionResult
Holds the result of the job execution.
Since 2022-06-21
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
isFailed() |
boolean |
If the job failed, this method returns true. |
|
isMarkResolved() |
boolean |
Returns true if the resolved flag has been set. |
|
getResolution() |
String |
Returns the resolution message if set. |
|
isAwaitingReply() |
boolean |
If the job has been marked as awaiting a reply from some other system, this method will return true. |
|
isCancelled() |
boolean |
Returns the cancellation flag. |
|
getCode() |
Integer |
The result code set on the result. If no code is set, null is returned. |
|
getMessage() |
String |
Typically, if the job is marked as being failed, then this method returns the message giving some brief information about the problem. |
|
getDetailedMessage() |
String |
Detailed message to be associated with this job result, typically used when a job is failed. |
|
cancelled(boolean cancelled) |
Sets the |
|
|
failed(boolean failed) |
Sets the |
|
|
markResolved(boolean resolved, String resolutionMessage) |
Can be used to set the resolved flag and the resolution message. Note that setting a resolution also requires the job to be marked as failed. |
|
|
awaitingReply(boolean awaitingReply) |
Sets the |
|
|
code(Integer code) |
Associates the code with the execution result. This could be used in addition to the message and detailed message to easier identify problems in various places. |
|
|
message(String message) |
Associates the specified message with the execution result. |
|
|
detailedMessage(String detailedMessage) |
Associates a more detailed description or stack trace, etc. that is helpful to understand the error. |
|
|
data(String content, String contentType) |
Associates some data with the result. The data is string based and you should specify the content-type. |
|
|
data(String content, String contentType, String fileName) |
Associates some data with the result. The data is string based and you should specify the content-type. If |
|
|
data(byte[] content, String contentType, String encoding) |
Associates some binary data with the result. |
|
|
data(byte[] content, String contentType, String encoding, String fileName) |
Associates some binary data with the result. |
|
Executor
An Executor is responsible for executing the logic of an integration job in the TIF Cloud platform. An executor can be implemented in various different ways, for example, there are executors that allows the job logic to be expressed in some scripting language, for example JavaScript, within a configuration. The configuration content is then a Javascript that is performing all tasks required to fulfill the job.
Since 2022-02-01
ExecutorLogger
A logger that is used to associate messages of different kind to a job. Note that messages that is being logged should be kept short, each message should not exceed 256 chars but MAY not exceed 1024 chars. Such message will be truncated.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
isDebugEnabled() |
boolean |
Tells if debug logging is enabled |
|
debug(String message, Object… arguments) |
- |
Logs a message with the DEBUG level. Note that the DEBUG level must be enabled separately per service as it may generate a lot of outputIf one or more arguments are passed, the |
|
info(String message, Object… arguments) |
- |
Logs a message with the info level.If one or more arguments are passed, the |
|
warning(String message, Object… arguments) |
- |
Logs a message with the warning level.If one or more arguments are passed, the |
|
error(String message, Object… arguments) |
- |
Logs a message with the error level.If one or more arguments are passed, the |
|
ExtensionInfo
This API provides the executing code with details of the extension, which the code belongs to. This API is only relevant for TIF Cloud Extension developers.
Since 2023-12-15
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
name() |
String |
Returns the name of the extension. |
|
installedVersion() |
int |
Returns the major version of the installed extension.NOTE, since an extension now can have a combination of a major and minor version value, this method have been marked as deprecated. It will be removed at some point in the future.For backward compatibility, when calling this method, it will return the major version.Deprecated#installedMajorVersion()#installedMinorVersion() |
|
installedMajorVersion() |
int |
Returns the major version of the installed extension. |
|
installedMinorVersion() |
int |
Returns the minor version of the installed extension. |
|
installedBuildNumber() |
int |
Returns the build number of the installed extension. |
|
released() |
boolean |
Returns true if the installed extension is a RELEASED version. |
|
uiConfigValues() |
Map<?, ?> |
Returns the UI configuration values entered via the admin UI screen or screens related to the Extension. |
|
uiConfigDefinition() |
Map<?, ?> |
Returns the UI configuration definition itself. This is useful in case the extension needs to resolve default values or query the definition for something. |
Headers
Headers API
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
names() |
Collection< String > |
Returns the names of the headers. The returned collection is immutable. |
|
contains(String name) |
boolean |
True if there is a header with the given name |
|
get(String name) |
String |
Returns the first header with the given name. |
|
getAll(String name) |
List< String > |
Returns all headers with the given name |
|
toMap() |
Map< String, List< String > > |
Returns all headers copied into a new map.Note that changes to the returned map is NOT reflected in this instance. |
HttpAPI
A simple http API that can be used to invoke remote services in an easy fashion.
Since 2022-09-14
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
newRequestBuilder() |
Creates a new request builder to be used for building up new requests. |
||
newRequestBuilder(String destinationName) |
Creates a new request builder instance, populating the builder with all settings defined in the destination with the given name.Note that if a destination with the given name was not found, an exception will be raised. |
|
|
generateBasicAuthToken(String username, String password) |
String |
Convenient method to generate a Basic authentication token. |
|
InputData
Represents the input data that for example is passed along when a job is being created.
Since 2022-06-22
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
size() |
long |
Returns the size of the input data, e.g. the number of bytes. |
|
stream() |
InputStream |
Returns the data as an |
|
content() |
byte[] |
Returns the data as a byte array. |
|
type() |
String |
Returns the content type representing the data, if known. |
|
contentAsString() |
String |
Tries to convert the data into a string, assuming the bytes stored contains character based data.Note that if the data is not character based, this method will most likely just return garbage chars. There is no check whether or not the content-type is a valid content type for the operation. |
|
encoding() |
String |
The encoding used when converting string based data into bytes. |
JobAPI
Contains various methods for spawning new jobs or request information from other jobs.
Since 2022-09-16
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
setSourceObject(String id, String type, String name, String revision, String status, String info) |
- |
Sets the source object for the current running job.When an event triggers a job, the source object is most of the time resolved automatically. However, when triggering a job via a REST call or via a Scheduled Task, this is not the case and in such situations the running logic may call this method to associate the job with a source object.Note that there is no logic in place that will validate the passed in values. |
|
setJobDescription(String description) |
- |
Sets the job-description for the current running job. |
|
addJobTags(String… tags) |
- |
Adds extra tags to the current job. |
|
awaitDSExchangeJob(String id, boolean isExport) |
- |
When requesting exchange export or import jobs via the DS Enterprise Exchange API, such job is created asynchronously.In order to be able to route the result from that asynchronous processing into this Job for future processing within TIF, you need to call this method.That will ensure that this job is marked as awaiting reply and will be invoked once TIF receives notification that the exchange job with the given ID is ready. |
|
newJob() |
|||
resolveInput(UUID jobId) |
Resolves the input for another job with the given ID. |
|
|
loadDataFrom(UUID jobId, String withName) |
Loads a |
|
JobRequestBuilder
This builder is used to build/setup new JobRequest instances.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
configuration(String configurationRef) |
Specify what configuration to be used for the new job |
|
|
input(byte[] data, String contentType, String encoding) |
Associate some input data with the new job |
|
|
param(String name, String… value) |
Associates a param name / value (or values) with the new job.If an existing parameter is present with the same name, the values are added to the previous parameter list.If the value argument is set to null, the parameter is removed. |
|
|
header(String name, String… value) |
Associates a header name / value (or values) with the new job.If an existing header is present with the same name, the values are added to the previous header value list.If the value argument is set to null, the header is removed. |
|
|
jobTag(String tag) |
Adds a job-tag to be associated with the new job. |
|
|
build() |
Builds the immutable JobRequest that is used to perform the actual job request with |
JobRequestMessage
Contains data from the job request message.
Since 2022-09-15
JsonAPI
Contains various common JSON related tasks such as serialize and deserialize JSON data.
Since 2022-09-14
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
readValue(String json, Class< T > type) |
< T > T |
Tries to convert a JSON string into a Java object of the given type. |
|
writeValue(Object value, OutputStream destination) |
- |
Converts a Java object into a JSON string representation and writes the bytes of this string encoded with UTF-8 encoding to the given OutputStream.Note: the stream is not closed |
|
serialize(Object value) |
String |
Serializes a Java object into a JSON string representation. |
|
LocalFile
LocalFile API
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
fileName() |
String |
||
name() |
String |
||
path() |
String[] |
||
size() |
long |
||
outputStream() |
OutputStream |
||
inputStream() |
InputStream |
||
loadText(@Nullable String charset) |
String |
Loads the content of the file as a text. Using either the specified charset, or UTF-8 if not specified, to convert the bytes into a string. |
|
saveText(@Nullable String text, @Nullable String charset) |
- |
Saves the text to the file using either the specified charset, or UTF-8 if not specified, to convert the String into bytes. |
|
load() |
byte[] |
Reads all bytes from the file into memory. |
|
save(byte[] data) |
- |
Saves the bytes into the file. |
|
toData(String overrideFileName, String contentType, String contentEncoding, String description) |
Converts this instance to a Data instance to be used with the |
||
toOutboundData(String overrideFileName, String contentType, String contentEncoding, String description) |
Converts this instance to a Data instance to be used with the |
||
exists() |
boolean |
Returns true if the file actually exists. |
|
delete() |
- |
Deletes this file |
LocalFileAPI
API for storing/handling files temporarily during a job execution. These files are short lived and will be removed once the job execution completes. NOTE: We will implement file-quota support in the near future, meaning that you will NOT be able to store more data than a certain threshold, which depends on the environment settings.
Since 2023-03-06
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
extract(@NonNull LocalFile file, @Nullable String dirName) |
Tries to extract a compressed file into a directory with the given name.The supported compression formats are:
* ZIP* …If the |
|
|
compress(@NonNull LocalFile destFile, @Nullable String dirName, @Nullable String targetDir) |
- |
Creates a compressed archive, e.g. a ZIP file, of all files available from the local-file area within the given directory.For example, if you have the following files in your local file area:
* test/file1.txt* test/file2.txt* test/test/file3.txtAnd you call this method with the following arguments: |
|
list() |
Lists all files and returns them in a List |
||
exists(String name) |
boolean |
Checks if there is a local file with the given name. |
|
get(String name) |
Retrieves a local file with the given name. If there is no such file, null will be returned. |
|
|
create(String name) |
Creates a new LocalFile instance that can be used to store data in a temporary / local file. Note that the file does not exist until you have written anything to the actual file. |
|
|
saveLocal(Data data, String overrideName) |
Saves a |
|
LocalFileDownloadResponse
This class is a subclass to com.technia.tias.executor.api.HttpAPI.ResponseInfo
.
Represents a response, where the data is kept in a LocalFile.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
file() |
Returns the local file, which contains the response data. |
Inherited Public Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
requestMethod() |
Returns the actual method used when the request was performed |
||
requestURL() |
String |
Returns the requested URL |
|
statusCode() |
int |
Returns the HTTP status code |
|
statusMessage() |
String |
Returns the HTTP status message |
|
succeeded() |
boolean |
This method returns true in case the HTTP status code is 2xx. |
|
contentType() |
String |
Returns the content type for the response, if known. |
|
contentLength() |
long |
Returns the size of the response body in bytes. |
|
charset() |
Charset |
The character set for the response data, if known and the response data represents character based data. |
|
headers() |
Returns the response headers. |
MacroResolver
A macro resolver is capable of resolving dynamic values from a string. Depending on the implementing class, the values are resolved from different sources.
Since 2023-10-13
MultiPartRequestBuilder
Builder used to create multi-part form-data requests, e.g. file uploads.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
param(String name, Object value) |
Adds a post parameter/value to be sent along with the request. |
|
|
file(String name, String fileName, byte[] content) |
Adds a file to be uploaded. |
|
|
file(String name, String fileName, InputStream inputStream) |
Adds a file to be uploaded.NOTE: the stream is NOT closed, that is the callers responsibility. |
|
|
file(String name, String fileName, LocalFileAPI.LocalFile localFile) |
Adds a file to be uploaded. |
|
|
and() |
Completes the building of the request body and returns the |
PDFConversionRequest
Contains various methods to configure the PDF conversion request. Converting a document to PDF may include the following steps:
-
Setting document properties
-
Optionally forcing field update
-
Export document to PDF (with/without security options applied)
-
Apply Watermarks
-
Digitally sign the PDF file
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
inputFile(LocalFileAPI.LocalFile file) |
Specifies what input file to be used |
|
|
properties() |
Returns the |
||
pdf() |
Returns the PDF conversion settings object allowing configuration of the PDF conversion/export. |
||
merge() |
Returns an object that can be used to configure merge of PDF document, like adding title pages and/or ending pages. |
||
watermark() |
Returns the watermark settings allowing you to configure watermarks to be applied on the generated PDF document. |
||
convertToImage() |
Returns the convert-to-image settings used for configuring the PDF to image conversion. |
||
sign() |
Returns the sign settings allowing you to configure any PDF digital signature |
||
perform(LocalFileAPI.LocalFile saveTo) |
Performs the PDF conversion according to configured behavior. |
|
PDFConversionResult
Holds the result of the PDF conversion
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
isSuccessful() |
boolean |
Contains information if the PDF conversion was successful or not. |
|
getErrorMessage() |
String |
If the PDF conversion failed, this method should provide error details. |
|
getResult() |
Returns the file holding the converted PDF file. |
PDFConversionSettings
Configures the PDF conversion itself.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
and() |
Completes the pdf conversion setting configuration |
||
archiveMode(int archiveMode) |
Specifies the PDF/Archive mode level. Values of 1,2,3 represents the following modes: * PDF/A-1 Part 1: Use of PDF 1.4 2005-09-28 ISO 19005-1 PDF 1.4 (Adobe Systems, PDF Reference, third edition)* PDF/A-2 Part 2: Use of ISO 32000-1 2011-06-20 ISO 19005-2 PDF 1.7 (ISO 32000-1:2008)* PDF/A-3 Part 3: Use of ISO 32000-1 with support for embedded files 2012-10-15 ISO 19005-3 PDF 1.7 (ISO 32000-1:2008)Any other integer disables the PDF/A mode. |
|
|
useLosslessCompression(Boolean useLosslessCompression) |
Specifies if graphics are exported to PDF using a lossless compression eg. PNG or if they are compressed using the JPEG format. |
|
|
jpegQuality(Integer jpegQuality) |
Specifies quality of the JPG export. A higher value results in higher quality and file.Minimum inclusive value: 1. Represents lowest value that can be used. The lower the value, the less good is the compression quality and the bigger is be the file size.Maximum inclusive value:100. Represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size. |
|
|
reduceImageResolution(Boolean reduceImageResolution) |
Specifies if the resolution of each image is reduced to the resolution specified by the |
|
|
maxImageResolution(Long maxImageResolution) |
Sets the max image resolution value in DPI.Allowed values are: * 75* 150* 300* 600* 1200 |
|
|
useTaggedPDF(Boolean useTaggedPDF) |
Determines if PDF are created by using special tags also known as Tagged PDF. |
|
|
exportBookmarks(Boolean exportBookmarks) |
Specifies if bookmarks are exported to PDF. |
|
|
exportFormFields(Boolean exportFormFields) |
Specifies whether form fields are exported as widgets or only their fixed print representation is exported. |
|
|
exportNotes(Boolean exportNotes) |
Specifies if notes are exported to PDF. |
|
|
exportBookmarksToPDFDestination(Boolean exportBookmarksToPDFDestination) |
Specifies that the bookmarks contained in the source file should be exported to the PDF file as Named Destination (see PDF 1.4 section 8.2.1). |
|
|
embedStandardFonts(Boolean embedStandardFonts) |
Specifies whether to embed the 14 standard PDF fonts or not. |
|
|
inputPassword(String inputPassword) |
Special use case when input file is a PDF file and the input file is password protected. |
|
|
documentOpenPassword(String documentOpenPassword) |
If set to a non null value enforces encrypted PDF file with a user password being set. |
|
|
changePermissionPassword(String changePermissionPassword) |
This is the password that allows the user to access some permissions |
|
|
printingRule(int printingRule) |
Specifies what printing is allowed.The allowed values are: * 0: Undefined* 1: Not Printable* 2: Print with low resolution* 3: Print with max resolution (default) |
|
|
changeRule(int changeRule) |
Specifies the change allowed to the document.The allowed values are: * 0: Undefined (default)* 1: No changes* 2: Insert/delete/rotate page* 3: Fill form fields* 4: Fill form fields and commenting* 5: All except page extraction |
|
|
enableCopyingOfContent(Boolean enableCopyingOfContent) |
Specifies that the pages and the document content can be extracted to be used in other documents (copy and paste). |
|
|
enableTextAccessForAccessibilityTools(Boolean enableTextAccessForAccessibilityTools) |
Specifies that the document content can be extracted to be used in accessibility applications. |
|
PDFMergeDocument
Contains information about a document to be merged
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
and() |
Return the |
||
file(LocalFileAPI.LocalFile file) |
Sets the file to be used for the merge operation. The file can either be a PDF file or an Office document. |
|
|
applyProperties(boolean value) |
Controls if properties will be transferred to the document that will be merged also. This operation can only be done on Office documents, so for PDF documents this flag has no effect. Per default, the same properties as set on the main document will be set on the other document. |
|
PDFMergeSettings
Contains methods that allows you to merge the main document with for example a title page and/or ending page. The merge documents can either be PDF documents or standard Office documents. For the latter, document properties can also be propagated before they are converted into PDF.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
and() |
Completes the pdf conversion setting configuration |
||
addTitlePage() |
Adds a title page |
||
addEndingPage() |
Adds a title page |
||
addTitlePage(LocalFileAPI.LocalFile file) |
Shorter variant for adding a title page, this method does not allow any additional configuration. |
|
|
addEndingPage(LocalFileAPI.LocalFile file) |
Shorter variant for adding an ending page, this method does not allow any additional configuration. |
|
PDFSignSettings
Specify PDF signing settings
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
pfxFile(LocalFileAPI.LocalFile file) |
If a personal information exchange file is being used for the certificates, you need to define what the name of this file is. |
|
|
pfxType(String pfxType) |
Specifies the type of PFX, for example "pkcs12" or similar. Default type is pkcs12. |
|
|
password(String password) |
The password for the PFX |
|
|
publicKeyFile(LocalFileAPI.LocalFile file) |
If using a X.509 certificate, point out the public key file using this.The file must be in PEM format. |
|
|
privateKeyFile(LocalFileAPI.LocalFile file) |
The private key must be provided in PEM format, and be a RSA private key |
|
|
tsaURL(String tsaUrl) |
Allows to configure a custom TSA URL to be used over the default. |
|
|
and() |
Completes the sign settings and returns the |
PDFToImageSettings
Contains settings related to PDF to Image conversion
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
dpi(Integer dpi) |
Configures the DPI value for the images. |
|
|
ignoreFirstPage(Boolean ignoreFirstPage) |
Explicitly exclude the first page |
|
|
ignoreLastPage(Boolean ignoreLastPage) |
Explicitly exclude the last page. |
|
|
imageFormat(String imageFormat) |
The image format. Accepted values are "PNG" or "JPG". Default is PNG if unspecified. |
|
|
imageType(String imageType) |
Configures the image type. Accepted values are: "RGB", "RGBA", "GRAY", "BINARY" (or "BW") or "BGR". |
|
|
fileNameFormat(String fileNameFormat) |
Configures the file name format for each image. The format can contain a format identifer to map the current page number. |
|
|
pageRange(String pageRange) |
Configure custom page ranges to extract. Example value: 1-2,4,10- |
|
|
and() |
Completes the pdf-to-image configuration |
PDFWatermark
Contains common settings for both image and text based watermarks. <T>The type of watermark (Image / Text).
PDFWatermarkImage
Contains Image based watermark specific settings
PDFWatermarkText
Contains text based watermark specific settings.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
text(String text) |
Defines the text to be used |
|
|
fontName(String fontName) |
The name of the font to be used.NOTE: ONLY A LIMITED SET OF FONTS ARE AVAILABLE, WE WILL CLARIFY THE LIST HERE |
|
|
fontSize(int fontSize) |
Declares the size of the font |
|
|
fontStyle(String fontStyle) |
Declares the font-style to be used |
|
|
fontColor(String fontColor) |
Sets the font color |
|
PDFWatermarksSettings
Defines watermark settings
PostParamsBuilder
Declares common methods for adding parameters to be part of the POST request.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
param(String name, Object value) |
Adds a name/value pair. |
|
|
params(String name, Object… values) |
Adds a parameter with the given |
|
|
params(String name, List< Object > values) |
Adds a parameter with the given |
|
|
and() |
Completes the addition of post-parameters and returns the parent request builder to be used to configure the request further with. |
Request
Request API
RequestBuilder
API for building a request.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
url() |
Returns an |
||
url(String url) |
Specifies the URL to be used. |
|
|
get(String url) |
Sets the request method to GET with the specified URL |
|
|
post(String url) |
Sets the request method to POST with the specified URL |
|
|
put(String url) |
Sets the request method to PUT with the specified URL |
|
|
patch(String url) |
Sets the request method to PATCH with the specified URL |
|
|
delete(String url) |
Sets the request method to DELETE with the specified URL |
|
|
method(Method method) |
Sets the request method to use |
|
|
method(String method) |
Sets the request method to use |
|
|
header(String name, String value) |
Adds a header with the given name and value.NOTE: If the value is null, the header with the given name is removed. |
|
|
headers(String name, Collection< String > values) |
Adds a header with the given name and values.Most headers are single values, but some allows multiple values such as the Cookie header.NOTE:If the value is null, the header with the given name is removed. |
|
|
headers(Map< String, String > headerMap) |
Sets the headers as provided from the map argumentIf the map contains an already defined header, the old value will be replaced with the new value. |
|
|
authorization(String value) |
Sets the header "Authorization" to the given value |
|
|
acceptsJson() |
Sets the header "Accept" to the value "application/json". |
||
jsonBody(String jsonBody) |
Sets the body to the given content and using content-type "application/json". |
|
|
body(String contentType, String body) |
Sets the body text to be sent |
|
|
bodyFromBlob(String contentType, byte[] blob) |
Sets a blob / byte array as body |
|
|
bodyFromFile(String contentType, LocalFileAPI.LocalFile file) |
Sets the body content to be sent from the content of the given file.Note that this method will not conduct a multipart file upload, it will just send the content of the file part of the request body. |
|
|
multiPartRequest() |
Creates a builder for creation of multipart form-data requests. |
||
postParams() |
|||
connectTimeout(long timeoutInMilliSeconds) |
Sets the default connect timeout in milliseconds for new connections.A value of 0 means no timeout, otherwise values must be between 1 and Integer.MAX_VALUE.The connect timeout is applied when connecting a TCP socket to the target host.The default value is 20 seconds. |
|
|
callTimeout(long timeoutInMilliSeconds) |
Sets the timeout in milliseconds for the complete calls.A value of 0 means no timeout, which is the default value, otherwise values must be between 1 and Integer.MAX_VALUE.The call timeout spans the entire call: resolving DNS, connecting, writing the request body, server processing, and reading the response body.If the call requires redirects or retries all must complete within one timeout period.The default value is 0 which imposes no timeout. |
|
|
readTimeout(long timeoutInMilliSeconds) |
Sets the read timeout in milliseconds for new connections.A value of 0 means no timeout (which is NOT recommended to use), otherwise values must be between 1 and Integer.MAX_VALUE.The read timeout is applied to both the TCP socket and for individual read IO operations including on Source of the Response.The default value is 30 seconds. |
|
|
writeTimeout(long timeoutInMilliSeconds) |
Sets the default write timeout in milliseconds for new connections.A value of 0 means no timeout (which is NOT recommended to use), otherwise values must be between 1 and Integer.MAX_VALUE.The write timeout is applied for individual write IO operations.The default value is 30 seconds. |
|
|
followRedirects(boolean value) |
Specifies whether or not to follow redirectsThe default value is TRUE. |
|
|
build() |
Completes the building process and returns the immutable Request object that can be used to perform the HTTP call. |
Response
This class is a subclass to com.technia.tias.executor.api.HttpAPI.ResponseInfo
.
Standard HTTP response API
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
bodyText() |
String |
Returns the body as a string |
|
body() |
byte[] |
Gives access to the raw body data as a byte array. |
Inherited Public Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
requestMethod() |
Returns the actual method used when the request was performed |
||
requestURL() |
String |
Returns the requested URL |
|
statusCode() |
int |
Returns the HTTP status code |
|
statusMessage() |
String |
Returns the HTTP status message |
|
succeeded() |
boolean |
This method returns true in case the HTTP status code is 2xx. |
|
contentType() |
String |
Returns the content type for the response, if known. |
|
contentLength() |
long |
Returns the size of the response body in bytes. |
|
charset() |
Charset |
The character set for the response data, if known and the response data represents character based data. |
|
headers() |
Returns the response headers. |
ResponseInfo
Contains common response related information
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
requestMethod() |
Returns the actual method used when the request was performed |
||
requestURL() |
String |
Returns the requested URL |
|
statusCode() |
int |
Returns the HTTP status code |
|
statusMessage() |
String |
Returns the HTTP status message |
|
succeeded() |
boolean |
This method returns true in case the HTTP status code is 2xx. |
|
contentType() |
String |
Returns the content type for the response, if known. |
|
contentLength() |
long |
Returns the size of the response body in bytes. |
|
charset() |
Charset |
The character set for the response data, if known and the response data represents character based data. |
|
headers() |
Returns the response headers. |
SetProperties
Used to declare properties to be set on a document
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
add(String name, Object value) |
Adds a key/value property. |
|
|
forceFieldUpdate(boolean value) |
Set to true to force update of fields in Word documents. Have no effect on other document types than DOCX files. |
|
|
updateExcelFieldRefs(boolean value) |
Set to true to iterate cells in the Excel spreadsheet to update links/refs to document properties. Have no effect on other document types than Excel files. |
|
|
and() |
Completes the set properties configuration |
SourceEvent
Contains data from the source event that triggered this job.
Since 2022-09-15
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
eventType() |
String |
Returns the event type. |
|
eventClass() |
String |
Returns the event class. |
|
user() |
String |
Returns the 3DX user |
|
authorization() |
String |
Returns the authorization value. |
|
objectId() |
String |
Returns the identifier of the source object causing the event to be fired. |
|
objectType() |
String |
Returns the type of the source object causing the event |
|
objectRelativePath() |
String |
Returns the relative path to the source object causing the event |
|
objectSource() |
String |
Returns the source to the source object causing the event |
|
objectRef() |
Referable |
Returns the source as a |
|
state() |
String |
If the event was a status changed event, this method returns the state of the object. Otherwise this method return null. |
TransformResult
Represents a result from an XML transformation. This object allows accessing the output properties, if available, from the transformation process.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getOutputProps() |
Map< String, String > |
Returns the output properties. This method will never return null. |
|
getStream() |
InputStream |
Returns a stream, from which the transformation result can be read. |
|
getSource() |
Source |
Returns the transformation result as a Source object. |
|
getResult(String charset) |
String |
Returns the result as a string |
|
UrlBuilder
API for building a URL.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getUrl() |
String |
Returns the URL, without any query string parameters. |
|
base(String url) |
Sets the base url. |
|
|
path(String path) |
Appends some path to the existing URL |
|
|
replacePathVariables(Map< String, Object > keyValues) |
Replaces path variables like |
|
|
removeParams() |
Removes all query string parameters associated with this builder. |
||
removeParam(String name) |
Removes a parameter with the given name |
|
|
param(String name, String value) |
Adds a parameter with the given name/value. |
|
|
params(String name, String… value) |
Adds a parameter with the given name and values. |
|
|
param(String name, ParamValue value) |
Special variant where the value is provided as a |
|
|
params(String name, ParamValue… values) |
Special variant where the values are provided as |
|
|
containsParam(String name) |
boolean |
Returns true if this UrlBuilder contains a parameter with the given name |
|
getParams(String name) |
List< String > |
Returns the parameters with the given name, if any. This method will never return null, only an empty list if there are no values for the requested parameter.Note that the returned list is immutable. |
|
and() |
Returns the parent |
UtilitiesAPI
This API provides various methods commonly used by job execution code.
Since 2023-09-08
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
base64Encode(byte[] data) |
String |
Encodes an array of bytes into a base 64 encoded string. |
|
base64Decode(String b64EncodedString) |
byte[] |
Decodes a base64 encoded String into a byte array. |
|
base64Encode(String input, String encoding) |
String |
Encodes a string into a base64 representation. The input string is first converted to bytes using the specified encoding. |
|
base64DecodeToString(String b64EncodedString, String encoding) |
String |
Decodes a base 64 encoded string into a string. The decoded bytes are converted to a string using the provided encoding. |
|
XmlAPI
Contains various methods to perform XML / XSLT / XPATH related operations.
Since 2023-05-31
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
toDOM(String xml) |
Document |
Parses a string containing XML data into a DOM Document |
|
toDOM(LocalFileAPI.LocalFile file) |
Document |
Parses a file containing XML data into a DOM Document |
|
toSource(String xml) |
Source |
Creates a Source representation of the XML data held in the given String. |
|
toSource(Document document) |
Source |
Creates a Source representation of the XML DOM tree. |
|
transform(Source xml, Source xslt, Map< String, ?> params) |
Transforms XML data using an XSLT stylesheet into another format. |
|
|
transform(Source xml, Source xslt, LocalFileAPI.LocalFile to, Map< String, ?> params) |
Transforms the XML data using an XSLT stylesheet into the given |
|
|
serialize(Document document) |
String |
Serializes a DOM document into a string representation |
|
serialize(Document document, LocalFileAPI.LocalFile to) |
- |
Serializes a DOM document into a file |
|
serialize(Document document, OutputStream out) |
- |
Serializes a DOM document into an output stream |
|
serialize(Document document, Writer writer) |
- |
Serializes a DOM document into a writer. |
|
prettyPrint(Document document) |
String |
Generate a pretty formatted string of the DOM document |
|
prettyPrint(Source src) |
String |
Generate a pretty formatted string of the XML source |
|
prettyPrint(Document document, Writer writer) |
- |
Writes the DOM document in a pretty format to the given writer. |
|
prettyPrint(Node node) |
String |
Generate a pretty formatted string of the DOM node |
|
prettyPrint(Node node, Writer writer) |
- |
Writes the DOM node in a pretty format to the given writer. |
|
selectNodes(Node from, String expression) |
NodeList |
Evaluates an XPath expression starting from the given node and returns a list of matched nodes. |
|
filterElements(NodeList nodes) |
Iterator< Element > |
From the provided NodeList argument, filter out Element nodes only |
|
selectValue(Node from, String expression, XPathReturnType returnType) |
String |
Evaluates an XPath expression starting from the given node and returns the result as a string.The returnType argument declares return value your XPath expression will select. Based on that, the output is converted into a String value.Null is an accepted value for the |
|
selectValues(Node from, String expression, XPathReturnType returnType) |
List< String > |
Evaluates an XPath expression starting from the given node and returns the result as a list of strings.The returnType argument declares what return value your XPath expression will select. Based on that, the output is converted into String values.Null is an accepted value for the |
|
newWriter(LocalFileAPI.LocalFile file, String encoding) |
Creates a new |
|
|
newWriter(Appendable appendable) |
Creates a new |
|
XmlWriter
Writes XML documents. Note that if you try to produce invalid XML data, that will cause runtime exceptions to be thrown by the API. This class is following the fluent API pattern in order to make it easier to develop and read the code used to construct XML data.
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
documentStart() |
Write the start of the document. |
||
documentStart(String encoding, String version) |
Write the start of the document. |
|
|
dtd(String dtd) |
Writes a doc type decl. |
|
|
entityRef(String name) |
|||
writeNamespace(String prefix, String namespaceURI) |
|||
cdata(String cdata) |
|||
comment(String comment) |
|||
startElement(String localName) |
Write a start element. |
|
|
startElement(String prefix, String localName, String namespaceURI) |
|||
startElement(String namespaceURI, String localName) |
|||
startElement(String localName, Map< String, String > attributes) |
Write a start element with attributes. |
|
|
text(String string) |
Writes the specified text. |
|
|
attribute(String localName, String value) |
Write an attribute to the currently open start tag. |
|
|
attribute(String namespaceURI, String localName, String value) |
Write a namespace associated attribute to the currently open start tag- |
|
|
attribute(String prefix, String namespaceURI, String localName, String value) |
Write a namespace associated attribute to the currently open start tag- |
|
|
endElement() |
Close the current tag. |
||
textElement(String element, String text) |
Write a text element. |
|
|
textElement(String localName, Map< String, String > attributes, String text) |
Write a text element with attributes. |
|
|
emptyElement(String element) |
Write an empty element. |
|
|
documentEnd() |
Write the end of the document. |
||
close() |
- |
Closes this writer. |
Public Enum Types
This chapter contains information about the public Enum constants part of the com.technia.tias.executor.api.
package.
DataType
A Data object is associated with a type, such as if the data is representing outbound data, inbound data or some other kind of data such as generated / converted data.
Since 2022-02-17
Enum Constants
To access an enum constant from the JS code, use this syntax:
// Load the enum class DataType
const DataType=Java.type('com.technia.tias.executor.api.DataType');
// Access the enum constant later on like this:
DataType.NAME_OF_CONSTANT;
Where NAME_OF_CONSTANT
is one of the constants from the enum to access, see the table below for available constants.
Name | Description |
---|---|
OUTBOUND |
Specifies outbound data |
INBOUND |
Specifies inbound data |
OTHER |
Used for data that neither can be categorized as inbound nor outbound data. |
Public Static Functions
To be able to call a static method on a class from the JS code, use this syntax:
const DataType=Java.type('com.technia.tias.executor.api.DataType');
DataType.nameOfMethod(...)
Signature | Returns | Description | Arguments |
---|---|---|---|
fromString(String s) |
Safe parsing a string into a DataType value. |
|
Method
Represents the available Http Methods
Enum Constants
To access an enum constant from the JS code, use this syntax:
// Load the enum class Method
const Method=Java.type('com.technia.tias.executor.api.HttpAPI.Method');
// Access the enum constant later on like this:
Method.NAME_OF_CONSTANT;
Where NAME_OF_CONSTANT
is one of the constants from the enum to access, see the table below for available constants.
Name | Description |
---|---|
GET |
|
POST |
|
PUT |
|
PATCH |
|
DELETE |
|
OPTIONS |
|
HEAD |
XPathReturnType
Declares different kind of XPath return types.
Enum Constants
To access an enum constant from the JS code, use this syntax:
// Load the enum class XPathReturnType
const XPathReturnType=Java.type('com.technia.tias.executor.api.XmlAPI.XPathReturnType');
// Access the enum constant later on like this:
XPathReturnType.NAME_OF_CONSTANT;
Where NAME_OF_CONSTANT
is one of the constants from the enum to access, see the table below for available constants.
Name | Description |
---|---|
NODE |
Declares that a given XPath expression returns a single node. |
NODESET |
Declares that a given XPath expression returns a set of nodes. |
NUMBER |
Declares that a given XPath expression returns a numeric value |
STRING |
Declares that a given XPath expression returns a string value |
BOOLEAN |
Declares that a given XPath expression returns a boolean value |
Public Static Functions
To be able to call a static method on a class from the JS code, use this syntax:
const XPathReturnType=Java.type('com.technia.tias.executor.api.XmlAPI.XPathReturnType');
XPathReturnType.nameOfMethod(...)
Signature | Returns | Description | Arguments |
---|---|---|---|
fromString(String value) |
Safe parse of a string into a ReturnType instance without throwing any exception, which the |
Public Classes
This chapter contains information about the public classes part of the com.technia.tias.executor.api.
package.
ByteArrayData
This class is a subclass to com.technia.tias.executor.api.InMemoryData
.
Data implementation holding binary content as a byte array in memory.
Since 2022-09-22
Public Constructors
To be able to load the class from the JS code, use this syntax:
const ByteArrayData=Java.type('com.technia.tias.executor.api.ByteArrayData');
let instance = new ByteArrayData(... args ...);
Signature | Description | Arguments |
---|---|---|
ByteArrayData(byte[] data, String contentType, Charset charset, String name, String description, DataType dataType) |
Constructs a new immutable ByteArrayData instance. |
|
Public Static Functions
To be able to call a static method on a class from the JS code, use this syntax:
const ByteArrayData=Java.type('com.technia.tias.executor.api.ByteArrayData');
ByteArrayData.nameOfMethod(...)
Signature | Returns | Description | Arguments |
---|---|---|---|
newBuilder() |
Creates a new ByteArrayDataBuilder instance |
Inherited Public Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getName() |
String |
Returns the name of this data. |
|
getType() |
Returns the type of data, e.g. whether this data is used as INBOUND, OUTBOUND or OTHER. |
||
getDescription() |
String |
Returns a description of the data. |
|
getInputStream() |
InputStream |
Returns an inputstream that contains the bytes representing the data. |
|
getContentType() |
String |
Returns the content type. |
|
getContentEncoding() |
String |
Returns the content encoding. |
|
getContentAsString() |
String |
Tries to convert the data into a String using the encoding as specified via the |
|
getSize() |
long |
Returns the size of this data.Note that this is not the same as the character count and depends on what character set is being used. |
|
getBytes() |
byte[] |
ByteArrayDataBuilder
Builder for ByteArrayData instances.
DataBuilder
Base class for various builder implementation that builds Data instances <T>The type of data the builder is producing
ExecutionException
Execution exception can be thrown from an executor in order to capture execution exceptions. Note that you can throw any RuntimeException from the executor code but if you want to support retry attempts for an executor, you need to use the ExecutionException and provide retry information.
Since 2022-02-10
Public Constructors
To be able to load the class from the JS code, use this syntax:
const ExecutionException=Java.type('com.technia.tias.executor.api.ExecutionException');
let instance = new ExecutionException(... args ...);
Signature | Description | Arguments |
---|---|---|
ExecutionException() |
Default constructor. The retry flag will not be set when this constructor is used. |
|
ExecutionException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) |
Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used. |
|
ExecutionException(String message) |
Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used. |
|
ExecutionException(Throwable cause) |
Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used. |
|
ExecutionException(String message, Throwable cause) |
Constructs a new ExecutionException with the given data. The retry flag will not be set when this constructor is used. |
|
ExecutionException(Throwable cause, boolean retryable, long retryDelay) |
Constructs a new ExecutionException with the given data. |
|
ExecutionException(String message, Throwable cause, boolean retryable, long retryDelay) |
Constructs a new ExecutionException with the given data. |
|
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
isRetryable() |
boolean |
Returns true if the failure is of a kind that could be recovered at a later time by retrying the operation. |
|
getRetryDelay() |
long |
Returns the minimum delay to wait until retrying again. The returned value is in milliseconds. |
InMemoryData
This class is a subclass to com.technia.tias.executor.api.Data
.
An in-memory representation of a Data instance. This instance is immutable
Since 2022-09-22
Public Constructors
To be able to load the class from the JS code, use this syntax:
const InMemoryData=Java.type('com.technia.tias.executor.api.InMemoryData');
let instance = new InMemoryData(... args ...);
Signature | Description | Arguments |
---|---|---|
InMemoryData(Data data) |
Constructs a new |
|
InMemoryData(byte[] content, String contentType, Charset charset, String name, String description, DataType dataType) |
Constructs a new immutable instance. |
|
Public Member Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getName() |
String |
Returns the name of this data. |
|
getType() |
Returns the type of data, e.g. whether this data is used as INBOUND, OUTBOUND or OTHER. |
||
getDescription() |
String |
Returns a description of the data. |
|
getInputStream() |
InputStream |
Returns an inputstream that contains the bytes representing the data. |
|
getContentType() |
String |
Returns the content type. |
|
getContentEncoding() |
String |
Returns the content encoding. |
|
getContentAsString() |
String |
Tries to convert the data into a String using the encoding as specified via the |
|
getSize() |
long |
Returns the size of this data.Note that this is not the same as the character count and depends on what character set is being used. |
|
getBytes() |
byte[] |
Inherited Public Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getName() |
String |
Returns the name of this data instance. |
|
getType() |
Returns the type for this data instance, if known. |
||
getDescription() |
String |
Returns the description for this data instance, if known. |
|
getInputStream() |
InputStream |
This method returns an InputStream from which you can read all the bytes of this data instance. |
|
getContentType() |
String |
Returns the content type of the data, if known. |
|
getContentEncoding() |
String |
Returns the content encoding if known.In most cases UTF8 will be used if this information is not provided and there is a need to convert bytes into characters or vice versa. |
|
getContentAsString() |
String |
Tries to convert the data into a String using the encoding as specified via the |
|
getSize() |
long |
Returns the size of the data content if known. A negative value can be returned to indicate that the size is not known. |
StringData
This class is a subclass to com.technia.tias.executor.api.InMemoryData
.
Data implementation for String based data.
Since 2022-02-17
Public Constructors
To be able to load the class from the JS code, use this syntax:
const StringData=Java.type('com.technia.tias.executor.api.StringData');
let instance = new StringData(... args ...);
Signature | Description | Arguments |
---|---|---|
StringData(String data, String contentType, Charset charset, String name, String description, DataType dataType) |
Constructs a new immutable StringData instance. |
|
Public Static Functions
To be able to call a static method on a class from the JS code, use this syntax:
const StringData=Java.type('com.technia.tias.executor.api.StringData');
StringData.nameOfMethod(...)
Signature | Returns | Description | Arguments |
---|---|---|---|
newBuilder() |
Returns a new |
Inherited Public Functions
Signature | Returns | Description | Arguments |
---|---|---|---|
getName() |
String |
Returns the name of this data. |
|
getType() |
Returns the type of data, e.g. whether this data is used as INBOUND, OUTBOUND or OTHER. |
||
getDescription() |
String |
Returns a description of the data. |
|
getInputStream() |
InputStream |
Returns an inputstream that contains the bytes representing the data. |
|
getContentType() |
String |
Returns the content type. |
|
getContentEncoding() |
String |
Returns the content encoding. |
|
getContentAsString() |
String |
Tries to convert the data into a String using the encoding as specified via the |
|
getSize() |
long |
Returns the size of this data.Note that this is not the same as the character count and depends on what character set is being used. |
|
getBytes() |
byte[] |