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.security.SecurityPolicyResolver;
20  import org.opensaml.ws.transport.InTransport;
21  import org.opensaml.ws.transport.OutTransport;
22  import org.opensaml.xml.XMLObject;
23  
24  /**
25   * A message context represents the entire context for a given message through the receive, process, and/or response
26   * phases. It is a basic unit of work within the library.
27   * 
28   * Message contexts are <strong>NOT</strong> thread safe.
29   */
30  public interface MessageContext {
31  
32      /**
33       * Gets the unique id of the communication profile in use.
34       * 
35       * @return unique id of the communication profile in use
36       */
37      public String getCommunicationProfileId();
38  
39      /**
40       * Gets the inbound message.
41       * 
42       * @return the inbound message
43       */
44      public XMLObject getInboundMessage();
45  
46      /**
47       * Gets the issuer of the inbound message.
48       * 
49       * @return issuer of the inbound message
50       */
51      public String getInboundMessageIssuer();
52  
53      /**
54       * Gets the transport used to receive the message.
55       * 
56       * @return transport used to receive the message
57       */
58      public InTransport getInboundMessageTransport();
59  
60      /**
61       * Gets the outbound message.
62       * 
63       * @return the outbound message
64       */
65      public XMLObject getOutboundMessage();
66  
67      /**
68       * Gets the issuer of the outbound message.
69       * 
70       * @return issuer of the outbound message
71       */
72      public String getOutboundMessageIssuer();
73  
74      /**
75       * Gets the transport used to respond to the message.
76       * 
77       * @return transport used to respond to the message
78       */
79      public OutTransport getOutboundMessageTransport();
80  
81      /**
82       * Gets the resolver used to determine active SecurityPolicy.
83       * 
84       * @return resolver used to determine active SecurityPolicy
85       */
86      public SecurityPolicyResolver getSecurityPolicyResolver();
87  
88      /**
89       * Gets whether the issuer of the inbound message represented by this context has been authenticated.
90       * What it means for the message issuer to be authenticate will vary by use and 
91       * employed authentication mechanisms.
92       * 
93       * @return whether the issuer of the inbound message represented by this context has been authenticated
94       */
95      public boolean isIssuerAuthenticated();
96  
97      /**
98       * Sets the unique id of the communication profile in use.
99       * 
100      * @param id unique id of the communication profile in use
101      */
102     public void setCommunicationProfileId(String id);
103 
104     /**
105      * Sets the inbound message.
106      * 
107      * @param message the inbound message
108      */
109     public void setInboundMessage(XMLObject message);
110 
111     /**
112      * Sets the issuer of the inbound message.
113      * 
114      * @param issuer issuer of the inbound message
115      */
116     public void setInboundMessageIssuer(String issuer);
117 
118     /**
119      * Sets the transport used to used to receive the message.
120      * 
121      * @param transport the transport used to receive the message
122      */
123     public void setInboundMessageTransport(InTransport transport);
124 
125     /**
126      * Sets the outbound message.
127      * 
128      * @param message the outbound message
129      */
130     public void setOutboundMessage(XMLObject message);
131 
132     /**
133      * Sets the issuer of the outbound message.
134      * 
135      * @param issuer issuer of the outbound message
136      */
137     public void setOutboundMessageIssuer(String issuer);
138 
139     /**
140      * Sets the transport used to respond to the message.
141      * 
142      * @param transport the transport used to respond to the message
143      */
144     public void setOutboundMessageTransport(OutTransport transport);
145 
146     /**
147      * Sets the resolver used to determine active SecurityPolicy.
148      * 
149      * @param resolver resolver used to determine active SecurityPolicy
150      */
151     public void setSecurityPolicyResolver(SecurityPolicyResolver resolver);
152 }