Package io.yellowbrick.jdbc.oauth2
Class Token
- java.lang.Object
-
- io.yellowbrick.jdbc.oauth2.Token
-
public class Token extends Object
Represents an OAuth2 token used for authentication with the Yellowbrick database. This class encapsulates the access or id token, refresh token, expiration time, and additional properties used to obtain the connection.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertiescopyOf(Properties info)static TokencreateToken(String authToken, String refreshToken, Instant expiresAt, String url, Properties info)static TokenfromJSONObject(org.json.JSONObject json)StringgetAuthToken()StringgetConnection()InstantgetExpiresAt()PropertiesgetInfo()StringgetRefreshToken()DriverConfiguration.TokenCacheOptiongetTokenCacheOption()booleanmatches(String connection, Properties info)org.json.JSONObjecttoJSONObject()
-
-
-
Method Detail
-
createToken
public static Token createToken(String authToken, String refreshToken, Instant expiresAt, String url, Properties info) throws SQLException
- Throws:
SQLException
-
getAuthToken
public String getAuthToken()
-
getRefreshToken
public String getRefreshToken()
-
getExpiresAt
public Instant getExpiresAt()
-
getConnection
public String getConnection()
-
getInfo
public Properties getInfo()
-
getTokenCacheOption
public DriverConfiguration.TokenCacheOption getTokenCacheOption()
-
copyOf
public static Properties copyOf(Properties info)
-
matches
public boolean matches(String connection, Properties info)
-
toJSONObject
public org.json.JSONObject toJSONObject()
-
fromJSONObject
public static Token fromJSONObject(org.json.JSONObject json) throws SQLException
- Throws:
SQLException
-
-