PageTrailManager.java revision f48118365a7f4f1240516dbe66e47b24a896ff16
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: PageTrailManager.java,v 1.3 2008/07/10 23:27:22 veiming Exp $
*
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/**
* This singleton class governs the tracking of page trail per user session.
*/
public class PageTrailManager
implements SSOTokenListener
{
/**
* The generated random string is used to cache page trail object when
* we switch from on tab to another. Since it is used from caching
* purposes, usage of secure random is not required.
*/
private PageTrailManager() {
}
public static PageTrailManager getInstance() {
return instance;
}
/**
* Registers a page trail.
*
* @param token single sign on token
* @param pageTrail Page Trail.
* @return an unique key for retrieve this object in future
*/
try {
synchronized (mapTokenIDs) {
token.addSSOTokenListener(this);
}
randomStr = getRandomString();
}
} catch (SSOTokenListenersUnsupportedException ex) {
// NB. If SSOTokenListenersUnsupportedException is thrown, mapTokenIDs must not
// store reference to token ID as this will cause a memory leak.
randomStr = "";
} catch (SSOException ssoe) {
randomStr = "";
}
return randomStr;
}
/**
* Returns cached page trail.
*
* @param token single sign on token
* @param cacheID Key for retrieve this page trail
* @return page trail object if it is found. otherwises, return null
*/
}
/**
* Gets notification when single sign on token changes state.
*
* @param evt single sign on token event
*/
try {
switch (type) {
break;
}
} catch (SSOException ssoe) {
}
}
/**
* Clears all registered page trails of a given single sign on token ID
*
* @param tokenID single sign on token ID
*/
boolean removed = false;
synchronized(mapTokenIDs) {
}
}
/**
* Returns random string.
*
* @return random string.
*/
private static String getRandomString() {
byte[] keyRandom = new byte[5];
}
}