001: /*
002: * $Id: WSTrustSOAPFaultException.java,v 1.3 2007/05/29 22:11:29 ofung Exp $
003: */
004:
005: /*
006: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
007: *
008: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
009: *
010: * The contents of this file are subject to the terms of either the GNU
011: * General Public License Version 2 only ("GPL") or the Common Development
012: * and Distribution License("CDDL") (collectively, the "License"). You
013: * may not use this file except in compliance with the License. You can obtain
014: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
015: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
016: * language governing permissions and limitations under the License.
017: *
018: * When distributing the software, include this License Header Notice in each
019: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
020: * Sun designates this particular file as subject to the "Classpath" exception
021: * as provided by Sun in the GPL Version 2 section of the License file that
022: * accompanied this code. If applicable, add the following below the License
023: * Header, with the fields enclosed by brackets [] replaced by your own
024: * identifying information: "Portions Copyrighted [year]
025: * [name of copyright owner]"
026: *
027: * Contributor(s):
028: *
029: * If you wish your version of this file to be governed by only the CDDL or
030: * only the GPL Version 2, indicate your decision by adding "[Contributor]
031: * elects to include this software in this distribution under the [CDDL or GPL
032: * Version 2] license." If you don't indicate a single choice of license, a
033: * recipient has the option to distribute your version of this file under
034: * either the CDDL, the GPL Version 2 or to extend the choice of license to
035: * its licensees as provided above. However, if you add GPL Version 2 code
036: * and therefore, elected the GPL Version 2 license, then the option applies
037: * only if the new code is made subject to such option by the copyright
038: * holder.
039: */
040:
041: package com.sun.xml.ws.security.trust;
042:
043: import javax.xml.namespace.QName;
044:
045: /**
046: * Captures the SOAPFault that needs to be thrown by an STS when a processing error occurs
047: * @author Kumar Jayanti
048: */
049: public class WSTrustSOAPFaultException extends RuntimeException {
050:
051: public static final QName WS_TRUST_INVALID_REQUEST_FAULT = new QName(
052: WSTrustConstants.WST_NAMESPACE, "InvalidRequest",
053: WSTrustConstants.WST_PREFIX);
054: public static final QName WS_TRUST_FAILED_AUTHENTICATION_FAULT = new QName(
055: WSTrustConstants.WST_NAMESPACE, "FailedAuthentication",
056: WSTrustConstants.WST_PREFIX);
057: public static final QName WS_TRUST_REQUEST_FAILED_FAULT = new QName(
058: WSTrustConstants.WST_NAMESPACE, "RequestFailed",
059: WSTrustConstants.WST_PREFIX);
060: public static final QName WS_TRUST_INVALID_SECURITYTOKEN_FAULT = new QName(
061: WSTrustConstants.WST_NAMESPACE, "InvalidSecurityToken",
062: WSTrustConstants.WST_PREFIX);
063: public static final QName WS_TRUST_AUTHENTICATION_BAD_ELEMENTS_FAULT = new QName(
064: WSTrustConstants.WST_NAMESPACE,
065: "AuthenticationBadElements", WSTrustConstants.WST_PREFIX);
066: public static final QName WS_TRUST_EXPIRED_DATA_FAULT = new QName(
067: WSTrustConstants.WST_NAMESPACE, "ExpiredData",
068: WSTrustConstants.WST_PREFIX);
069: public static final QName WS_TRUST_INVALID_TIMERANGE_FAULT = new QName(
070: WSTrustConstants.WST_NAMESPACE, "InvalidTimeRange",
071: WSTrustConstants.WST_PREFIX);
072: public static final QName WS_TRUST_INVALID_SCOPE_FAULT = new QName(
073: WSTrustConstants.WST_NAMESPACE, "InvalidScope",
074: WSTrustConstants.WST_PREFIX);
075: public static final QName WS_TRUST_RENEW_NEEDED_FAULT = new QName(
076: WSTrustConstants.WST_NAMESPACE, "RenewNeeded",
077: WSTrustConstants.WST_PREFIX);
078: public static final QName WS_TRUST_UNABLE_TO_RENEW_FAULT = new QName(
079: WSTrustConstants.WST_NAMESPACE, "UnableToRenew",
080: WSTrustConstants.WST_PREFIX);
081: public static final QName WS_TRUST_BAD_REQUEST_FAULT = new QName(
082: WSTrustConstants.WST_NAMESPACE, "BadRequest",
083: WSTrustConstants.WST_PREFIX);
084:
085: public static final String WS_TRUST_INVALID_REQUEST_FAULTSTRING = "The request was invalid or malformed";
086: public static final String WS_TRUST_FAILED_AUTHENTICATION_FAULTSTRING = "Authentication Failed";
087: public static final String WS_TRUST_REQUEST_FAILED_FAULTSTRING = "The specified request failed";
088: public static final String WS_TRUST_INVALID_SECURITYTOKEN_FAULTSTRING = "Security Token has been Revoked";
089: public static final String WS_TRUST_AUTHENTICATION_BAD_ELEMENTS_FAULTSTRING = "Insufficient Digest Elements";
090: public static final String WS_TRUST_BAD_REQUEST_FAULTSTRING = "The specified RequestSecurityToken is not understood";
091: public static final String WS_TRUST_EXPIRED_DATA_FAULTSTRING = "The request data is out-of-date";
092: public static final String WS_TRUST_INVALID_TIMERANGE_FAULTSTRING = "The requested time range is invalid or unsupported";
093: public static final String WS_TRUST_INVALID_SCOPE_FAULTSTRING = "The request scope is invalid or unsupported";
094: public static final String WS_TRUST_RENEW_NEEDED_FAULTSTRING = "A renewable security token has expired";
095: public static final String WS_TRUST_UNABLE_TO_RENEW_FAULTSTRING = "The requested renewal failed";
096:
097: private final QName faultCode;
098: private final String faultString;
099:
100: /**
101: * Creates a new instance of WSTrustSOAPFaultException
102: */
103: public WSTrustSOAPFaultException(String message, Throwable cause,
104: QName faultCode, String faultString) {
105: super (message, cause);
106: this .faultCode = faultCode;
107: this .faultString = faultString;
108: }
109:
110: /**
111: * Get the FaultString for this exception
112: */
113: public String getFaultString() {
114: return faultString;
115: }
116:
117: /**
118: * Get the FaultCode (QName) for this exception
119: */
120: public QName getFaultCode() {
121: return faultCode;
122: }
123:
124: }
|