ISLocaleContext.java revision 32bd4dbf7dd85069d8cba66ae42fad635cdd34d5
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: ISLocaleContext.java,v 1.14 2008/08/19 19:09:00 veiming Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.iplanet.services.cdm.ClientException;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.security.AdminTokenAction;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.sm.ServiceConfigManager;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport com.sun.identity.sm.ServiceSchemaManager;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterimport org.forgerock.json.resource.servlet.HttpContext;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Sets the locale suitable for the given situation. Each response to end-user
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * must be in a well defined locale. Even if the user has not logged in, OpenSSO
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Enterprise should respond in a locale. Hence OpenSSO consults
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * various parameter to find out the locale for any given response. The order
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and priorty of local setting is as follows:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Priority 0 - OS_LOCALE - value returned by java.util.Locale.getDefault()
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Priority 1 - PLATFORM_LOCALE - iplanet-am-platform-locale attribute value
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * in iPlanetAMPlatform Service - Global value for entire
public class ISLocaleContext {
private int localeLevel;
public ISLocaleContext() {
} catch (Exception e) {
return locale;
public int getLocaleLevel() {
return localeLevel;
return charset;
return jCharset;