Class APIClient
java.lang.Object
com.centralnicreseller.apiconnector.APIClient
APIClient is the entry point class for communicating with the insanely fast
CentralNic Reseller (fka RRPProxy) backend api. It allows two ways of
communication:
- session based communication
- sessionless communication
- Since:
- 2.0
- Version:
- %I%, %G%
- Author:
- Team Internet Group PLC
-
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 ValuegetURL()
Get the API connection url that is currently setGet the user agent stringGet the current module versionlogin()
Perform API login to start session-based communicationlogout()
Perform API logout to close API session in usePerform API request using the given commandPerform 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) Set Credentials to be used for API communicationsetCredentials
(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 an API user idSet one time password to be used for API communicationSet proxy to use for API communicationsetReferer
(String referer) Set Referer Header to use for API communicationsetRoleCredentials
(String uid, String role) Set Credentials to be used for API communicationsetRoleCredentials
(String uid, String role, String pw) Set Credentials 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 SetupSet LIVE System for API communication (this is the default setting)Set OT&E System for API communication
-
Field Details
-
CNR_CONNECTION_URL_PROXY
high performance proxy setup API endpoint url- See Also:
-
CNR_CONNECTION_URL_LIVE
common API endpoint url production environment- See Also:
-
CNR_CONNECTION_URL_OTE
-
-
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
-
getURL
Get the API connection url that is currently set- Returns:
- API connection url currently in use
-
setPersistent
Set one time password to be used for API communication- Returns:
- Current APIClient instance for method chaining
-
setLogin
-
saveSession
-
reuseSession
-
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
-
setURL
-
setCredentials
-
setCredentials
-
setRoleCredentials
-
setRoleCredentials
-
login
Perform API login to start session-based communication- Returns:
- API Response
-
logout
-
request
-
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- 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
-