Package org.localify.user.support
Class RefreshToken
java.lang.Object
org.localify.user.support.RefreshToken
Represents a refresh token for a user session.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume()Marks the refresh token as consumed.protected InstantGets the consumption timestamp of the refresh token.Gets the expiration timestamp of the refresh token.Gets the GeoIP details for the refresh token.getId()Gets the ID of the refresh token.Gets the IP address from which the refresh token was issued.Gets the timestamp at which the refresh token was issued.Gets the user session associated with the refresh token.getToken()Gets the token string.Gets the user agent from which the refresh token was issued.booleanChecks if the refresh token has been consumed.protected voidsetConsumedAt(Instant consumedAt) Sets the consumption timestamp of the refresh token.setExpiresAt(Instant expiresAt) Sets the expiration timestamp of the refresh token.setGeoIpDetails(GeoIpDetails geoIpDetails) Sets the GeoIP details for the refresh token.Sets the ID of the refresh token.setIpAddress(InetAddress ipAddress) Sets the IP address from which the refresh token was issued.setIssuedAt(Instant issuedAt) Sets the timestamp at which the refresh token was issued.setSession(UserSession session) Sets the user session associated with the refresh token.Sets the token string.setUserAgent(String userAgent) Sets the user agent from which the refresh token was issued.
-
Constructor Details
-
RefreshToken
public RefreshToken()Default constructor.
-
-
Method Details
-
getId
Gets the ID of the refresh token.- Returns:
- The ID.
-
setId
Sets the ID of the refresh token.- Parameters:
id- The ID.- Returns:
- The refresh token.
-
getSession
Gets the user session associated with the refresh token.- Returns:
- The user session.
-
setSession
Sets the user session associated with the refresh token.- Parameters:
session- The user session.- Returns:
- The refresh token.
-
getIpAddress
Gets the IP address from which the refresh token was issued.- Returns:
- The IP address.
-
setIpAddress
Sets the IP address from which the refresh token was issued.- Parameters:
ipAddress- The IP address.- Returns:
- The refresh token.
-
getUserAgent
Gets the user agent from which the refresh token was issued.- Returns:
- The user agent.
-
setUserAgent
Sets the user agent from which the refresh token was issued.- Parameters:
userAgent- The user agent.- Returns:
- The refresh token.
-
getIssuedAt
Gets the timestamp at which the refresh token was issued.- Returns:
- The issuance timestamp.
-
setIssuedAt
Sets the timestamp at which the refresh token was issued.- Parameters:
issuedAt- The issuance timestamp.- Returns:
- The refresh token.
-
getExpiresAt
Gets the expiration timestamp of the refresh token.- Returns:
- The expiration timestamp.
-
setExpiresAt
Sets the expiration timestamp of the refresh token.- Parameters:
expiresAt- The expiration timestamp.- Returns:
- The refresh token.
-
getGeoIpDetails
Gets the GeoIP details for the refresh token.- Returns:
- The GeoIP details.
-
setGeoIpDetails
Sets the GeoIP details for the refresh token.- Parameters:
geoIpDetails- The GeoIP details.- Returns:
- The refresh token.
-
getToken
Gets the token string.- Returns:
- The token string.
-
setToken
Sets the token string.- Parameters:
token- The token string.- Returns:
- The refresh token.
-
getConsumedAt
Gets the consumption timestamp of the refresh token.- Returns:
- The consumption timestamp.
-
setConsumedAt
Sets the consumption timestamp of the refresh token.- Parameters:
consumedAt- The consumption timestamp.
-
isConsumed
public boolean isConsumed()Checks if the refresh token has been consumed.- Returns:
- true if the refresh token has been consumed, false otherwise.
-
consume
public void consume()Marks the refresh token as consumed.
-