Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

One-liners

Introduction

The term 'one-liners' is used to refer to the collection of utility classes shipped and exposed to the TORO Integrate development environment out-of-the-box, typically via extension modules. They provide methods intended to solve common integration problems with literally one line of code, hence the name 'one-liners'.

Most one-liner classes are registered under the io.toro.integrate package. They can all be used in Groovy Services, but some one-liners are intended for use in Gloop only. These Gloop-specific one-liners are alternatively called 'Gloop core services' and are the set of one-liners shown in the Coder Navigator view. To see them, open up the services directory of the core package:

Gloop core services, as seen in the *Coder Navigator* view

Gloop core services, as seen in the *Coder Navigator* view

Not all one-liners are displayed in Coder

The one-liners shown in the Coder Navigator view are those that are for use in Gloop Services. One-liners for Groovy are not displayed entirely.

Coder makes these core services easier and quicker to use by allowing them to be dragged and dropped into opened services:

Dragging Core Services to a Gloop Service

Dragging Core Services to a Gloop Service

Additionally, you can also view a one-liner's Javadoc by right-clicking on it in the Coder Navigator view and selecting Open Javadoc:

Opening the Javadoc of a one-liner class

Opening the Javadoc of a one-liner class

Collection of One-liners

Most one-liners are made and maintained by TORO and are specifically for use in TORO Integrate. These one-liners are listed and described in the following table:

Name For Groovy For Gloop Description
io.toro.integrate.ArrayMethods No Yes Contains extension methods for performing operations on iterables.
io.toro.integrate.CacheMethods Yes Yes Contains extension methods for managing caches.
io.toro.integrate.CejiMethods Yes Yes Contains extension methods for creating and formatting CEJI's responses.
io.toro.integrate.CoreMethods Yes No Contains extension methods for invoking services and getting objects from TORO Integrate's application context.
io.toro.integrate.CsvMethods Yes No Contains extension methods for CSV-related operations.
io.toro.integrate.EmailMethods No Yes Contains utility methods for reading and sending emails.
io.toro.integrate.FileMethods Yes Yes Contains extension methods for reading and writing to files.
io.toro.integrate.FlatFileMethods No Yes Contains utility methods for reading and writing to flat files.
io.toro.integrate.FluxMethods Yes Yes Contains extension methods for executing, terminating, sending events, adding and removing tags, and getting the contexts of Flux Services.
io.toro.integrate.GloopMethods No Yes Contains a variety of handy methods for use inside Gloop Services.
io.toro.integrate.GroovyMethods Yes Yes Contains extension methods that help manage packages, package properties, instance properties, and others.
io.toro.integrate.HttpClientMethods Yes No Contains extension methods for HTTP operations.
io.toro.integrate.HttpMethods No Yes Contains utility methods for mapping HTTP-based operations in Gloop.
io.toro.integrate.IntegrateMethods No Yes Contains utility methods for managing Integrate Packages and Endpoints in Gloop.
io.toro.integrate.JabberMethods Yes Yes Contains extension methods for sending and receiving instant messages from Jabber endpoints.
io.toro.integrate.JDBCConnectionPoolMethods No Yes Contains extension methods for managing the lifecycle of database connection pools.
io.toro.integrate.JmsMethods Yes Yes Contains extension methods for publishing and responding to JMS messages.
io.toro.integrate.JsonMethods No Yes Contains utility methods for creating a Gloop Object from a JSON string and vice versa.
io.toro.integrate.LoggerMethods Yes Yes Contains extension methods for logging messages.
io.toro.integrate.MarshallerMethods Yes No Contains extension methods for convering objects to and from JSON or XML.
io.toro.integrate.MonitorMethods Yes Yes Contains extension methods for searching the Monitor Search Index, managing Monitor Rules, and checking and setting API costs.
io.toro.integrate.NumberMethods Yes Yes Exposes Apache Commons Lang's NumberUtils class as a one-liner.
io.toro.integrate.ProxyRequestMethods Yes Yes Contains extension methods used to proxy incoming HTTP requests to another server; helpful when dealing with legacy APIs.
io.toro.integrate.RestMethods Yes No Contains extension methods for executing requests against REST endpoints.
io.toro.integrate.RssMethods Yes Yes Contains extension methods for fetching RSS feeds.
io.toro.integrate.SolrMethods Yes Yes Contains extension methods for querying and writing to Solr cores and creating Solr schemas.
io.toro.integrate.SqlMethods Yes Yes Contains extension methods for connecting to JDBC databases.
io.toro.integrate.StreamMethods No Yes Contains utility methods for mapping Streams in Gloop.
io.toro.integrate.StringMethods Yes Yes Contains extension methods for manipulating streams; exposes Apache Commons Lang's StringUtils class as a one-liner.
io.toro.integrate.TrackerMethods Yes Yes Contains extension methods for adding, searching, updating, and deleting documents in the Tracker Search Index.
io.toro.integrate.UrlMethods Yes Yes Contains extension methods for manipulating URLs.
io.toro.integrate.UserGroupMethods No Yes Contains extension methods for managing access control.
io.toro.integrate.UtilMethods Yes Yes Contains extension methods for formatting and converting double and long values to string values.
io.toro.integrate.VelocityMethods Yes Yes Contains extension methods for parsing Velocity templates.
io.toro.integrate.VfsMethods Yes Yes Contains extension methods for sending and fetching files, especially files from remote servers.
io.toro.integrate.WebSocketMethods Yes Yes Contains extension methods for sending web socket messages.
io.toro.integrate.WidgetPageMethods Yes Yes Contains extension methods for fetching pages and widgets made from the Report Builder.
io.toro.integrate.XmlMethods No Yes Contains utility methods for creating a Gloop Object from an XML string and vice versa.

Why are some classes not meant for use in Gloop or Groovy?

All one-liners are written in Groovy and thus, can be used in Groovy code. As a consequence, they can also be used in Gloop Invoke and Gloovy Steps. There are no restrictions in where or when to use one-liners but TORO recommends using Gloop or Groovy's built-in features when they provide more or less the same benefit as using a one-liner.

Some one-liners are not needed in Groovy because Groovy already provides the means to perform their operations inherently using a single line of code; likewise, some one-liners are not recommended for use in Gloop because Gloop already has the constructs necessary to perform those functions natively.

The following helper classes from Apache Commons are also exposed, for use in both Gloop and Groovy:

Additionally, TORO Integrate exposes the Groovy class org.codehaus.groovy.runtime.DefaultGroovyMethods which is comprised of a variety of methods that one can use to modify strings, perform operations on collections, read and write to files, and more.