SessionConfigListener.java revision 8d3140b524c0e28c0a49dc7c7d481123ef3cfe11
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 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: SessionConfigListener.java,v 1.7 2008/08/19 19:08:39 veiming Exp $
*
*/
/**
* Portions Copyrighted 2011 ForgeRock AS
*/
/**
* This class implements the interface <code>ServiceListener</code> in order
* to receive session service data change notifications. The method
* schemaChanged() is invoked when session service schema data in the
* following locations is changed; Console > Configuration > Global > Session -
* Maximum Number or Search Results and Timeout for Search.
* @see com.sun.identity.sm.ServiceSchemaManager
*/
public class SessionConfigListener implements ServiceListener {
private static final String SESSION_RETRIEVAL_TIMEOUT =
"iplanet-am-session-session-list-retrieval-timeout";
private static final String MAX_SESSION_LIST_SIZE =
"iplanet-am-session-max-session-list-size";
private static final String SESSION_CONSTRAINT =
"iplanet-am-session-enable-session-constraint";
private static final String DENY_LOGIN_IF_DB_IS_DOWN =
"iplanet-am-session-deny-login-if-db-is-down";
private static final String CONSTRAINT_HANDLER =
"iplanet-am-session-constraint-handler";
private static final String MAX_WAIT_TIME_FOR_CONSTRAINT =
"iplanet-am-session-constraint-max-wait-time";
private static long defSessionRetrievalTimeout;
private static int defMaxSessionListSize;
public static long defSessionRetrievalTimeoutLong = 5;
public static int defMaxSessionListSizeInt = 200;
/**
* Creates a new SessionConfigListener
* @param ssm ServiceSchemaManager
*/
sSchemaMgr = ssm;
}
/**
* This method is used to receive notifications if schema changes.
*
* @param serviceName
* the name of the service.
* @param version
* the version of the service. this method is No-op.
*/
if ((serviceName != null)
return;
}
try {
} else {
}
} else {
}
} else {
}
DENY_LOGIN_IF_DB_IS_DOWN, "NO");
} else {
SessionService.setDenyLoginIfDBIsDown(false);
}
} catch (Exception e) {
+ "Unable to get Session Service attributes", e);
}
try {
} catch (Exception e) {
"SessionConfigListener : Unable to parse Timeout values",
e);
}
try {
} catch (Exception e) {
"SessionConfigListener : Unable to parse ListSize values",
e);
}
int maxWaitTimeForConstraint = 6000;
try {
} catch (Exception e) {
"SessionConfigListener : Unable to parse Wait Time values." +
" Defaulting to 6000 milli seconds",e);
}
}
/**
* This method for implementing ServiceListener. As this object listens for
* changes in schema of amConsoleService. this method is No-op.
*
* @param serviceName
* name of the service
* @param version
* version of the service
* @param groupName
* name of the group
* @param serviceComponent
* service component
* @param type
* type of modification
*/
// No op.
}
/**
* This method for implementing ServiveListener. As this object listens for
* changes in schema of amConsoleService. this method is No-op.
*
* @param serviceName
* name of the service
* @param version
* version of the service
* @param orgName
* name of the org
* @param groupName
* name of the group
* @param serviceComponent
* service component
* @param type
* type of modification this method is No-op.
*/
{
// No op.
}
/**
* Retrieves Timeout of Session search.
* @return timeout for search
*/
public static long getTimeout() {
return defSessionRetrievalTimeout;
}
/**
* Gets Max list size of Session search.
* @return maximum size of sessions
*/
public static int getMaxsize() {
return defMaxSessionListSize;
}
}