Class PegaseTokenManager
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.odfsync.pegase.ws.PegaseTokenManager
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
public class PegaseTokenManager
extends AbstractLogEnabled
implements Component, Serviceable, Initializable
Manager to request Pégase token when needed.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Instant
Extract the expiration date from the token.getToken()
Get the token to log to Pégase APIvoid
void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Role -
_jsonUtils
The JSON utils
-
-
Constructor Details
-
PegaseTokenManager
public PegaseTokenManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getToken
Get the token to log to Pégase API- Returns:
- a valid token
- Throws:
IOException
- if an error occurs
-
_extractExpirationDate
Extract the expiration date from the token.- Returns:
- the expiration dat of the current token
-