Skip to content

Overview

Development

Overview

IDEs

API Explorer

IntegrateMethods

The IntegrateMethods class contains Gloop-specific one-liners for managing Integrate packages and endpoints programmatically. It includes methods for:

  • Importing packages
  • Compiling packages
  • Fetching package metadata
  • Creating packages and endpoints
  • Getting packages and endpoints
  • Starting and stopping packages and endpoints
  • Enabling and disabling endpoints
  • Deleting existing endpoints
  • Validating endpoints

IntegrateMethods one-liners are for Gloop-use only

Most, if not all, of the methods in this class require and/or return Gloop-specific objects. More importantly, TORO Integrate already provides Groovy/Java classes that are capable of performing the functions above. These one-liners are meant to make it easy to do the same in Gloop.

For Managing Packages Programmatically

Below are the methods included in the IntegrateMethods extension class for interacting with Integrate packages in Gloop.

savePackage

Use the IntegrateMethods.savePackage(GloopModel) method to create new packages or modify existing ones.

Parameters

Name Index Type Description
integratePackage 0 io.toro.gloop.object.property.GloopModel Contains the details of the to-be-created or to-be-updated package

Usage

Sample `savePackage` usage

importPackage

Use either of the importPackage(...) methods below to add an existing package to your TORO Integrate instance from a ZIP archive:

  • IntegrateMethods.importPackage(File, boolean)
  • IntegrateMethods.importPackage(InputStream, boolean)

Parameters

Name Index Type Description
file 0 java.io.File Package ZIP file
inputStream 0 java.io.InputStream Package ZIP stream
startOnCreate 1 java.lang.Boolean Indicates whether or not to start the package upon successful import

Return Value

Property Type Description
integratePackages io.toro.gloop.object.property.GloopModel Collection of imported packages

Usage

Sample `importPackage(File, boolean)` usage

Sample `importPackage(InputStream, boolean)` usage

compilePackage

Use the IntegrateMethods.compilePackage(String) one-liner to recompile a package's scripts and reset its associated ClassLoader(s).

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the Integrate package to compile

Usage

Sample `compilePackage` usage

getPackageXml

The IntegrateMethods.getPackageXml(String) one-liner allows the caller to get the string content of a specified package's esbpackage.xml file.

Parameters

Name Type Description
packageName java.lang.String The name of the package whose package descriptor file is to be fetched

Return Value

Name Type Description
output java.lang.String The content of the package's esbpackage.xml file

Usage

Sample `getPackageXml` file

getChildPackages

Use the IntegrateMethods.getChildPackages(String) one-liner to get the list of packages dependent on the named package.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package whose dependencies will be fetched

Return Value

Name Type Description
integratePackages io.toro.gloop.object.property.GloopModel The collection of dependent packages

Usage

Sample `getChildPackages(String)` usage

getParentPackages

The IntegrateMethods.getParentPackages(String) method is used to get the list of packages a given Integrate package requires.

Parameters

Name Type Description
packageName java.lang.String The name of the package whose dependencies will be fetched

Return Value

Property Type Description
integratePackages io.toro.gloop.object.property.GloopModel The list of packages the Integrate package is dependent on

Usage

Sample `getParentPackages` usage

getPackage

Use IntegrateMethods.getPackage(String) to get a package by its name.

Parameters

Name Type Description
packageName java.lang.String The name of the package to get

Return Value

Name Type Description
integratePackage io.toro.gloop.object.property.GloopModel The package represented as a Gloop model

Usage

Sample `getPackage` usage

getPackages

The IntegrateMethods.getPackages() one-liner allows the caller to obtain all currently living Integrate packages in the TORO Integrate instance.

Return Value

Name Type Description
integratePackages io.toro.gloop.object.property.GloopModel A list of all residing Integrate packages in the instance

Usage

Sample `getPackages` usage

startPackage

Use the IntegrateMethods.startPackage(String) one-liner to start a package by name.

Parameters

Name Type Description
packageName java.lang.String The name of the package to start

Usage

Sample `startPackage` usage

stopPackage

Use the IntegrateMethods.stopPackage(String) one-lienr to stop a package by name.

Parameters

Name Type Description
packageName java.lang.String The name of the package to stop

Usage

Sample `stopPackage` usage

disablePackage

Use the IntegrateMethods.disablePackage(String) one-liner to disable packages by their name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package to disable

Usage

Sample `disablePackage` usage

enablePackage

Use the IntegrateMethods.enablePackage(String, boolean) one-liner to enable packages by their name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package to enable
startOnEnabled 1 boolean Indicates whether on not to start the package once it has been enabled

Usage

Sample `enablePackage` usage

deletePackage

Use the IntegrateMethods.deletePackage(String) one-liner to delete packages by their name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package to delete

Usage

Sample `deletePackage` usage

A package must be stopped before it can be deleted

Calling the IntegrateMethods.deletePackage(String) one-liner to delete an unstopped package will result in a thrown exception.

For Managing Endpoints Programmatically

Below are the methods included in the IntegrateMethods extension class for interacting with Integrate endpoints in Gloop.

deleteEndpoint

Use the IntegrateMethod.deleteEndpoint(String, String) one-liner to delete an endpoint by name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package owning the endpoint to be deleted
endpointName 1 java.lang.String The name of the endpoint to delete

Usage

Sample `deleteEndpoint` usage

Stop the endpoint first before deleting

TORO Integrate will thrown an exception if you try to delete a running endpoint.

disableEndpoint

Use the IntegrateMethods.disableEndpoint(String, String) method to disable an endpoint by name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package owning the endpoint to be disabled
endpointName 1 java.lang.String The name of the endpoint to disable

Usage

Sample `disableEndpoint` usage

enableEndpoint

Use the IntegrateMethods.enableEndpoint(String, String) method to enable an endpoint by name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package owning the endpoint to be enabled
endpointName 1 java.lang.String The name of the endpoint to enable

Usage

Sample `enableEndpoint` usage

saveEndpoint

Use the IntegrateMethods.saveEndpoint(String, GloopModel) one-liner to create a new endpoint or edit an existing one.

Parameters

Name Type Description
packageName java.lang.String The name of the package owning the endpoint
endpoint io.toro.gloop.object.property.GloopModel The endpoint to be saved

Usage

Sample `saveEndpoint` usage

startEndpoint

Use the IntegrateMethods.startEndpoint(String, String) one-liner to start an endpoint by name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package owning the endpoint to be started
endpointName 1 java.lang.String The name of the endpoint to start

Usage

Sample `startEndpoint` usage

stopEndpoint

Use the IntegrateMethods.stopEndpoint(String, String) one-liner to stop an endpoint by name.

Parameters

Name Index Type Description
packageName 0 java.lang.String The name of the package owning the endpoint to be stopped
endpointName 1 java.lang.String The name of the endpoint to stop

Usage

Sample `stopEndpoint` usage

validateEndpoint

The IntegrateMethods.validateEndpoint(String, GloopModel) method returns true when the given endpoint is valid; otherwise, it throws an exception.

Parameters

Name Type Description
packageName java.lang.String The name of the package owning the endpoint
endpoint io.toro.gloop.object.property.GloopModel The endpoint to be validated

Return Value

Name Type Description
output boolean Whether or not the endpoint is valid

Usage

Sample `validateEndpoint` usage