package ru.micord.ervu.security.esia.token;

/**
 * @author Eduard Tihomirov
 */
public class ExpiringToken {
  private String accessToken;
  private long expiryTime;

  public ExpiringToken(String accessToken, long expiryTime) {
    this.accessToken = accessToken;
    this.expiryTime = expiryTime;
  }

  public String getAccessToken() {
    return accessToken;
  }

  public void setAccessToken(String accessToken) {
    this.accessToken = accessToken;
  }

  public long getExpiryTime() {
    return expiryTime;
  }

  public void setExpiryTime(long expiryTime) {
    this.expiryTime = expiryTime;
  }

  boolean isExpired() {
    return System.currentTimeMillis() > expiryTime;
  }
}
