Package com.qtsurfer.api.sdk.auth
Class InMemoryTokenStore
java.lang.Object
com.qtsurfer.api.sdk.auth.InMemoryTokenStore
- All Implemented Interfaces:
TokenStore
Default
TokenStore — holds the most recent token in a single
in-memory slot. Lost on JVM exit. Sufficient for short-lived scripts and
for tests.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Drops the in-memory token; nothing here survives past this call or JVM exit.com.qtsurfer.api.client.model.AuthTokenResponseload()Returns whatever was last written to the single in-memory slot —nullbefore the firstsave(com.qtsurfer.api.client.model.AuthTokenResponse)or afterclear().voidsave(com.qtsurfer.api.client.model.AuthTokenResponse token) Overwrites the single slot; passingnullhas the same effect asclear().
-
Constructor Details
-
InMemoryTokenStore
public InMemoryTokenStore()
-
-
Method Details
-
load
public com.qtsurfer.api.client.model.AuthTokenResponse load()Returns whatever was last written to the single in-memory slot —nullbefore the firstsave(com.qtsurfer.api.client.model.AuthTokenResponse)or afterclear().- Specified by:
loadin interfaceTokenStore
-
save
public void save(com.qtsurfer.api.client.model.AuthTokenResponse token) Overwrites the single slot; passingnullhas the same effect asclear().- Specified by:
savein interfaceTokenStore
-
clear
public void clear()Drops the in-memory token; nothing here survives past this call or JVM exit.- Specified by:
clearin interfaceTokenStore
-