Introducing the ICF Architecture

16-4 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager ConnectorInfoManager cInfoManager = cInfoManagerFactory.getLocalManagerbundleURL;

16.2.3 The ConnectorKey Class

A ConnectorKey uniquely identifies a Connector instance within an installation. The ConnectorKey class takes a bundleName name of the Connector bundle, a bundleVersion version of the Connector bundle and a connectorName name of the Connector bundle as illustrated in Example 16–3 . Example 16–3 ConnectorKey Implementation get the ConnectorKey reference ConnectorKey flatFileConnectorKey = new ConnectorKeybundleName, bundleVersion, connectorName;

16.2.4 The ConnectorInfo Interface

The ConnectorInfo interface contains information about a specific identity connector. It contains the display name, key and message details regarding the particular identity connector. Example 16–4 illustrates how to implement the ConnectorInfo. Example 16–4 ConnectorInfo Implementation get the ConnectorInfo ConnectorInfo info = cInfoManager.findConnectorInfoflatFileConnectorKey; In the example, cInfoManager is the ConnectorInfoManager and flatFileConnectorKey is the identity connector key.

16.2.5 The APIConfiguration Interface

The APIConfiguration interface shows the configuration properties from both the SPI and the API sides. The getConfigurationProperties method returns a ConfigurationProperties instance based on the connector Configuration implementation, initialized to the defaults. Caller can then modify the properties, as required. Example 16–5 illustrates this. Example 16–5 APIConfiguration Definition APIConfiguration apiConfig = info.createDefaultAPIConfiguration;

16.2.6 The ConfigurationProperties Interface

The ConfigurationProperties interface encapsulates the SPI Configuration and uses reflection to identify the individual properties that are available for an application to manipulate. Set all of the identity connectors configuration properties using the setPropertyValue method as defined in Example 16–6 . Example 16–6 setPropertyValue Method Signature public void setPropertyValue java.lang.String name, java.lang.Object value Understanding the Identity Connector Framework 16-5 Example 16–7 illustrates an implementation of the ConfigurationProperties inteface. Example 16–7 ConfigurationProperties Implementation get the default APIConfiguration ConfigurationProperties flatFileConfigProps = apiConfig.getConfigurationProperties;

16.2.7 The ConnectorFacadeFactory Class

The ConnectorFacadeFactory class allows an application to get a Connector instance and to manage a pool of Connector instances. Example 16–8 illustrates the ConnectorFacadeFactory definition. Example 16–8 ConnectorFacadeFactory Definition get a reference to ConnectorFacadeFactory ConnectorFacadeFactory facadeFactory = ConnectorFacadeFactory.getinstance;

16.2.8 The ConnectorFacade Interface

The ConnectorFacade interface is used by the target system to invoke identity connector operations by representing a specific identity connector on the API side. Example 16–9 illustrates the ConnectorFacade implementation. Example 16–9 ConnectorFacade Implementation create a ConnectorFacade nothing but a reference to Connector on SPI side ConnectorFacade connectorFacade = facadeFactory.newInstanceapiConfig

16.3 Introducing the ICF SPI

Developers implement the ICF SPI to create identity connectors. The ICF SPI is made up of many interfaces but the developer need only implement those supported by the target system. SPI can again be classified into required, operation, and feature-based interfaces. Required interfaces must be implemented irrespective of the operations supported and they help to create the connector and maintain the connection with the target system, while operation interfaces help the connector to support various operations. Feature-based interfaces support certain features supported by the ICF. The following sections have more information. ■ Implementing the Required Interfaces ■ Implementing the Feature-based Interfaces ■ Implementing the Operation Interfaces ■ Common Classes

16.3.1 Implementing the Required Interfaces

All identity connectors are required to provide an implementation of two interfaces. These two interfaces declare and initialize the identity connector with the target system. The following sections have more information. 16-6 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager ■ org.identityconnectors.framework.spi.Connector ■ org.identityconnectors.framework.spi.Configuration

16.3.1.1 org.identityconnectors.framework.spi.Connector

This is the main interface to declare an identity connector. Many connectors create the connection to the target system when the connection is required, removing the connection when finished with it, and disposing of any resources it has used. The interface provides the init and dispose life cycle methods for this purpose. Every connector implementation must be annotated with ConnectorClass. This is required because the ICF would scan all top level .class files in the connector bundle looking for classes that have the ConnectorClass annotation, therefore, autodiscovering connectors that are defined in the bundle. This annotation requires the following elements: ■ configurationClass: This is the configuration class for this connector. This class has all the information about the target that can be used by the connector to connect and perform various provisioning and reconciliation operations. See section org.identityconnectors.framework.spi.Configuration on page 16-8 for more information on how to implement the configuration class. ■ displayNameKey: Display name key that must be present in the message catalog. Example 16–10 is a sample connector implementation. Example 16–10 Flat File Connector Implementation Flat file connector implementation. This connector supports create, delete, search and update operations. ConnectorClass configurationClass=FlatFileConfigurationImpl.class, displayNameKey=FLAT_FILE_CONNECTOR public class FlatFileConnector implements Connector, CreateOp, DeleteOp,SearchOpMapString, String,UpdateOp{ In Example 16–10 : ■ CreateOp: Helps the connector to create an entity on the target system ■ DeleteOp: Helps the connector to delete an entity on the target system ■ SearchOp: Helps the connector to search an entity on the target system ■ UpdateOp: Helps the connector to update an existing entity on the target system See Implementing the Operation Interfaces on page 16-12 for more information. The following sections contain information and sample code that illustrates how you might implement the Connector methods. For complete code regarding a Connector implementation, see Developing a Flat File Connector on page 17-1. Note: Connector implementations must be annotated with type org.identityconnectors.framework.spi.ConnectorClass by providing the configurationClass and displayNameKey information. The displayNameKey must be a key defined in the Messages.properties file.