ICF 1.5.20.26

Scripted connectors with Groovy

The Groovy connector toolkit lets you run Groovy scripts to interact with any external resource.

The Groovy connector toolkit is not a complete connector in the traditional sense. Instead, it is a framework where you must write your own Groovy scripts to address your deployment requirements. The toolkit is bundled with IDM in the JAR openidm/connectors/groovy-connector-1.5.20.26.jar.

IDM provides a number of deployment-specific scripts to help you get started with the Groovy connector toolkit. These scripts demonstrate how the toolkit can be used. The scripts cannot be used "as is" in your deployment but can be used as a starting point to base your customization.

The Groovy connector toolkit can be used with any ICF-enabled project (that is, any project where the OpenICF is installed).

About the Groovy scripting language

Groovy is a powerful, convenient scripting language for the Java platform. Groovy lets you take advantage of existing Java resources and generally makes development quicker. Syntactically, Groovy is similar to JavaScript. Extensive information about Groovy is available on the Groovy documentation site.

Selecting a scripted connector implementation

The Groovy connector toolkit provides five default connector implementations. The default implementations address the requirements of most target resources. If you use one of the default implementations, you only need to write the accompanying scripts and point your connector to their location. If the default implementations do not cover your target resource, you can use the Maven archetype to create a new connector project and write a custom Groovy-based connector from scratch.

The following list describes the default scripted connector implementations provided with the Groovy connector toolkit:

  • GROOVY - a basic non-pooled Groovy connector, provided in the org.forgerock.openicf.connectors.groovy.ScriptedConnector class.

    POOLABLEGROOVY - a poolable Groovy connector, provided in the org.forgerock.openicf.connectors.groovy.ScriptedPoolableConnector class.

When you have selected a scripted connector implementation, write the required scripts that correspond to that connector type. ICF operations with Groovy scripts provides information and examples on how to write scripts for the basic scripted connector implementation, and information on the extensions available for the other implementations.