001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036: package com.sun.xml.ws.tx.common;
037:
038: import com.sun.istack.NotNull;
039: import static com.sun.xml.ws.tx.common.Constants.WSAT_FAULT_ACTION_URI;
040: import static com.sun.xml.ws.tx.common.Constants.WSCOOR_FAULT_ACTION_URI;
041:
042: import javax.xml.namespace.QName;
043:
044: /**
045: * Enumeration of ws:coor fault types.
046: * <p/>
047: * Note: fault "code" is only used in SOAP 1.2 faults and should be filled in
048: * dynamically when the SOAPFault is being constructed. All of the faults
049: * specified by ws:coor and ws:at should use SOAPConstants.SOAP_SENDER_FAULT.
050: * <p/>
051: * Note: fault "detail" is only required in SOAP 1.2 faults, but is never
052: * specified by ws:coor or ws:at, so I'm leaving this field out as well
053: *
054: * @author Ryan.Shoemaker@Sun.COM
055: * @version $Revision: 1.5 $
056: * @since 1.0
057: */
058: public enum TxFault {
059:
060: InvalidState(
061: new QName(Constants.WSCOOR_SOAP_NSURI, "InvalidState",
062: "wscoor"),
063: "The message was invalid for the current state of the activity",
064: WSCOOR_FAULT_ACTION_URI),
065:
066: InvalidProtocol(
067: new QName(Constants.WSCOOR_SOAP_NSURI, "InvalidProtocol",
068: "wscoor"),
069: "The protocol is invalid or is not supported by the coordinator",
070: WSCOOR_FAULT_ACTION_URI),
071:
072: InvalidParameters(
073: new QName(Constants.WSCOOR_SOAP_NSURI, "InvalidParameters",
074: "wscoor"),
075: "The message contained invalid parameters and could not be processed",
076: WSCOOR_FAULT_ACTION_URI),
077:
078: NoActivity(
079: new QName(Constants.WSCOOR_SOAP_NSURI, "NoActivity",
080: "wscoor"),
081: "The participant is not responding and is presumed to have ended",
082: WSCOOR_FAULT_ACTION_URI),
083:
084: ContextRefused(
085: new QName(Constants.WSCOOR_SOAP_NSURI, "ContextRefused",
086: "wscoor"),
087: "The coordination context that was provided could not be accepted",
088: WSCOOR_FAULT_ACTION_URI),
089:
090: AlreadyRegistered(
091: new QName(Constants.WSCOOR_SOAP_NSURI, "AlreadyRegistered",
092: "wscoor"),
093: "The participant has already registered for the same protocol",
094: WSCOOR_FAULT_ACTION_URI),
095:
096: InconsistentState(
097: new QName(Constants.WSAT_OASIS_NSURI, "InconsistentState",
098: "wsat"),
099: "A global consistency failure has occurred. This is an unrecoverable condition",
100: WSAT_FAULT_ACTION_URI);
101:
102: public final QName subcode;
103: public final String reason;
104: public final String actionURI;
105:
106: private TxFault(@NotNull
107: QName subcode, @NotNull
108: String reason, @NotNull
109: String action) {
110: this.subcode = subcode;
111: this.reason = reason;
112: this.actionURI = action;
113: }
114: }
|