Class DeviceCodeResponseDTO

java.lang.Object
org.openhab.core.auth.client.oauth2.DeviceCodeResponseDTO
All Implemented Interfaces:
Serializable, Cloneable

public final class DeviceCodeResponseDTO extends Object implements 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 Details Link icon

    • DeviceCodeResponseDTO Link icon

      public DeviceCodeResponseDTO()
  • Method Details Link icon

    • clone Link icon

      public Object clone()
      Overrides:
      clone in class Object
    • getCreatedOn Link icon

      public Instant getCreatedOn()
    • getDeviceCode Link icon

      public String getDeviceCode()
    • getExpiresIn Link icon

      public long getExpiresIn()
    • getInterval Link icon

      public Long getInterval()
    • getUserCode Link icon

      public String getUserCode()
    • getVerificationUri Link icon

      public String getVerificationUri()
    • getVerificationUriComplete Link icon

      public String getVerificationUriComplete()
    • isExpired Link icon

      public boolean isExpired(Instant givenTime, int tokenExpiresInBuffer)
      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 Link icon

      public void setCreatedOn(Instant createdOn)
    • setDeviceCode Link icon

      public void setDeviceCode(String deviceCode)
    • setExpiresIn Link icon

      public void setExpiresIn(long expiresIn)
    • setInterval Link icon

      public void setInterval(Long interval)
    • setUserCode Link icon

      public void setUserCode(String userCode)
    • setVerificationUri Link icon

      public void setVerificationUri(String verificationUri)
    • setVerificationUriComplete Link icon

      public void setVerificationUriComplete(String verificationUriComplete)
    • equals Link icon

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object