* @return a boolean, true if token is ok, else false
*/
protected boolean checkToken(String sessionId, String externalToken) {
this.getReadLockTokenTable();
try {
Token token = tokens.get(sessionId);
if (null == token) {
// no token for this sessionId
return false;
}
if (!token.getTokenString().equals(externalToken)) {
// no match external and internal token
return false;
}
if ((tokenMaxLifeTime * 60000) < (new Date().getTime() - token
.getIssuedTimeStamp().getTime())) {
// token has passed maxLifeTime
return false;
}
// token, match, still valid