Groovy Connector Toolkit
OpenICF provides a generic Groovy Connector Toolkit that enables you to run a Groovy script for any OpenICF operation, such as search, update, create, and others, on 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 implementation. Specific scripts are provided within these samples, which demonstrate how the Groovy Connector Toolkit can be used. These scripts cannot be used as is in your deployment, but are a good starting point on which to base your customization.
Groovy Connector Toolkit
The Groovy Connector Toolkit is bundled with OpenIDM 6.2, in the JAR openidm/connectors/groovy-connector-1.4.2.1.jar.
Sample implementations are provided in "Samples That Use the Groovy Connector Toolkit to Create Scripted Connectors" in the Samples Guide.
OpenICF Interfaces Implemented by the Scripted Groovy Connector
The Scripted Groovy Connector implements the following OpenICF interfaces.
- Authenticate
-
Provides simple authentication with two parameters, presumed to be a user name and password.
- Create
-
Creates an object and its
uid. - Delete
-
Deletes an object, referenced by its
uid. - Resolve Username
-
Resolves an object by its username and returns the
uidof the object. - Schema
-
Describes the object types, operations, and options that the connector supports.
- Script on Connector
-
Enables an application to run a script in the context of the connector. Any script that runs on the connector has the following characteristics:
-
The script runs in the same execution environment as the connector and has access to all the classes to which the connector has access.
-
The script has access to a
connectorvariable that is equivalent to an initialized instance of the connector. At a minimum, the script can access the connector configuration. -
The script has access to any script-arguments passed in by the application.
-
- Script on Resource
-
Runs a script on the target resource that is managed by this connector.
- Search
-
Searches the target resource for all objects that match the specified object class and filter.
- Sync
-
Polls the target resource for synchronization events, that is, native changes to objects on the target resource.
- Test
-
Tests the connector configuration. Testing a configuration checks all elements of the environment that are referred to by the configuration are available. For example, the connector might make a physical connection to a host that is specified in the configuration to verify that it exists and that the credentials that are specified in the configuration are valid.
This operation might need to connect to a resource, and, as such, might take some time. Do not invoke this operation too often, such as before every provisioning operation. The test operation is not intended to check that the connector is alive (that is, that its physical connection to the resource has not timed out).
You can invoke the test operation before a connector configuration has been validated.
- Update
-
Updates (modifies or replaces) objects on a target resource.
Scripted Groovy Connector Configuration
The Scripted Groovy Connector has the following configurable properties.
Operation Script Files Properties
| Property | Type | Default | Encrypted | Required |
|---|---|---|---|---|
|
|
|
||
The name of the file used to perform the AUTHENTICATE operation. |
||||
|
|
|
||
The name of the file used to perform the DELETE operation. |
||||
|
|
|
||
The name of the file used to perform the SCHEMA operation. |
||||
|
|
|
No |
|
The script used to customize some function of the connector. Read the documentation for more details. |
||||
|
|
|
||
The name of the file used to perform the RESOLVE_USERNAME operation. |
||||
|
|
|
||
The name of the file used to perform the TEST operation. |
||||
|
|
|
||
The name of the file used to perform the UPDATE operation. |
||||
|
|
|
||
The name of the file used to perform the SEARCH operation. |
||||
|
|
|
||
The name of the file used to perform the RUNSCRIPTONRESOURCE operation. |
||||
|
|
|
||
The name of the file used to perform the CREATE operation. |
||||
|
|
|
||
The name of the file used to perform the SYNC operation |
||||
Groovy Engine configuration Properties
| Property | Type | Default | Encrypted | Required |
|---|---|---|---|---|
|
|
|
No |
|
Warning Level of the compiler |
||||
|
|
|
No |
|
Sets the minimum of time after a script can be recompiled. |
||||
|
|
|
Yes |
|
The root folder to load the scripts from. If the value is null or empty the classpath value is used. |
||||
|
|
|
No |
|
If true, debugging code should be activated |
||||
|
|
|
No |
|
Directory into which to write classes. |
||||
|
|
|
No |
|
Sets a list of global AST transformations which should not be loaded even if they are defined in |
||||
|
|
|
No |
|
Classpath for use during compilation. |
||||
|
|
|
No |
|
Script extensions |
||||
|
|
|
No |
|
Encoding for source files |
||||
|
|
|
No |
|
Base class name for scripts (must derive from Script) |
||||
|
|
|
No |
|
If true, the compiler should produce action information |
||||
|
|
|
No |
|
If set to true recompilation is enabled |
||||
|
|
|
No |
|
The error tolerance, which is the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted |
||||