utility method for approved sites to check expiration

pull/263/head
Justin Richer 2012-11-26 14:25:38 -05:00
parent 84401531ae
commit 413c477879
1 changed files with 18 additions and 0 deletions

View File

@ -218,4 +218,22 @@ public class ApprovedSite {
this.whitelistedSite = whitelistedSite;
}
/**
* Has this approval expired?
* @return
*/
@Transient
public boolean isExpired() {
if (getTimeoutDate() != null) {
Date now = new Date();
if (now.after(getTimeoutDate())) {
return true;
} else {
return false;
}
} else {
return false;
}
}
}