Package com.jk.services.client
Interface JKServiceCaller
- All Known Implementing Classes:
JKFileDownloadServiceCaller
public interface JKServiceCaller
This interface defines the contract for classes that handle making HTTP
service calls.
Implementations of this interface are responsible for constructing HTTP requests, sending them to a remote service, and processing the responses.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
call
(jakarta.ws.rs.client.Invocation.Builder builder) This method makes an HTTP service call using the provided builder to construct the request.default String
This method gets the media type that the service caller expects in the response.default Object
readResponse
(jakarta.ws.rs.core.Response response) This method reads and processes the response received from the service.
-
Method Details
-
call
jakarta.ws.rs.core.Response call(jakarta.ws.rs.client.Invocation.Builder builder) This method makes an HTTP service call using the provided builder to construct the request.- Parameters:
builder
- Specifies the builder used to construct the HTTP request.- Returns:
- the HTTP response received from the service.
-
readResponse
This method reads and processes the response received from the service.- Parameters:
response
- Specifies the HTTP response received from the service.- Returns:
- an object representing the processed response data.
-
getAcceptMedia
This method gets the media type that the service caller expects in the response.- Returns:
- the media type expected in the response.
-