Class AbstractClient
java.lang.Object
com.bluebell.greenhouse.sol.client.AbstractClient
- All Implemented Interfaces:
GetClient, PostClient
- Direct Known Subclasses:
ArticleMetadataClient, EODIntegrationClient, FirstRateDataIntegrationClient, ForexFactoryIntegrationClient, OpenAIIntegrationClient, SymbolAnalysisIntegrationClient
Parent-level client logic.
- Version:
- 2.0.3
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPerforms an HTTP GET request for the given url & request parameters.doGet(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, int timeoutMs) Performs an HTTP GET request for the given url & request parameters using the supplied timeout.doGet(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.http.HttpHeaders headers, int timeoutMs, int maxBodySizeBytes) Performs an HTTP GET request for the given url, headers & request parameters.doGet(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.http.HttpHeaders headers, int timeoutMs, int maxBodySizeBytes, boolean ignoreCookies) Performs an HTTP GET request for the given url, headers & request parameters.protected IntegrationHttpResponsedoGetResponse(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, int timeoutMs) Performs an HTTP GET request for the given url and returns response metadata.doPost(String endpoint, org.springframework.http.HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> queryParams, String body) Performs an HTTP POST request for the given url, headers, query params and body.doPost(String endpoint, org.springframework.http.HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> queryParams, String body, int timeoutMs) Performs an HTTP POST request for the given url, headers, query params and body using the supplied timeout.downloadFile(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, String fileName) Performs an HTTP GET request to download a file at the given endpoint.
-
Constructor Details
-
AbstractClient
public AbstractClient()
-
-
Method Details
-
doGet
-
doGet
-
doGetResponse
protected IntegrationHttpResponse doGetResponse(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, int timeoutMs) Performs an HTTP GET request for the given url and returns response metadata.- Parameters:
endpoint- endpoint urlqueryParams- query paramstimeoutMs- request timeout in milliseconds- Returns:
IntegrationHttpResponse
-
doGet
public String doGet(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.http.HttpHeaders headers, int timeoutMs, int maxBodySizeBytes) Performs an HTTP GET request for the given url, headers & request parameters.- Parameters:
endpoint- endpoint urlqueryParams- query paramsheaders- request headerstimeoutMs- request timeout in millisecondsmaxBodySizeBytes- maximum response body size in bytes- Returns:
- JSON string
-
doGet
public String doGet(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, org.springframework.http.HttpHeaders headers, int timeoutMs, int maxBodySizeBytes, boolean ignoreCookies) Performs an HTTP GET request for the given url, headers & request parameters.- Parameters:
endpoint- endpoint urlqueryParams- query paramsheaders- request headerstimeoutMs- request timeout in millisecondsmaxBodySizeBytes- maximum response body size in bytesignoreCookies- flag to disable cookie processing- Returns:
- JSON string
-
doPost
public String doPost(String endpoint, org.springframework.http.HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> queryParams, String body) Performs an HTTP POST request for the given url, headers, query params and body.- Specified by:
doPostin interfacePostClient- Parameters:
endpoint- endpoint urlheaders- request headersqueryParams- query paramsbody- request body- Returns:
- response body
-
doPost
public String doPost(String endpoint, org.springframework.http.HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> queryParams, String body, int timeoutMs) Performs an HTTP POST request for the given url, headers, query params and body using the supplied timeout.- Specified by:
doPostin interfacePostClient- Parameters:
endpoint- endpoint urlheaders- request headersqueryParams- query paramsbody- request bodytimeoutMs- request timeout in milliseconds- Returns:
- response body
-
downloadFile
public File downloadFile(String endpoint, org.springframework.util.MultiValueMap<String, String> queryParams, String fileName) Performs an HTTP GET request to download a file at the given endpoint.- Specified by:
downloadFilein interfaceGetClient- Parameters:
endpoint- endpointqueryParams- query paramsfileName- file to save- Returns:
File
-