Package com.evolveum.midpoint.smart.api
Interface ServiceClient
- All Superinterfaces:
AutoCloseable
Generic interface for a client that communicates with a remote service.
Can point to a real remote service or to a mock for testing purposes.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<REQ,RESP> RESP invoke(ServiceClient.Method method, REQ request, Class<RESP> responseClass) Invokes the specified method on the remote microservice (or on its substitution) with the given request.<REQ,RESP> CompletableFuture<RESP> invokeAsync(ServiceClient.Method method, REQ request, Class<RESP> responseClass) Asynchronously invokes the specified method on the remote microservice.
-
Method Details
-
invoke
<REQ,RESP> RESP invoke(ServiceClient.Method method, REQ request, Class<RESP> responseClass) throws SchemaException Invokes the specified method on the remote microservice (or on its substitution) with the given request.- Throws:
SchemaException
-
invokeAsync
<REQ,RESP> CompletableFuture<RESP> invokeAsync(ServiceClient.Method method, REQ request, Class<RESP> responseClass) Asynchronously invokes the specified method on the remote microservice. Returns a CompletableFuture that will complete with the response or exceptionally with SchemaException. -
close
void close()- Specified by:
closein interfaceAutoCloseable
-