java.lang.Object
org.forgerock.openig.fapi.apiclient.service.idm.IdmService

public class IdmService extends Object
The IdmService supports making REST API calls to an IDM instance.

This service provides the base endpoint URI of the IDM instance and known endpoint URIs for particular APIs (such as managed objects), as well as a Handler to make requests to the IDM instance. The endpointHandler should be configured to correctly obtain required IDM authorization (e.g. an access_token).

URIs returned by this service are guaranteed to end with a slash, allowing additional path elements to be added using the URI.resolve(String) method.

 {
      "type": "IdmService",
      "config": {
         "baseEndpoint"      : Config Expression<URI> [REQUIRED - The base URI of the IDM instance to use.]
         "endpointHandler"   : Handler                [REQUIRED - The Handler to use to make requests on the
                                                                  managed objects endpoints.]
      }
 }
 
 
The example configuration below illustrates IDM service config:
 {
     "name" : "IdmService",
     "type" : "IdmService",
     "config" : {
       "baseEndpoint" : "https://&{idmHost}/openidm/",
       "endpointHandler" : "IdmEndpointHandler"
     }
 }
 
 
  • Method Details

    • getBaseEndpoint

      public URI getBaseEndpoint()
      Get the base endpoint URI of the IDM instance. Note: the URI is guaranteed to end with a slash.
      Returns:
      the base endpoint URI
    • getManagedObjectsEndpoint

      public URI getManagedObjectsEndpoint()
      Get the managed objects endpoint URI. Note: the URI is guaranteed to end with a slash.
      Returns:
      the managed objects endpoint URI
    • send

      public Promise<Response,NeverThrowsException> send(Context context, Request request)
      Send a request to IDM using the endpointHandler configured for this service.
      Parameters:
      context - the request context
      request - the request to send
      Returns:
      A Promise representing the response to be returned to the caller.