Class ControllerTransport
- java.lang.Object
-
- com.linkedin.venice.controllerapi.ControllerTransport
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ControllerTransport extends java.lang.Object implements java.lang.AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description ControllerTransport(java.util.Optional<SSLFactory> sslFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T extends ControllerResponse>
TexecuteGet(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType)
<T extends ControllerResponse>
TexecuteGet(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType, int timeoutMs)
<T extends ControllerResponse>
TexecutePost(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType)
<T extends ControllerResponse>
TexecutePost(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType, int timeoutMs)
<T extends ControllerResponse>
TexecutePost(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType, int timeoutMs, byte[] data)
This method shoves the POST string query params into the URL so the body will only contain the byte array data to make processing/deserializing easier.protected <T extends ControllerResponse>
TexecuteRequest(org.apache.http.client.methods.HttpRequestBase request, java.lang.Class<T> responseType, int timeoutMs)
<T extends ControllerResponse>
Trequest(java.lang.String controllerUrl, ControllerRoute route, QueryParams params, java.lang.Class<T> responseType)
<T extends ControllerResponse>
Trequest(java.lang.String controllerUrl, ControllerRoute route, QueryParams params, java.lang.Class<T> responseType, int timeoutMs, byte[] data)
-
-
-
Constructor Detail
-
ControllerTransport
public ControllerTransport(java.util.Optional<SSLFactory> sslFactory)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
request
public <T extends ControllerResponse> T request(java.lang.String controllerUrl, ControllerRoute route, QueryParams params, java.lang.Class<T> responseType) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
request
public <T extends ControllerResponse> T request(java.lang.String controllerUrl, ControllerRoute route, QueryParams params, java.lang.Class<T> responseType, int timeoutMs, byte[] data) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
executeGet
public <T extends ControllerResponse> T executeGet(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
executeGet
public <T extends ControllerResponse> T executeGet(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType, int timeoutMs) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
executePost
public <T extends ControllerResponse> T executePost(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
executePost
public <T extends ControllerResponse> T executePost(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType, int timeoutMs) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
executePost
public <T extends ControllerResponse> T executePost(java.lang.String controllerUrl, java.lang.String path, QueryParams params, java.lang.Class<T> responseType, int timeoutMs, byte[] data) throws java.util.concurrent.TimeoutException, java.util.concurrent.ExecutionException
This method shoves the POST string query params into the URL so the body will only contain the byte array data to make processing/deserializing easier. Please make sure the query params doesn't exceed the URL limit of 2048 chars.- Throws:
java.util.concurrent.TimeoutException
java.util.concurrent.ExecutionException
-
executeRequest
protected <T extends ControllerResponse> T executeRequest(org.apache.http.client.methods.HttpRequestBase request, java.lang.Class<T> responseType, int timeoutMs) throws java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Throws:
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
-