public class ClientCredentialsConnection extends Object implements ADPAPIConnection
| Modifier and Type | Field and Description |
|---|---|
private ConnectionConfiguration |
connectionConfiguration |
private String |
errorResponse |
private boolean |
isConnectionAlive |
private static Logger |
LOGGER |
private Token |
token |
private double |
tokenTimeTracker |
| Modifier | Constructor and Description |
|---|---|
private |
ClientCredentialsConnection()
constructor
|
|
ClientCredentialsConnection(ConnectionConfiguration connectionConfiguration)
constructor sets configuration to this connection
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Initiates a connect request to ADP Authorization Server on the type of
connection configuration.
|
void |
disconnect()
Invokes API to disconnect the connection - currently this method is implemented
to reset the connection to null.
|
ConnectionConfiguration |
getConnectionConfiguration()
Returns the Connection configuration
|
String |
getErrorResponse()
Returns errors
|
Token |
getToken()
Returns the token on this connection
|
boolean |
isConnectionIndicator()
Returns true or false based on the validation or access token.
|
private boolean |
isValidToken()
Returns true if token is still valid since issued based on delta of
current time and token time tracker that has the token expired time
|
void |
setConnectionConfiguration(ConnectionConfiguration connectionConfiguration)
Maps the connection configuration
AuthorizationCodeConfiguration
to this connection |
void |
setErrorResponse(String errorResponse) |
void |
setToken(Token token) |
private static final Logger LOGGER
private String errorResponse
private boolean isConnectionAlive
private double tokenTimeTracker
private ConnectionConfiguration connectionConfiguration
private Token token
private ClientCredentialsConnection()
public ClientCredentialsConnection(ConnectionConfiguration connectionConfiguration)
public void connect()
throws ConnectionException
Token is mapped with this connection. In case of error,
connection exceptions are thrown or error details are returnedconnect in interface ADPAPIConnectionConnectionException - exception thrown when validation fails on
configuration and connectionpublic void disconnect()
throws ConnectionException
disconnect in interface ADPAPIConnectionConnectionException - throws exceptions in the event of objectpublic boolean isConnectionIndicator()
isConnectionIndicator in interface ADPAPIConnectionpublic ConnectionConfiguration getConnectionConfiguration()
public void setConnectionConfiguration(ConnectionConfiguration connectionConfiguration)
AuthorizationCodeConfiguration
to this connectionconnectionConfiguration - maps ClientCredentialsCodeConfiguration to
this connection configurationpublic Token getToken()
getToken in interface ADPAPIConnectionTokenpublic void setToken(Token token)
token - sets token to this connectionpublic String getErrorResponse()
public void setErrorResponse(String errorResponse)
errorResponse - sets the http error statusprivate boolean isValidToken()
Copyright © 2016 ADP LLC. All rights reserved.