long version = 0;
if (isVersioningSupported() && versionCookie != null) {
version = Long.parseLong(versionCookie.getValue());
}
SingleSignOnEntry entry = lookup(cookie.getValue(), version);
if (entry != null) {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, FOUND_CACHED_PRINCIPAL,
new Object[]{entry.getPrincipal().getName(), entry.getAuthType(), entry.getRealmName()});
}
//S1AS8 6155481 END
// only use this SSO identity if it was set in the same realm
if (entry.getRealmName().equals(realmName)) {
request.setNote(Constants.REQ_SSOID_NOTE, cookie.getValue());
((HttpRequest) request).setAuthType(entry.getAuthType());
((HttpRequest) request).setUserPrincipal(entry.getPrincipal());
// Touch the SSO entry access time
entry.setLastAccessTime(System.currentTimeMillis());
if (isVersioningSupported()) {
long ver = entry.incrementAndGetVersion();
request.setNote(Constants.REQ_SSO_VERSION_NOTE,
Long.valueOf(ver));
}
// update hit atomic counter
hitCount.incrementAndGet();