View Javadoc

1   /*
2    * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.opensaml.ws.message;
18  
19  import org.opensaml.ws.message.handler.HandlerChainResolver;
20  import org.opensaml.ws.security.SecurityPolicyResolver;
21  import org.opensaml.ws.transport.InTransport;
22  import org.opensaml.ws.transport.OutTransport;
23  import org.opensaml.xml.XMLObject;
24  
25  /**
26   * A message context represents the entire context for a given message through the receive, process, and/or response
27   * phases. It is a basic unit of work within the library.
28   * 
29   * Message contexts are <strong>NOT</strong> thread safe.
30   */
31  public interface MessageContext {
32  
33      /**
34       * Gets the unique id of the communication profile in use.
35       * 
36       * @return unique id of the communication profile in use
37       */
38      public String getCommunicationProfileId();
39  
40      /**
41       * Gets the inbound message.
42       * 
43       * @return the inbound message
44       */
45      public XMLObject getInboundMessage();
46  
47      /**
48       * Gets the issuer of the inbound message.
49       * 
50       * @return issuer of the inbound message
51       */
52      public String getInboundMessageIssuer();
53  
54      /**
55       * Gets the transport used to receive the message.
56       * 
57       * @return transport used to receive the message
58       */
59      public InTransport getInboundMessageTransport();
60  
61      /**
62       * Gets the outbound message.
63       * 
64       * @return the outbound message
65       */
66      public XMLObject getOutboundMessage();
67  
68      /**
69       * Gets the issuer of the outbound message.
70       * 
71       * @return issuer of the outbound message
72       */
73      public String getOutboundMessageIssuer();
74  
75      /**
76       * Gets the transport used to respond to the message.
77       * 
78       * @return transport used to respond to the message
79       */
80      public OutTransport getOutboundMessageTransport();
81  
82      /**
83       * Gets the resolver used to determine active SecurityPolicy.
84       * 
85       * @return resolver used to determine active SecurityPolicy
86       */
87      public SecurityPolicyResolver getSecurityPolicyResolver();
88  
89      /**
90       * Gets whether the issuer of the inbound message represented by this context has been authenticated.
91       * What it means for the message issuer to be authenticate will vary by use and 
92       * employed authentication mechanisms.
93       * 
94       * @return whether the issuer of the inbound message represented by this context has been authenticated
95       */
96      public boolean isIssuerAuthenticated();
97  
98      /**
99       * Sets the unique id of the communication profile in use.
100      * 
101      * @param id unique id of the communication profile in use
102      */
103     public void setCommunicationProfileId(String id);
104 
105     /**
106      * Sets the inbound message.
107      * 
108      * @param message the inbound message
109      */
110     public void setInboundMessage(XMLObject message);
111 
112     /**
113      * Sets the issuer of the inbound message.
114      * 
115      * @param issuer issuer of the inbound message
116      */
117     public void setInboundMessageIssuer(String issuer);
118 
119     /**
120      * Sets the transport used to used to receive the message.
121      * 
122      * @param transport the transport used to receive the message
123      */
124     public void setInboundMessageTransport(InTransport transport);
125 
126     /**
127      * Sets the outbound message.
128      * 
129      * @param message the outbound message
130      */
131     public void setOutboundMessage(XMLObject message);
132 
133     /**
134      * Sets the issuer of the outbound message.
135      * 
136      * @param issuer issuer of the outbound message
137      */
138     public void setOutboundMessageIssuer(String issuer);
139 
140     /**
141      * Sets the transport used to respond to the message.
142      * 
143      * @param transport the transport used to respond to the message
144      */
145     public void setOutboundMessageTransport(OutTransport transport);
146 
147     /**
148      * Sets the resolver used to determine active SecurityPolicy.
149      * 
150      * @param resolver resolver used to determine active SecurityPolicy
151      */
152     public void setSecurityPolicyResolver(SecurityPolicyResolver resolver);
153     
154     /**
155      * Get the pre-SecurityPolicy inbound handler chain resolver.
156      * 
157      * @return the pre-security inbound handler chain resolver.
158      */
159     public HandlerChainResolver getPreSecurityInboundHandlerChainResolver();
160     
161     /**
162      * Set the pre-SecurityPolicy inbound handler chain resolver.
163      * 
164      * @param newHandlerChainResolver the new pre-SecurityPolicy inbound handler chain.
165      */
166     public void setPreSecurityInboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver);
167     
168     /**
169      * Get the post-SecurityPolicy inbound handler chain resolver.
170      * 
171      * @return the pre-SecurityPolicy inbound handler chain resolver.
172      */
173     public HandlerChainResolver getPostSecurityInboundHandlerChainResolver();
174     
175     /**
176      * Set the post-SecurityPolicy inbound handler chain resolver.
177      * 
178      * @param newHandlerChainResolver the new post-SecurityPolicy inbound handler chain resolver.
179      */
180     public void setPostSecurityInboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver);
181     
182     /**
183      * Get the outbound handler chain resolver.
184      * 
185      * @return the outbound handler chain resolver.
186      */
187     public HandlerChainResolver getOutboundHandlerChainResolver();
188     
189     /**
190      * Set the outbound handler chain resolver.
191      * 
192      * @param newHandlerChainResolver the new outbound handler chain resolver.
193      */
194     public void setOutboundHandlerChainResolver(HandlerChainResolver newHandlerChainResolver);
195 }