Class RemoteAPIToken


  • @Entity
    public class RemoteAPIToken
    extends java.lang.Object
    OAuth2 token for communicating with a RemoteAPI for a given User
    • Constructor Detail

      • RemoteAPIToken

        public RemoteAPIToken()
      • RemoteAPIToken

        public RemoteAPIToken​(java.lang.String tokenString,
                              RemoteAPI remoteApi,
                              java.util.Date expiryDate)
      • RemoteAPIToken

        public RemoteAPIToken​(java.lang.String tokenString,
                              java.lang.String refreshToken,
                              RemoteAPI remoteApi,
                              java.util.Date expiryDate)
    • Method Detail

      • getId

        public java.lang.Long getId()
        Returns:
        the id
      • setId

        public void setId​(java.lang.Long id)
        Parameters:
        id - the id to set
      • getTokenString

        public java.lang.String getTokenString()
        Returns:
        the tokenString
      • setTokenString

        public void setTokenString​(java.lang.String tokenString)
        Parameters:
        tokenString - the tokenString to set
      • getRemoteApi

        public RemoteAPI getRemoteApi()
        Returns:
        the remoteApi
      • setRemoteApi

        public void setRemoteApi​(RemoteAPI remoteApi)
        Parameters:
        remoteApi - the remoteApi to set
      • getUser

        public User getUser()
        Returns:
        the user
      • setUser

        public void setUser​(User user)
        Parameters:
        user - the user to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getExpiryDate

        public java.util.Date getExpiryDate()
        Get the date that this token expires
        Returns:
        the Date that this token expires.
      • setExpiryDate

        public void setExpiryDate​(java.util.Date expiryDate)
        Set the date that this token expires
        Parameters:
        expiryDate - the Date that this token expires.
      • isExpired

        public boolean isExpired()
        Test if this token has expired
        Returns:
        true if this token has expired
      • getRefreshToken

        public java.lang.String getRefreshToken()
      • setRefreshToken

        public void setRefreshToken​(java.lang.String refreshToken)
      • hashCode

        public int hashCode()
        Hashcode using remoteAPI and tokenString
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Equals method using remoteAPI and tokenString
        Overrides:
        equals in class java.lang.Object