Class DeviceCodeResponseDTO
java.lang.Object
org.openhab.core.auth.client.oauth2.DeviceCodeResponseDTO
- All Implemented Interfaces:
Serializable
,Cloneable
This
DeviceCodeResponseDTO
is a DTO with fields that encapsulate the data from RFC-8628 device code
responses.
Note: RFC-8628 says 'verificationUriComplete' and 'interval' are OPTIONAL fields.
See AccessTokenResponse
for reference.
- Author:
- Andrew Fiddian-Green - Initial contribution
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
long
int
hashCode()
boolean
Calculate if the device code response is expired against the given time.void
setCreatedOn
(Instant createdOn) void
setDeviceCode
(String deviceCode) void
setExpiresIn
(long expiresIn) void
setInterval
(Long interval) void
setUserCode
(String userCode) void
setVerificationUri
(String verificationUri) void
setVerificationUriComplete
(String verificationUriComplete) toString()
-
Constructor Details
-
DeviceCodeResponseDTO
public DeviceCodeResponseDTO()
-
-
Method Details
-
clone
-
getCreatedOn
-
getDeviceCode
-
getExpiresIn
public long getExpiresIn() -
getInterval
-
getUserCode
-
getVerificationUri
-
getVerificationUriComplete
-
isExpired
Calculate if the device code response is expired against the given time. It also returns true even if the response is not initialized (i.e. newly created).- Parameters:
givenTime
- To calculate if the response is expired against the givenTime.tokenExpiresInBuffer
- A positive integer in seconds to act as additional buffer to the calculation. This causes the response to expire earlier then the stated expiry-time given.- Returns:
- true if object is not-initialized, or expired, or expired early due to buffer.
-
setCreatedOn
-
setDeviceCode
-
setExpiresIn
public void setExpiresIn(long expiresIn) -
setInterval
-
setUserCode
-
setVerificationUri
-
setVerificationUriComplete
-
equals
-
hashCode
public int hashCode() -
toString
-