View Javadoc
1   /*
2    * Copyright 2005 the original author or authors.
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.springframework.ws.soap.server;
18  
19  import org.springframework.ws.server.EndpointInterceptor;
20  import org.springframework.ws.server.EndpointInvocationChain;
21  
22  /**
23   * SOAP-specific subclass of the <code>EndpointInvocationChain</code>. Adds associated actors (SOAP 1.1) or roles (SOAP
24   * 1.2). Used by the <code>SoapMessageDispatcher</code> to determine the MustUnderstand headers for particular
25   * endpoint.
26   *
27   * @author Arjen Poutsma
28   * @see #getActorsOrRoles()
29   * @see SoapMessageDispatcher
30   * @since 1.0.0
31   */
32  public class SoapEndpointInvocationChain extends EndpointInvocationChain {
33  
34      private String[] actorsOrRoles;
35  
36      private boolean isUltimateReceiver = true;
37  
38      /**
39       * Create new <code>SoapEndpointInvocationChain</code>.
40       *
41       * @param endpoint the endpoint object to invoke
42       */
43      public SoapEndpointInvocationChain(Object endpoint) {
44          super(endpoint);
45      }
46  
47      /**
48       * Create new <code>SoapEndpointInvocationChain</code>.
49       *
50       * @param endpoint     the endpoint object to invoke
51       * @param interceptors the array of interceptors to apply
52       */
53      public SoapEndpointInvocationChain(Object endpoint, EndpointInterceptor[] interceptors) {
54          super(endpoint, interceptors);
55      }
56  
57      /**
58       * Create new <code>EndpointInvocationChain</code>.
59       *
60       * @param endpoint           the endpoint object to invoke
61       * @param interceptors       the array of interceptors to apply
62       * @param actorsOrRoles      the array of actorsOrRoles to set
63       * @param isUltimateReceiver whether this chain fullfils the SOAP 1.2 Ultimate receiver role
64       */
65      public SoapEndpointInvocationChain(Object endpoint,
66                                         EndpointInterceptor[] interceptors,
67                                         String[] actorsOrRoles,
68                                         boolean isUltimateReceiver) {
69          super(endpoint, interceptors);
70          this.actorsOrRoles = actorsOrRoles;
71          this.isUltimateReceiver = isUltimateReceiver;
72      }
73  
74      /**
75       * Gets the actors (SOAP 1.1) or roles (SOAP 1.2) associated with an invocation of this chain and its contained
76       * interceptors and endpoint.
77       *
78       * @return a string array of URIs for SOAP actors/roles
79       */
80      public String[] getActorsOrRoles() {
81          return actorsOrRoles;
82      }
83  
84      /** Indicates whether this chain fulfills the SOAP 1.2 Ultimate Receiver role. Default is <code>true</code>. */
85      public boolean isUltimateReceiver() {
86          return isUltimateReceiver;
87      }
88  }