Package org.yamcs.client.base
Class HttpClient
java.lang.Object
org.yamcs.client.base.HttpClient
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCookie
(io.netty.handler.codec.http.cookie.Cookie c) authorizeKerberos
(SpnegoInfo info) void
close()
CompletableFuture<byte[]>
doAsyncRequest
(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body) CompletableFuture<byte[]>
doAsyncRequest
(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, io.netty.handler.codec.http.HttpHeaders extraHeaders) doBulkReceiveRequest
(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, BulkRestDataReceiver receiver) Perform a request that potentially retrieves large amount of data.doBulkRequest
(String url, io.netty.handler.codec.http.HttpMethod httpMethod, String body, BulkRestDataReceiver receiver) doBulkSendRequest
(String url, io.netty.handler.codec.http.HttpMethod httpMethod) List<io.netty.handler.codec.http.cookie.Cookie>
boolean
void
void
loginWithAuthorizationCode
(String tokenUrl, String authorizationCode) void
setAcceptMediaType
(String acceptMediaType) void
setCaCertFile
(String caCertFile) In case of https connections, this file contains the CA certificates that are used to verify server certificatevoid
setCredentials
(Credentials credentials) void
setInsecureTls
(boolean insecureTls) if true and https connections are used, do not verify server certificatevoid
setMaxResponseLength
(int length) Sets the maximum size of the responses - this is not applicable to bulk requests whose response is practically unlimited and delivered piece by piecevoid
setSendMediaType
(String sendMediaType) void
setUserAgent
(String userAgent)
-
Field Details
-
MT_PROTOBUF
- See Also:
-
-
Constructor Details
-
HttpClient
public HttpClient()
-
-
Method Details
-
login
- Throws:
ClientException
-
loginWithAuthorizationCode
public void loginWithAuthorizationCode(String tokenUrl, String authorizationCode) throws ClientException - Throws:
ClientException
-
authorizeKerberos
- Throws:
ClientException
-
getCredentials
-
setCredentials
-
setUserAgent
-
doAsyncRequest
public CompletableFuture<byte[]> doAsyncRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body) throws ClientException, IOException, GeneralSecurityException -
doAsyncRequest
public CompletableFuture<byte[]> doAsyncRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, io.netty.handler.codec.http.HttpHeaders extraHeaders) throws ClientException, IOException, GeneralSecurityException -
doBulkSendRequest
public CompletableFuture<BulkRestDataSender> doBulkSendRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod) throws ClientException, IOException, GeneralSecurityException -
setMaxResponseLength
public void setMaxResponseLength(int length) Sets the maximum size of the responses - this is not applicable to bulk requests whose response is practically unlimited and delivered piece by piece- Parameters:
length
-
-
doBulkReceiveRequest
public CompletableFuture<Void> doBulkReceiveRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, byte[] body, BulkRestDataReceiver receiver) throws ClientException, IOException, GeneralSecurityException Perform a request that potentially retrieves large amount of data. The data is forwarded to the client.- Parameters:
receiver
- send all the data to this receiver. To find out when the request has been finished, the Future has to be used- Returns:
- a future indicating when the operation is completed.
- Throws:
GeneralSecurityException
IOException
ClientException
-
doBulkRequest
public CompletableFuture<Void> doBulkRequest(String url, io.netty.handler.codec.http.HttpMethod httpMethod, String body, BulkRestDataReceiver receiver) throws ClientException, IOException, GeneralSecurityException -
setCaCertFile
In case of https connections, this file contains the CA certificates that are used to verify server certificate- Parameters:
caCertFile
-- Throws:
IOException
GeneralSecurityException
-
isInsecureTls
public boolean isInsecureTls() -
setInsecureTls
public void setInsecureTls(boolean insecureTls) if true and https connections are used, do not verify server certificate- Parameters:
insecureTls
-
-
addCookie
public void addCookie(io.netty.handler.codec.http.cookie.Cookie c) -
getCookies
-
getSendMediaType
-
setSendMediaType
-
getAcceptMediaType
-
setAcceptMediaType
-
close
public void close()
-