001: /*
002: * The contents of this file are subject to the terms
003: * of the Common Development and Distribution License
004: * (the License). You may not use this file except in
005: * compliance with the License.
006: *
007: * You can obtain a copy of the license at
008: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
009: * See the License for the specific language governing
010: * permissions and limitations under the License.
011: *
012: * When distributing Covered Code, include this CDDL
013: * Header Notice in each file and include the License file
014: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
015: * If applicable, add the following below the CDDL Header,
016: * with the fields enclosed by brackets [] replaced by
017: * you own identifying information:
018: * "Portions Copyrighted [year] [name of copyright owner]"
019: *
020: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
021: */
022:
023: /*
024: * SecurityProcessingContext.java
025: *
026: * Created on January 30, 2006, 4:51 PM
027: *
028: * To change this template, choose Tools | Template Manager
029: * and open the template in the editor.
030: */
031:
032: package com.sun.xml.wss;
033:
034: import com.sun.xml.wss.impl.policy.SecurityPolicy;
035: import com.sun.xml.wss.impl.policy.StaticPolicyContext;
036: import java.util.Map;
037: import javax.security.auth.callback.CallbackHandler;
038: import javax.xml.soap.SOAPMessage;
039:
040: /**
041: *
042: * @author Vbkumar.Jayanti@Sun.COM
043: * @author K.Venugopal@sun.com
044: */
045: public interface SecurityProcessingContext {
046: /**
047: * copy operator
048: *
049: * @param ctx1 the ProcessingContext to which to copy
050: * @param ctx2 the ProcessingContext from which to copy
051: * @throws XWSSecurityException if there was an error during the copy operation
052: */
053: void copy(SecurityProcessingContext ctx1,
054: SecurityProcessingContext ctx2) throws XWSSecurityException;
055:
056: /**
057: * This method is used for internal purposes
058: */
059: int getConfigType();
060:
061: /**
062: * Properties extraneously defined by XWSS runtime - can contain
063: * application's runtime context (like JAXRPCContext etc)
064: *
065: *
066: * @return Map of extraneous properties
067: */
068: Map getExtraneousProperties();
069:
070: /**
071: *
072: *
073: * @return the value for the named extraneous property.
074: */
075: Object getExtraneousProperty(String name);
076:
077: /**
078: *
079: *
080: * @return the CallbackHandler set for the context
081: */
082: CallbackHandler getHandler();
083:
084: /**
085: *
086: *
087: * @return message identifier for the Message in the context
088: */
089: String getMessageIdentifier();
090:
091: /**
092: *
093: *
094: * @return StaticPolicyContext associated with this ProcessingContext, null otherwise
095: */
096: StaticPolicyContext getPolicyContext();
097:
098: /**
099: *
100: *
101: * @return the SOAPMessage from the context
102: */
103: SOAPMessage getSOAPMessage();
104:
105: /**
106: *
107: *
108: * @return The SecurityEnvironment Handler set for the context
109: */
110: SecurityEnvironment getSecurityEnvironment();
111:
112: /**
113: *
114: *
115: * @return SecurityPolicy for this context
116: */
117: SecurityPolicy getSecurityPolicy();
118:
119: /**
120: *
121: *
122: * @return message flow direction, true if incoming, false otherwise
123: */
124: boolean isInboundMessage();
125:
126: /**
127: * set the message flow direction (to true if inbound, false if outbound)
128: *
129: * @param inBound message flow direction
130: */
131: void isInboundMessage(boolean inBound);
132:
133: /**
134: * remove the named extraneous property if present
135: *
136: * @param name the Extraneous Property to be removed
137: */
138: void removeExtraneousProperty(String name);
139:
140: /**
141: * This method is used for internal purposes
142: */
143: void reset();
144:
145: /**
146: * This method is used for internal purposes
147: */
148: void setConfigType(int type);
149:
150: /**
151: * set the extraneous property into the context
152: * Extraneous Properties are properties extraneously defined by XWSS runtime
153: * and can contain application's runtime context (like JAXRPCContext etc)
154: *
155: * @param name the property name
156: * @param value the property value
157: */
158: void setExtraneousProperty(String name, Object value);
159:
160: /**
161: * set the CallbackHandler for the context
162: *
163: * @param handler The CallbackHandler
164: */
165: void setHandler(CallbackHandler handler);
166:
167: /**
168: * Allow for message identifier to be generated externally
169: *
170: * @param identifier the Message Identifier value
171: */
172: void setMessageIdentifier(String identifier);
173:
174: /**
175: * set the StaticPolicyContext for this ProcessingContext.
176: *
177: * @param context StaticPolicyContext for this context
178: */
179: void setPolicyContext(StaticPolicyContext context);
180:
181: /**
182: * set the SOAP Message into the ProcessingContext.
183: *
184: * @param message SOAPMessage
185: * @throws XWSSecurityException if there was an error in setting the SOAPMessage
186: */
187: void setSOAPMessage(SOAPMessage message)
188: throws XWSSecurityException;
189:
190: /**
191: * set the SecurityEnvironment Handler for the context
192: *
193: * @param handler The SecurityEnvironment Handler
194: */
195: void setSecurityEnvironment(SecurityEnvironment handler);
196:
197: /**
198: * set the SecurityPolicy for the context
199: *
200: * @param securityPolicy SecurityPolicy
201: * @throws XWSSecurityException if the securityPolicy is of invalid type
202: */
203: void setSecurityPolicy(SecurityPolicy securityPolicy)
204: throws XWSSecurityException;
205:
206: }
|