01: /*
02: * The contents of this file are subject to the terms
03: * of the Common Development and Distribution License
04: * (the License). You may not use this file except in
05: * compliance with the License.
06: *
07: * You can obtain a copy of the license at
08: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
09: * See the License for the specific language governing
10: * permissions and limitations under the License.
11: *
12: * When distributing Covered Code, include this CDDL
13: * Header Notice in each file and include the License file
14: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
15: * If applicable, add the following below the CDDL Header,
16: * with the fields enclosed by brackets [] replaced by
17: * you own identifying information:
18: * "Portions Copyrighted [year] [name of copyright owner]"
19: *
20: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
21: */
22:
23: package com.sun.xml.wss;
24:
25: import javax.xml.soap.SOAPMessage;
26:
27: /**
28: *<code>XWSSProcessor</code> interface defines methods for
29: *<UL>
30: * <LI> Securing an outbound <code>SOAPMessage</Code>
31: * <LI> Verifying the security in an inbound <code>SOAPMessage</code>
32: *</UL>
33: *
34: * An <code>XWSSProcessor</code> can add/verify Security in a
35: * <code>SOAPMessage</code> as defined by the OASIS WSS 1.0 specification.
36: */
37: public interface XWSSProcessor {
38:
39: /**
40: * Adds Security to an outbound <code>SOAPMessage</Code> according to
41: * the Security Policy inferred from the <code>SecurityConfiguration</code>
42: * with which this <code>XWSSProcessor</code> was initialized.
43: *
44: * @param messageCntxt the SOAP <code>ProcessingContext</code> containing
45: * the outgoing <code>SOAPMessage</code> to be secured
46: *
47: * @return the resultant Secure <code>SOAPMessage</code>
48: *
49: * @exception XWSSecurityException if there was an error in securing
50: * the message.
51: */
52: public SOAPMessage secureOutboundMessage(
53: ProcessingContext messageCntxt) throws XWSSecurityException;
54:
55: /**
56: * Verifies Security in an inbound <code>SOAPMessage</Code> according to
57: * the Security Policy inferred from the <code>SecurityConfiguration</code>
58: * with which this <code>XWSSProcessor</code> was initialized.
59: *
60: * @param messageCntxt the SOAP <code>ProcessingContext</code> containing the
61: * outgoing <code>SOAPMessage</code> to be secured
62: *
63: * @return the resultant <code>SOAPMessage</code> after successful
64: * verification of security in the message
65: *
66: *
67: * @exception XWSSecurityException if there was an unexpected error
68: * while verifying the message.OR if the security in the incoming
69: * message violates the Security policy that was applied to the message.
70: * @exception WssSoapFaultException when security in the incoming message
71: * is in direct violation of the OASIS WSS specification.
72: * When a WssSoapFaultException is thrown the getFaultCode() method on it
73: * will return a <code>QName</code> which would correspond to the
74: * WSS defined fault.
75: */
76: public SOAPMessage verifyInboundMessage(
77: ProcessingContext messageCntxt) throws XWSSecurityException;
78:
79: /**
80: * Create a Processing Context initialized with the given SOAPMessage
81: * @param msg the SOAPMessage with which to initialize the ProcessingContext
82: * @return A ProcessingContext instance.
83: */
84: public ProcessingContext createProcessingContext(SOAPMessage msg)
85: throws XWSSecurityException;
86: }
|