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 examples 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 need 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.

Directory watcher

A Directory watcher endpoint is not available in the examples package, so you must create one
yourself. For example purposes, TORO recommends you use any of the following services as the endpoint's service:

Either services require that you configure the FTP credentials to be used. You can do this by setting the following
properties in 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

Not enough time to setup your own FTP server?

There are public FTP servers like DLP Test if you want a quick way to set up an FTP server.

To trigger the endpoint, you must either add, modify, or delete a file in the directory configured for the endpoint.
This all depends on which actions you have configured the endpoint to respond to.

The result of the endpoint invocation depends on the configured service. For the services above, you should expect the
file that triggered the service to be sent over the FTP server.

Email

An example email endpoint is not provided out-of-the-box which is why a new endpoint of said type
must be created. The following properties must also be configured:

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

TORO recommends you use any of the following services as the endpoint's service:

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.

To trigger the endpoint, send an email to the email address (account) configured for the endpoint.

The result of the endpoint invocation depends on the configured service. For the services above, you should expect the
email received to be logged to the console.

FTP client

Since there is no example created by default, you must create the FTP client endpoint. You can
use any 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()

To trigger this endpoint, add, update, or delete a tracked file from the configured FTP/FTPS/SFTP server. Which action
to perform depends on the type of events tracked by this endpoint.

The result of the endpoint invocation depends on the configured service. For the services above, you should expect the
name of the file that triggered the service to be logged to the console.

JMS listener

The example 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 service:

Type

Service

Gloop

code/endpointServices/gloop/JMSExamples/ReceiveJMS.gloop

Groovy

code/endpointServices/groovy/JMSExamples.receiveJMS(Message)

Once the JMSListenerExample endpoint is enabled and started, the JMS queue queue://exampleJMSListener becomes
active. It will wait for JMS messages to be sent. The endpoint gets triggered when a message is received in said
destination.

Invoke SendJMSMessage.gloop or JMSExamples.sendJMSMessage(String, String) to publish a message to the aforementioned
JMS destination. Upon endpoint invocation, you should expect a log message like below:

Scheduler

The example 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 to enabling and starting the SendScheduledEmail endpoint.

The endpoint will be invoked after every configured interval. And once invoked, either of the services above will send
an email to the configured recipients.

Tracker resubmit

The example Tracker resubmit endpoint is already configured; all you have to do is enable
and start it 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 service:

Type

Service

Gloop

code/endpointServices/gloop/trackerResubmitExamples/Resubmit.gloop

Groovy

code/endpointServices/groovy/TrackerResubmitExamples.resubmit()

Enabling this endpoint allows RSSdocuments of Startedstates2
to be resubmitted in the Tracker UI. Upon resubmitting an RSS document, you would notice a
Resubmit Count property added to it.3

REST alias

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

TORO recommends you use any of the following services as this endpoint's service:

Type

Service

Gloop

code/endpointServices/gloop/JMSExamples/SendJMSMessage.gloop

Groovy

code/endpointServices/groovy/JMSExamples.sendJMSMessage()

To trigger this endpoint, enable the JMSListener endpoint, and send a request to GET request to
/api/sendJMSMessage?jmsQueue=queue://news&messageContent=Hello. You should receive a response similar to: