Package org.yamcs.client.base
Class HttpClient
java.lang.Object
org.yamcs.client.base.HttpClient
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCookie(io.netty.handler.codec.http.cookie.Cookie c) authorizeKerberos(SpnegoInfo info) voidclose()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>booleanvoidvoidloginWithAuthorizationCode(String tokenUrl, String authorizationCode) voidsetAcceptMediaType(String acceptMediaType) voidsetCaCertFile(String caCertFile) In case of https connections, this file contains the CA certificates that are used to verify server certificatevoidsetCredentials(Credentials credentials) voidsetInsecureTls(boolean insecureTls) if true and https connections are used, do not verify server certificatevoidsetMaxResponseLength(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 piecevoidsetSendMediaType(String sendMediaType) voidsetUserAgent(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:
GeneralSecurityExceptionIOExceptionClientException
-
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:
IOExceptionGeneralSecurityException
-
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()
-