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; and
- 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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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 |