/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2011 ForgeRock AS. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/**
* Logout helper class, this class is intended to make it possible to use the same
* logout logic in multiple taskhandlers.
*
* @see NotenforcedIPTaskHandler
* @see NotenforcedListTaskHandler
* @see ApplicationLogoutHandler
*
* @author Peter Major
*/
public class LogoutHelper {
private Hashtable<String, IJ2EELogoutHandler> _localLogoutHandlers = new Hashtable<String, IJ2EELogoutHandler>();
parent = parentTask;
}
// Call the container specific logout handler in ALL or J2EE_POLICY
// mode
}
// remove the SSO Token from the local caches
// Even if logout handler fails, we will Destroy local session and
// redirect to AM
if (parent.isLogMessageEnabled()) {
"LogoutHelper : Invalidating HTTP Session.");
}
}
}
/**
* @param ctx the <code>AmFilterRequestContext</code> that carries
* information about the incoming request and response objects.
*/
throws AgentException {
boolean result = false;
try {
if (localAuthHandler != null) {
if (parent.isLogMessageEnabled()) {
"LogoutHelper : "
+ "Invoking Local Logout handler");
}
result = true;
}
throw new AgentException(
"LogoutHelper.invokeApplicationLogoutHandler()"
+ " failed to invoke Local Logout with exception", ex);
}
return result;
}
/**
* Method getApplicationLogoutHandler
*
* @param appName Application Name
* @ return IJ2EELogoutHandler Mapped Local Logout Handler
*
* @see Returns the Application Logout Handler for the context URI. If the
* application does not have an entry in the configuration.
*
*/
throws AgentException {
if (localLogoutHandlerClass == null) {
if ((localLogoutHandlerClassName != null)
try {
if (parent.isLogMessageEnabled()) {
"LogoutHelper: Application Name = "
+ appName
+ " registering"
+ " Local Logout Handler = "
}
throw new AgentException(
"Failed to load Local Logout Handler "
+ "for Application = " + appName
+ " with exception :", ex);
}
}
}
}
return localLogoutHandlerClass;
}
/**
* Remove SSO Token from local cache during logout.
* If notification is enabled this code is probably a noop, but if the
* browser was faster then the logout notification this method will work
* as a safety net.
*
* @param ctx RequestContext
*/
}
}
}
return _localLogoutHandlers;
}
}