Importing Generic Technology Connectors

Creating and Managing Generic Technology Connectors 21-41 Note the following: ■ Updating the ITResource parameters from the Design Console does not refresh the pool. Update values through the Administrative and User Console or through the APIs. ■ Avoid updating values when the pool is in use.

21.4.3 Getting and Releasing Connections from the Pool

Consumers of the Generic Connection Pool can invoke the ConnectionService to get pooled connections to the target, and also to return connections back to the pool. This example code gets a connection from the pool and returns it based on ITResource Name: import com.oracle.oim.gcp.exceptions.ConnectionServiceException; import com.oracle.oim.gcp.pool.ConnectionService; import com.oracle.oim.gcp.resourceconnection.ResourceConnection; public class ConnectionPoolClient { public void testConnectionString itResName { try{ Request for connection from the connection pool ConnectionService service = new ConnectionService; ResourceConnection myConnection = service.getConnectionitResName; myConnection is the connection use the connection... Release connection back to the connection pool Target supports only one connection Denotes whether the target system supports only one connection at a time. When set to true, irrespective of other properties, the following pool parameters are used: ■ Min Pool Size = 0 ■ Initial Pool Size = 0 ■ Max Pool Size = 1 Recommended default is false true if target can handle only one connection, false otherwise. ResourceConnection class definition The concrete implementation of the ResourceConnection class com.oracle.oim.ad.ADResourceCo nnectionImpl Native connection pool class definition The wrapper to the native pool mechanism that implements the GenericPool. Set a value only if the pool preference is set to Native. com.oracle.oim.ad.ADNativePool Pool excluded fields Comma-separated list of fields not needed for creating a connection. When any of the specified fields are updated, the GCP pool is not refreshed. Note: Fields in this list are not available as part of the HashMap parameter to the createConnection method. Recon TimeStamp,ADSync Enabled Table 21–6 Cont. ITResource Parameters Field Description Sample Value and Notes 21-42 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager Connections should always be returned this way. service.releaseConnectionmyConnection; } catchConnectionServiceException e { handle } } You can also request connections to the target using ITResource Key. Here is an example: ConnectionService service = new ConnectionService; ResourceConnection myConnection = service.getConnectionitResourceKey;

21.4.4 Using a Third-party Pool

As mentioned earlier in the section, you can use any third-party pool for your custom connector. However, in addition to the steps described earlier, you must provide a concrete implementation of the GenericPool interface as a wrapper to the third-party pool. Table 21–7 lists the methods invoked for the GenericPool interface:

21.4.5 Example: Implementation of ResourceConnection

This example demonstrates an implementation of the ResourceConnection interface. Key methods are highlighted. Example 21–1 An Example of ResourceConnection Implementation Sample implementation for Socket Connections: import java.io.IOException; Note: It If the custom connector does not wish to use the UCP pool, it can choose to use GCP with the Native option, though there are no significant advantages to this. With the Native pool preference, the responsibility of maintaining and implementing the pool rests with the custom connector. Table 21–7 Methods of the GenericPool Interface Method Purpose initializePoolPoolConfiguration poolConfig To initialize the pool. The PoolConfiguration data object contains all pool-related parameters. borrowConnectionFromPool To request a connection. returnConnectionToPoolResourc eConnection resConn To return a connection to the pool. refreshPoolPoolConfiguration newPoolConfig To refresh the pool with updated values. destroyPool To remove the pool for example when ITResource is deleted.