0N/A/**
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0N/A *
0N/A * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
0N/A *
0N/A * The contents of this file are subject to the terms
0N/A * of the Common Development and Distribution License
0N/A * (the License). You may not use this file except in
0N/A * compliance with the License.
0N/A *
0N/A * You can obtain a copy of the License at
0N/A * https://opensso.dev.java.net/public/CDDLv1.0.html or
0N/A * opensso/legal/CDDLv1.0.txt
0N/A * See the License for the specific language governing
0N/A * permission and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL
0N/A * Header Notice in each file and include the License file
0N/A * at opensso/legal/CDDLv1.0.txt.
0N/A * If applicable, add the following below the CDDL Header,
0N/A * with the fields enclosed by brackets [] replaced by
0N/A * your own identifying information:
0N/A * "Portions Copyrighted [year] [name of copyright owner]"
0N/A *
0N/A * $Id: SOAPBindingRequestHandler.java,v 1.2 2008/06/25 05:49:47 qcheng Exp $
0N/A *
0N/A */
0N/A
0N/Apackage com.sun.identity.console.service.model;
0N/A
0N/Aimport java.util.StringTokenizer;
0N/A
0N/A/* - NEED NOT LOG - */
0N/A
0N/Apublic class SOAPBindingRequestHandler {
0N/A public String strKey;
0N/A public String strClass;
0N/A public String strSOAPAction;
0N/A public boolean valid;
0N/A
0N/A public SOAPBindingRequestHandler(String formatedStr) {
0N/A StringTokenizer st = new StringTokenizer(formatedStr, "|");
0N/A int count = st.countTokens();
0N/A
0N/A if ((count == 2) || (count == 3)) {
0N/A valid = true;
0N/A
0N/A while (st.hasMoreTokens() && valid) {
0N/A String token = st.nextToken();
0N/A if (token.startsWith(SCSOAPBindingModelImpl.KEY_PREFIX)) {
0N/A strKey = token.substring(
0N/A SCSOAPBindingModelImpl.KEY_PREFIX.length());
0N/A } else if (token.startsWith(
0N/A SCSOAPBindingModelImpl.CLASS_PREFIX)) {
0N/A strClass = token.substring(
0N/A SCSOAPBindingModelImpl.CLASS_PREFIX.length());
0N/A } else if (token.startsWith(
0N/A SCSOAPBindingModelImpl.ACTION_PREFIX)) {
0N/A strSOAPAction = token.substring(
0N/A SCSOAPBindingModelImpl.ACTION_PREFIX.length());
0N/A } else {
0N/A valid = false;
0N/A }
0N/A }
0N/A }
0N/A }
0N/A
0N/A public static String toString(String key, String clazz, String action) {
0N/A String str = SCSOAPBindingModelImpl.KEY_PREFIX + key + "|" +
0N/A SCSOAPBindingModelImpl.CLASS_PREFIX + clazz;
0N/A
0N/A if ((action != null) && (action.trim().length() > 0)) {
0N/A str += "|" + SCSOAPBindingModelImpl.ACTION_PREFIX + action;
0N/A }
0N/A
0N/A return str;
0N/A }
0N/A
0N/A public boolean isValid() {
0N/A return valid;
0N/A }
0N/A}
0N/A