Package org.ojalgo.netio
Class ServiceClient.Response<T>
- java.lang.Object
-
- org.ojalgo.netio.ServiceClient.Response<T>
-
- All Implemented Interfaces:
BasicLogger.Printable
- Enclosing class:
- ServiceClient
public static final class ServiceClient.Response<T> extends java.lang.Object implements BasicLogger.Printable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>>
myFutureResponse
private ServiceClient.Session
mySession
-
Constructor Summary
Constructors Constructor Description Response(ServiceClient.Request request, java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel()
boolean
equals(java.lang.Object obj)
T
getBody()
java.net.http.HttpHeaders
getHeaders()
java.util.Optional<java.net.http.HttpResponse<T>>
getPreviousResponse()
java.net.http.HttpRequest
getRequest()
Will recreate the request that resulted in the final response.(package private) java.net.http.HttpResponse<T>
getResponse()
int
getStatusCode()
java.net.URI
getURI()
int
hashCode()
boolean
isDone()
boolean
isResponseOK()
void
print(BasicLogger receiver)
java.lang.String
toString()
-
-
-
Field Detail
-
myFutureResponse
private final java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> myFutureResponse
-
mySession
private final ServiceClient.Session mySession
-
-
Constructor Detail
-
Response
Response(ServiceClient.Request request, java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> response)
-
-
Method Detail
-
cancel
public boolean cancel()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getBody
public T getBody()
-
getHeaders
public java.net.http.HttpHeaders getHeaders()
-
getPreviousResponse
public java.util.Optional<java.net.http.HttpResponse<T>> getPreviousResponse()
-
getRequest
public java.net.http.HttpRequest getRequest()
Will recreate the request that resulted in the final response. If there has been one or more redirects, then this is NOT the same as the original request.
-
getStatusCode
public int getStatusCode()
- Returns:
- The http response status code, or -1 if this is not http/hhtps or if the code cannot be discerned from the response
-
getURI
public java.net.URI getURI()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isDone
public boolean isDone()
-
isResponseOK
public boolean isResponseOK()
- Returns:
- true if the status (response) code is in [200,300)
-
print
public void print(BasicLogger receiver)
- Specified by:
print
in interfaceBasicLogger.Printable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getResponse
java.net.http.HttpResponse<T> getResponse()
-
-