Package net.hexonet.apiconnector
Class APIClient
java.lang.Object
net.hexonet.apiconnector.APIClient
APIClient is the entry point class for communicating with the insanely fast HEXONET backend api.
It allows two ways of communication:
- session based communication
- sessionless communication
- Since:
- 2.0
- Version:
- %I%, %G%
- Author:
- Kai Schwarz
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDisable Debug OutputEnable Debug OutputgetPOSTData
(Map<String, String> cmd) Method to use to encode data before sending it to the API ServergetPOSTData
(Map<String, String> cmd, boolean secured) Method to use to encode data before sending it to the API servergetProxy()
Get proxy configuration for API communicationGet the configured Referer Header ValueGet the API Session that is currently setgetURL()
Get the API connection url that is currently setGet the user agent stringGet the current module versionlogin()
Perform API login to start session-based communicationPerform API login to start session-based communicationloginExtended
(Map<String, String> params) Perform API login to start session-based communication.loginExtended
(Map<String, String> params, String otp) Perform API login to start session-based communication.logout()
Perform API logout to close API session in usePerform API request using the given commandRequest all pages/entries for the given query commandRequest the next page of list entries for the current list query Useful for tablesReset data view back from subuser to userreuseSession
(Map<String, Object> session) Use existing configuration out of ClientRequest session to rebuild and reuse connection settingssaveSession
(Map<String, Object> session) Apply session data (session id and system entity) to given client request sessionsetCredentials
(String uid, String pw) Set Credentials to be used for API communicationsetCustomLogger
(Logger logger) Set a custom logger for debug mdoeActivate the default logger for debug modeSet one time password to be used for API communicationSet proxy to use for API communicationsetReferer
(String referer) Set Referer Header to use for API communicationsetRemoteIPAddress
(String value) Set an Remote IP Address to be used for API communication To be used in case you have an active ip filter setting.setRoleCredentials
(String uid, String role, String pw) Set Credentials to be used for API communicationsetSession
(String value) Set an API session id to be used for API communicationSet another connection url to be used for API communicationsetUserAgent
(String str, String rv) Set a custom user agent header (useful for tools that use our SDK)setUserAgent
(String str, String rv, ArrayList<String> modules) Set a custom user agent header (useful for tools that use our SDK)setUserView
(String uid) Set a data view to a given subuserActivate Default Connection SetupActivate High Performance Connection Setup (see README.md)Set LIVE System for API communication (this is the default setting)Set OT&E System for API communication
-
Field Details
-
ISPAPI_CONNECTION_URL_PROXY
high performance proxy setup API endpoint url- See Also:
-
ISPAPI_CONNECTION_URL_LIVE
common API endpoint url production environment- See Also:
-
ISPAPI_CONNECTION_URL_OTE
common API endpoint url OTE environment- See Also:
-
-
Constructor Details
-
APIClient
public APIClient()Class constructor. Creates an API Client ready to use.
-
-
Method Details
-
setCustomLogger
-
setDefaultLogger
Activate the default logger for debug mode- Returns:
- Current APIClient instance for method chaining
-
enableDebugMode
Enable Debug Output- Returns:
- Current APIClient instance for method chaining
-
disableDebugMode
Disable Debug Output- Returns:
- Current APIClient instance for method chaining
-
getPOSTData
-
getPOSTData
-
getSession
-
getURL
Get the API connection url that is currently set- Returns:
- API connection url currently in use
-
setUserAgent
-
setUserAgent
Set a custom user agent header (useful for tools that use our SDK)- Parameters:
str
- user agent labelrv
- user agent revisionmodules
- further modules to add to user agent string ["module/version"]- Returns:
- Current APIClient instance for method chaining
-
getUserAgent
-
setProxy
-
getProxy
Get proxy configuration for API communication- Returns:
- Proxy URL or null if not configured
-
setReferer
-
getReferer
-
getVersion
-
saveSession
-
reuseSession
-
setURL
-
setOTP
-
setSession
-
setRemoteIPAddress
-
setCredentials
-
setRoleCredentials
-
login
-
login
Perform API login to start session-based communication- Returns:
- API Response
-
loginExtended
-
loginExtended
-
logout
-
request
-
requestNextResponsePage
-
requestAllResponsePages
-
setUserView
-
resetUserView
Reset data view back from subuser to user- Returns:
- Current APIClient instance for method chaining
-
useHighPerformanceConnectionSetup
Activate High Performance Connection Setup (see README.md)- Returns:
- Current APIClient instance for method chaining
-
useDefaultConnectionSetup
Activate Default Connection Setup- Returns:
- Current APIClient instance for method chaining
-
useOTESystem
Set OT&E System for API communication- Returns:
- Current APIClient instance for method chaining
-
useLIVESystem
Set LIVE System for API communication (this is the default setting)- Returns:
- Current APIClient instance for method chaining
-