package com.eactive.eai.authserver.service;

import java.util.Set;

import com.fasterxml.jackson.annotation.JsonProperty;

public class BearerTokenInfo {
	@JsonProperty("client_id")
	private String clientId;
	private Long expiresIn;
	private Long expiresAt;
	private Set<String> scopeSet;
	
	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public Long getExpiresIn() {
		return expiresIn;
	}

	public void setExpiresIn(Long expiresIn) {
		this.expiresIn = expiresIn;
	}

	public Long getExpiresAt() {
		return expiresAt;
	}

	public void setExpiresAt(Long expiresIn) {
		this.expiresAt = System.currentTimeMillis() + (expiresIn * 1000);
	}

	public Set<String> getScopeSet() {
		return scopeSet;
	}

	public void setScopeSet(Set<String> scopeSet) {
		this.scopeSet = scopeSet;
	}

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