Class AbstractScimClient<T>

java.lang.Object
gluu.scim2.client.AbstractScimClient<T>
Type Parameters:
T - The type of the internal RestEasy proxy used by this class. This is the same type that ScimClientFactory methods return.
All Implemented Interfaces:
CloseableClient, Serializable, InvocationHandler
Direct Known Subclasses:
OAuthScimClient, TestModeScimClient, UmaScimClient

public abstract class AbstractScimClient<T> extends Object implements CloseableClient, InvocationHandler, Serializable
The base class for specific SCIM clients.

Upon initialization, this class internally creates a RestEasy proxy client based on parameters passed. This proxy is used to invoke the operations the service offers. The exact methods that can be called are driven by the interface class passed in the constructor.

When a service method is invoked through an instance obtained by any of the factory methods of ScimClientFactory, the call is dispatched by the invoke method of this class, which properly handles the authorization details in conjunction with the filter AuthorizationInjectionFilter.

Concrete subclasses of this class must provide getAuthenticationHeader and authorize methods that must implement specific ways to obtain access tokens depending on how the SCIM service is being protected.

See Also:
  • Method Details

    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      This method is the single point of dispatch for any and all the requests made to the service. It takes care of requesting access tokens when necessary and make them available when requests are bound to be issued.

      As with all methods of this class and its subclasses, invoke is not called directly by developers: the calls are triggered when the objects returned by factory methods of ScimClientFactory are manipulated.

      Specified by:
      invoke in interface InvocationHandler
      Returns:
      The response associated to the invocation (normally a jakarta.ws.rs.core.Response instance)
      Throws:
      Throwable
    • close

      public void close()
      Specified by:
      close in interface CloseableClient
    • setCustomHeaders

      public void setCustomHeaders(jakarta.ws.rs.core.MultivaluedMap<String,String> headers)
      Specified by:
      setCustomHeaders in interface CloseableClient