/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. 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
* at opensso/legal/CDDLv1.0.txt.
* 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]"
*
* $Id: FSSessionManager.java,v 1.6 2009/08/03 18:18:36 bigfatrat Exp $
*
*/
/**
* The class <code>FSSessionManager</code> is a <code>final</code> class
* that provides interfaces to manage <code>FSSession</code>s.
* <p>
* It is a singleton class; an instance of this class can be obtained by
* calling <code>FSSessionManager.getInstance()</code>.
*/
public final class FSSessionManager {
// property name for request cleanup internal
"com.sun.identity.federation.request.cleanup_interval";
// default value for request cleanup internal
// property name for request time out
"com.sun.identity.federation.request.timeout";
// default value for request time out
// Singleton instance of FSSessionManager
// used to store list of FSSession for a user
// key : user DN, value List of FSSession object
/**
* For managing session statistics.
*/
static {
try {
} else {
}
} catch (Exception e) {
"Unable to get fed request cleanup prop.", e);
}
}
try {
} else {
}
} catch (Exception e) {
"Unable to get fed request timeout prop.", e);
}
}
}
}
/**
* Gets the <code>RelayState</code> value which maps
* to the request ID.
*
* @param requestID request ID
* @return the <code>RelayState</code> value
*/
}
/**
* Sets the <code>RelayState</code> value with the specified
* request ID in the <code>relayStateMap</code>.
*
* @param requestID request ID
* @param relayState the <code>RelayState</code> value
*/
}
/**
* Removes the mapping for this request ID from the
* <code>relayStateMap</code>.
*
* @param requestID request ID
*/
}
/**
* Returns authentication request associated with <code>requestID</code>.
* @param requestID authentication request ID
* @return authentication request associated with the request ID
*/
}
/**
* Sets authentication request.
* @param requestID authentication request ID
* @param authnRequest authentication request
*/
"FSSessionManager.setAuthnRequest: Called, ID=" + requestID );
}
}
}
/**
* Removes an authentication request.
* @param requestID ID of the request to be removed
*/
"FSSessionManager.removeAuthnRequest: Called, ID=" + requestID);
}
}
}
}
/**
* Returns local token associated with the request ID.
* @param requestID request ID
* @return session object associated with the request ID
*/
}
/**
* Sets local token.
* @param requestID request ID
* @param localSession token to be set
*/
}
}
/**
* Removes a local token associated with <code>requestID</code>.
* @param requestID request ID
*/
"FSSessionManager.removeLocalSessionToken: Called");
}
}
/**
* Returns IDP's entity ID associated with <code>requestID</code>.
* @param requestID request ID
* @return identity provider's entity ID
*/
}
/**
* Sets IDP's entity ID.
* @param requestID authentication request ID
* @param idpEntityId identity provider's entity ID to be set
*/
public void setIDPEntityID(
{
}
}
/**
* Sets proxy service provider descriptor.
* @param requestID authentication request ID
* @param spDescriptor provider descriptor to be set
*/
public void setProxySPDescriptor(
{
}
/**
* Returns proxy service provider descriptor.
* @param requestID request ID
* @return provider descriptor
*/
}
/**
* Returns proxy authentication request.
* @param requestID authentication request ID
*/
}
/**
* Sets proxy authentication request.
* @param requestID request ID
* @param authnRequest proxy authentication request to be set.
*/
public void setProxySPAuthnRequest(
{
}
/**
* Returns list of sessions associated with <code>userID</code>.
* @param userID user ID
* @return list of sessions
*/
}
/**
* Sets session list.
* @param userID user ID
* @param sessionList list of sessions to be set
*/
}
}
/**
* Removes session list associated with <code>userID</code>.
* @param userID user ID
*/
}
}
/**
* Returns session with <code>sessionID</code> for <code>userID</code>.
* @param userID user ID
* @param sessionID session ID
* @return <code>FSSession</code> object
*/
synchronized (sessions) {
while (i.hasNext ()) {
return session;
}
}
}
}
return null;
}
/**
* Returns the session in <code>sessions</code> whose session index is
* <code>sessionIndex</code>.
* @param sessions list of <code>FSSession</code>s.
* @param sessionIndex session index
* @return <code>FSSession</code> object whose session index is
* <code>sessionIndex</code>
*/
"sessions or sessionIndex is null");
return null;
}
synchronized (sessions) {
while (i.hasNext ()) {
return session;
}
}
}
"No session found for the given session index.");
}
return null;
}
/**
* Returns session associated with <code>token</code>.
* @param token session object
* @return <code>FSSession</code> associated with the token
*/
return null;
}
try {
} catch (Exception e) {
return null;
}
}
/**
* Removes <code>entityID</code> from <code>userID</code>'s
* session partner list.
* @param userID user ID
* @param entityID entity ID of the provider to be removed
* @param localSession <code>FSSession</code> object
*/
public void removeProvider(
{
if (localSession != null) {
"localSession is not null");
}
return;
}
synchronized (sessions) {
while (i.hasNext ()) {
entityID);
}
}
}
}
}
}
/**
* Removes a federation session of an user.
* @param userID user ID
* @param session federation session to be removed
*/
synchronized (sessions) {
while (i.hasNext ()) {
break;
}
}
}
}
}
}
/**
* Adds a federation session to a user.
* @param userID user ID
* @param session federation session to be added
*/
synchronized (sessions) {
while (i.hasNext ()) {
break;
}
}
return;
}
}
}
}
try {
+ "obtain hosted entity ID:", ie);
}
}
}
if (cleanupInterval != 0 &&
requestTimeout != 0 &&
{
"start cleanup thread for " + hostEntityId +
" in realm " + realm);
}
1000));
}
}
/**
* Gets the singleton instance of <code>FSSessionManager</code>.
* @param metaAlias hosted provider's metaAlias
* @return The singleton <code>FSSessionManager</code> instance
* for this provider
*/
// not throwing any exception
+ metaAlias);
}
"FSSessionManager.getInstance: null provider meta alias");
return null;
}
"new instance of FSSessionManager: " + metaAlias);
}
synchronized (instanceMap) {
}
}
return (instance);
}
}// end class