SMProfileModelImpl.java revision aee26cce86cd7acccbcd94284b027d11cb9ac327
/**
* 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: SMProfileModelImpl.java,v 1.5 2008/06/25 05:43:21 qcheng Exp $
*
*/
/*
* Portions Copyrighted 2011 ForgeRock AS
*/
/* - LOG COMPLETE - */
/**
* Class that provides methods to manage Session Management.
*/
public class SMProfileModelImpl extends AMModelBase
implements SMProfileModel
{
private static SSOToken adminSSOToken =
private final static String SERVER_LIST =
"iplanet-am-platform-server-list";
private SMSessionCache sessionCache;
private boolean validSession = true;
/**
* Constructs a session management profile model implementation object.
*
* @param request HTTP Servlet request.
* @param map of user information.
*/
}
/**
* Sets server name.
*
* @param value sever name.
*/
serverName = value;
}
/**
* Returns session profile property XML.
*
* @param profileName Name of Profile to be Obtained.
* @param viewbeanClassName Class name of View Bean
* @throws AMConsoleException if there are no attributes to display.
* @return String of profile XML.
*/
public String getSessionProfilePropertyXML(
) throws AMConsoleException {
}
throws AMConsoleException
{
try {
adminSSOToken, "/");
}
} catch (SSOException e) {
} catch (SMSException e) {
}
}
/**
* Initializes sessions list.
*
* @param pattern user id pattern to search for.
* @throws AMConsoleException if unable to initialized the session list.
*/
throws AMConsoleException
{
try {
sessionCache = new SMSessionCache(
} catch (SessionException se) {
throw new AMConsoleException(strError);
}
}
private Session getCurrentSession()
throws AMConsoleException
{
try {
} catch (SessionException se) {
}
return session;
}
throws AMConsoleException
{
try {
) {
if (s != null) {
}
}
}
} catch (SessionException se) {
}
return sessions;
}
/**
* Invalidates list of session.
*
* @param list of session <code>ID</code>s.
* @param pattern Search pattern.
* @return a list of session <code>ID</code>s that cannot be validated.
*/
throws AMConsoleException
{
try {
} catch (SessionException se) {
}
boolean isCurrentSession = false;
try {
} catch (SessionException se) {
logEvent("SESSION_EXCEPTION_INVALIDATE_SESSIONS",
params);
}
if (isCurrentSession) {
validSession = false;
} else {
try {
} catch (SessionException se) {
getErrorString(se)};
logEvent("SESSION_EXCEPTION_INVALIDATE_SESSIONS",
paramsEx);
try {
} catch (SessionException e) {
"SMProfileModelImpl.invalidateSessions", e);
}
"SMProfileModelImpl.invalidateSessions", se);
}
}
}
if (!validSession) {
try {
} catch (SessionException se) {
getErrorString(se)};
logEvent("SESSION_EXCEPTION_INVALIDATE_SESSIONS",
paramsEx);
}
}
}
}
return failList;
}
/**
* Returns true if current user session state is valid.
*
* @return true is the session is valid.
*/
public boolean isSessionValid() {
return validSession;
}
/**
* Returns true if the two sessions passed are same.
*
* @param session current session
* @param sess session to be destroyed.
* @return true if two sessions are same
*/
boolean isCurrentSession = false;
try {
} catch (SessionException se) {
}
return isCurrentSession;
}
/**
* Returns session cache.
*
* @param pattern Pattern for search.
* @return session cache.
* @throws AMConsoleException if unable to get the session cache.
*/
throws AMConsoleException
{
if (sessionCache == null) {
}
return sessionCache;
}
/**
* Sets session cache.
*
* @param cache Session cache.
*/
}
/**
* Returns set of server names.
*
* @return set of server names.
*/
public Map getServerNames() {
try {
getUserSSOToken());
} catch (SSOException e) {
} catch (SMSException e) {
}
}
return serverNamesMap;
}
if (index != -1) {
} else {
if (debug.warningEnabled()) {
"This server entry is not proper, ignoring:"
+ serverEntry);
}
}
}
return serverList;
}
/**
* Returns the map of server names(host:port) and url.
*
* @param set names of server instance.
* returns the map of server names(host:port) and url.
*/
try {
if (port == -1) {
} else {
}
} catch (MalformedURLException e) {
}
}
}
return map;
}
/**
* Returns attribute values. Map of attribute name to set of values.
*
* @param name Name of Attribute.
* @return attribute values.
* @throws AMConsoleException if attribute values cannot be obtained.
*/
throws AMConsoleException
{
try {
getUserSSOToken(), name);
}
}
}
}
return map;
} catch (SMSException e) {
throw new AMConsoleException(strError);
}
}
/**
* Set attribute values.
*
* @param name Name of Attribute.
* @param attributeValues Map of attribute name to set of values.
* @throws AMConsoleException if attribute values cannot be updated.
*/
throws AMConsoleException {
try {
getUserSSOToken(), name);
}
} catch (SMSException e) {
throw new AMConsoleException(strError);
}
}
mapServices = new HashMap();
i.hasNext();
) {
if (idx != -1) {
}
} else {
"SMProfileModelImpl.mapAttributeValuesToServiceName: " +
"unknown attribute, " + attrName);
}
}
}
}
}