a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The contents of this file are subject to the terms
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the Common Development and Distribution License
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * (the License). You may not use this file except in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * compliance with the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * You can obtain a copy of the License at
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * See the License for the specific language governing
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * permission and limitations under the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * When distributing Covered Code, include this CDDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Header Notice in each file and include the License file
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * If applicable, add the following below the CDDL Header,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * with the fields enclosed by brackets [] replaced by
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * your own identifying information:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * $Id: DSTUtils.java,v 1.3 2008/08/06 17:28:09 exu Exp $
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.liberty.ws.common.Status;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This class <code>DSTUtils</code> is an utility class used by the DST layer
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * and also can be used by the any dependent services.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster public static Debug debug = Debug.getInstance("libIDWSF");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Locale.getInstallResourceBundle("libDSTService");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Parses an XML input string.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param xml xmlString.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @return Element the root element of a parse xml string.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster public static Element parseXML(String xml) throws DSTException {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Document doc = XMLUtils.toDOMDocument(xml, debug);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster debug.error("DSTUtils.parseXML: Parsing error.", ex);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster public static Status parseStatus(Element element) throws DSTException {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster debug.error("DSTUtils.parseStatus: nullInputParams");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new DSTException(bundle.getString("nullInputParams"));
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster String nameSpaceURI = element.getNamespaceURI();
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster Status status = new Status(nameSpaceURI, prefix);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster StringTokenizer st = new StringTokenizer(code, ":");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new DSTException(bundle.getString("invalidStatus"));
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster QName qName = new QName(nameSpaceURI, localPart, codePrefix);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster throw new DSTException(bundle.getString("invalidStatus"));