Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Integrate Endpoints

Introduction

The examples package contains Integrate Endpoints of each type in order to demonstrate their capabilities and some sample configurations.

The example package's endpoints are configured to use the following services, which are collectively under the endpointServices package:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
examples
├── ...
└── code
    └── endpointServices
        ├── gloop
        │   ├── emailExamples
        │   │   └── ReadEmailAttachments.gloop
        │   ├── fileExamples
        │   │   ├── LogToFile.gloop
        │   │   └── SendToRemoteLocation.gloop
        │   ├── jabberExamples
        │   │   ├── GuessingGame.gloop
        │   │   └── util
        │   │       ├── CacheUserGuessingNumber.gloop
        │   │       ├── GetCacheUserGuessingNumber.gloop
        │   │       └── RemoveCacheUserGuessingNumber.gloop
        │   └── ...
        └── groovy
            ├── EmailExamples.groovy
            └── ...

You will notice that each service has a Gloop and Groovy version. It is possible to configure any of the endpoints so that they call the Gloop service instead of the Groovy service or vice versa.

Try It!

The example package's endpoints are easily accessible under the Endpoints tree item in the Coder Navigator view. See the available endpoints in action simply by enabling1 and starting them.

Some of the endpoints in the examples package needs to be set up before services could be invoked. In the following sub-sections, we'll run you through the setup process of each endpoint.

Scheduler Endpoint

The sample scheduler endpoint is already created in the examples package. Before enabling the scheduler endpoint, you must first open the package.properties file and configure the email credentials. Properties required are enlisted and described in the table below:

Key Description
protocol Protocol of the SMTP server
server Host of the SMTP server
port Port of the SMTP server
login Username used for the SMTP server
password Password used for the SMTP server
email.bulk.to Comma-separated email addresses that will receive the email

After configuring these properties, you may proceed with enabling and starting the SendScheduledEmail endpoint in the examples package.

Use one of the following as the endpoint's service:

Type Service
Gloop code/endpointServices/gloop/schedulerExamples/SendScheduledEmail.gloop
Groovy code/endpointServices/groovy/SchedulerExamples.sendScheduledEmail()

Once invoked, the services above will send an email to the configured recipients.

JMS Listener Endpoint

The sample JMS listener endpoint is already configured so all you have to do is to start the JMSListenerExample endpoint of the examples package.

You may use any of the following services as the endpoint's service2:

Type Service
Gloop code/endpointServices/gloop/JMSExamples/ReceiveJMS.gloop
Groovy code/endpointServices/groovy/JMSExamples.receiveJMS()

Once the JMSListenerExample endpoint is enabled and started, invoke the ReceiveJMS service to publish a message to the JMS listener, which then consequently triggers the endpoint.

Email Endpoint

A sample email endpoint is not provided out-of-the-box which is why a new endpoint of said type must be created with the following required properties provided:

Key Description
protocol Protocol of the SMTP server
server Host of the SMTP server
port Port of the SMTP server
login Username used for the SMTP server
password Password used for the SMTP server

You may use any of the following services as the endpoint's service2:

Type Service
Gloop code/endpointServices/gloop/emailExamples/ReadEmailAttachments.gloop
Groovy code/endpointServices/groovy/EmailExamples.readEmailAttachment()

Send service response as reply

You can easily reply to received messages via the Send service response as reply option. With this, the message returned by the service is sent as the response when the endpoint gets triggered by a received email.

RSS Endpoint

The sample RSS endpoint is already created and configured, you just have to enable and start the RSSExample endpoint.

You may use any of the following services as the endpoint's service2:

Type Service
Gloop code/endpointServices/gloop/rssExamples/RssReader.gloop
Groovy code/endpointServices/groovy/RSSExamples.rssReader()

Tracker Resubmit Endpoint

The sample Tracker resubmit endpoint is already configured; all you have to do is enable and start the endpoint to see the endpoint in action. Take note that this endpoint is dependent on the RSS endpoint (RSSExample), so that endpoint has to be enabled and started as well before you can use TrackerResubmitExample.

You may use any of the following services as the endpoint's service2:

Type Service
Gloop code/endpointServices/gloop/trackerResubmitExamples/Resubmit.gloop
Groovy code/endpointServices/groovy/TrackerResubmitExamples.resubmit()

Directory Watcher Endpoint

Before creating a directory watcher endpoint to serve as an example, you must first configure the required FTP credentials using the package.properties file.

Key Description
ftp.host FTP server host
ftp.username FTP server username
ftp.password FTP server password
ftp.protocol FTP server

You may use any of the following services as the endpoint's service2:

Type Service
Gloop code/endpointServices/gloop/FileExamples/SendToRemoteLocation.gloop
Groovy code/endpointServices/groovy/FileExamples.sendToRemoteLocation()

REST Alias Endpoint

The REST alias endpoint is already configured, you just have to enable and start up the RestAliasExample endpoint of the examples package.

You may use any of the following services as this endpoint's service2:

Type Service
Gloop code/endpointServices/gloop/JMSExamples/SendJMSMessage.gloop
Groovy code/endpointServices/groovy/JMSExamples.sendJMSMessage()

FTP Client Endpoint

Since there is no example created by default, you must create the FTP client endpoint and use one of the following services as the service of the endpoint:

Type Service
Gloop code/endpointServices/gloop/FileExamples/LogToFile.gloop
Groovy code/endpointServices/groovy/FileExamples.logFileChange()

Jabber Endpoint

Since there is no example created by default, you must create the Jabber endpoint and use one of the following services as the service of the endpoint:

Type Service
Gloop code/endpointServices/gloop/JabberExamples/GuessingGame.gloop
Groovy code/endpointServices/groovy/JabberGuessingGame.guess()

  1. You can do this by ensuring that the Auto Start checkbox is ticked. 

  2. Or in other words, the service that the endpoint will be invoking once conditions are met.