Package cloud.metaapi.sdk.clients
Class MetaApiClient
- java.lang.Object
-
- cloud.metaapi.sdk.clients.MetaApiClient
-
- Direct Known Subclasses:
ConfigurationClient,HistoryClient,MetatraderAccountClient,ProvisioningProfileClient,TradingClient
public class MetaApiClient extends Object
metaapi.cloud MetaTrader API client
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringhostprotected HttpClienthttpClientprotected Stringtoken
-
Constructor Summary
Constructors Constructor Description MetaApiClient(HttpClient httpClient, String token)Constructs MetaTrader API client instance.MetaApiClient(HttpClient httpClient, String token, String domain)Constructs MetaTrader API client instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetTokenType()Returns type of current tokenprotected <T> CompletableFuture<T>handleNoAccessError(String methodName)Handles no accessing to the methodprotected booleanisNotAccountToken()Checks that current token is not account tokenprotected booleanisNotJwtToken()Checks that current token is not api token
-
-
-
Field Detail
-
httpClient
protected HttpClient httpClient
-
host
protected String host
-
token
protected String token
-
-
Constructor Detail
-
MetaApiClient
public MetaApiClient(HttpClient httpClient, String token)
Constructs MetaTrader API client instance. Domain is set toagiliumtrade.agiliumtrade.ai- Parameters:
httpClient- HTTP clienttoken- authorization token
-
MetaApiClient
public MetaApiClient(HttpClient httpClient, String token, String domain)
Constructs MetaTrader API client instance- Parameters:
httpClient- HTTP clienttoken- authorization tokendomain- domain to connect to
-
-
Method Detail
-
getTokenType
protected String getTokenType()
Returns type of current token- Returns:
- Type of current token
-
isNotJwtToken
protected boolean isNotJwtToken()
Checks that current token is not api token- Returns:
- Indicator of absence api token
-
isNotAccountToken
protected boolean isNotAccountToken()
Checks that current token is not account token- Returns:
- Indicator of absence account token
-
handleNoAccessError
protected <T> CompletableFuture<T> handleNoAccessError(String methodName)
Handles no accessing to the method- Parameters:
methodName- Name of method
-
-