Class AbstractScimClient<T>
- java.lang.Object
-
- io.jans.scim2.client.AbstractScimClient<T>
-
- Type Parameters:
T
- The type of the internal RestEasy proxy used by this class. This is the same type thatScimClientFactory
methods return.
- All Implemented Interfaces:
CloseableClient
,Serializable
,InvocationHandler
- Direct Known Subclasses:
ScimClient
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 theinvoke
method of this class, which properly handles the authorization details in conjunction with the filterAuthorizationInjectionFilter
.Concrete subclasses of this class must provide
getAuthenticationHeader
andauthorize
methods that must implement specific ways to obtain access tokens depending on how the SCIM service is being protected.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Object
invoke(Object proxy, Method method, Object[] args)
This method is the single point of dispatch for any and all the requests made to the service.void
setCustomHeaders(jakarta.ws.rs.core.MultivaluedMap<String,String> headers)
-
-
-
Method Detail
-
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 interfaceInvocationHandler
- 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 interfaceCloseableClient
-
setCustomHeaders
public void setCustomHeaders(jakarta.ws.rs.core.MultivaluedMap<String,String> headers)
- Specified by:
setCustomHeaders
in interfaceCloseableClient
-
-