2 * Copyright (C) 2021 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.api
.security
;
11 import java
.util
.Calendar
;
12 import java
.util
.Date
;
15 * @author a.kohlbecker
18 public class AbstractRequestToken
{
20 protected String token
;
21 private Date expiryDate
;
26 public AbstractRequestToken() {
30 public String
getToken() {
34 public Date
getExpiryDate() {
38 protected void setExpiryDate(int minutes
) {
39 Calendar now
= Calendar
.getInstance();
40 now
.add(Calendar
.MINUTE
, minutes
);
41 this.expiryDate
= now
.getTime();
44 public boolean isExpired() {
45 return new Date().after(this.expiryDate
);