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. Rather, it is a framework within which you must write your own Groovy scripts to address the requirements of your deployment. The toolkit is bundled with Identity Cloud in the JAR openidm/connectors/groovy-connector-1.5.20.2.jar.

Identity Cloud 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 on which to base your customization.

The Groovy Connector Toolkit can be used with any ICF-enabled project (that is, any project in which the ForgeRock Open Connector Framework 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 should address the requirements of most target resources. If you use one of the default implementations, you need only write the accompanying scripts and point your connector to their location. If your target resource is not covered by the default implementations, 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.