View Javadoc

1   /*
2    * Copyright 2009 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.saml2.ecp.impl;
18  
19  import java.util.List;
20  
21  import org.opensaml.common.impl.AbstractSAMLObject;
22  import org.opensaml.saml2.ecp.Response;
23  import org.opensaml.xml.XMLObject;
24  import org.opensaml.xml.schema.XSBooleanValue;
25  
26  /**
27   * A concrete implementation of {@link Response}.
28   */
29  public class ResponseImpl extends AbstractSAMLObject implements Response {
30      
31      /** soap11:actor attribute. */
32      private String soap11Actor;
33      
34      /** soap11:mustUnderstand. */
35      private XSBooleanValue soap11MustUnderstand;
36      
37      /** The AssertionConsumerServiceURL attribute value. */
38      private String acsURL;
39      
40      /**
41       * Constructor.
42       * 
43       * @param namespaceURI the namespace the element is in
44       * @param elementLocalName the local name of the XML element this Object represents
45       * @param namespacePrefix the prefix for the given namespace
46       */
47      protected ResponseImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
48          super(namespaceURI, elementLocalName, namespacePrefix);
49      }
50  
51      /** {@inheritDoc} */
52      public String getAssertionConsumerServiceURL() {
53          return acsURL;
54      }
55  
56      /** {@inheritDoc} */
57      public void setAssertionConsumerServiceURL(String newAssertionConsumerServiceURL) {
58          acsURL = prepareForAssignment(acsURL, newAssertionConsumerServiceURL);
59      }
60      
61      /** {@inheritDoc} */
62      public Boolean isSOAP11MustUnderstand() {
63          if (soap11MustUnderstand != null) {
64              return soap11MustUnderstand.getValue();
65          }
66          return Boolean.FALSE;
67      }
68  
69      /** {@inheritDoc} */
70      public XSBooleanValue isSOAP11MustUnderstandXSBoolean() {
71          return soap11MustUnderstand;
72      }
73  
74      /** {@inheritDoc} */
75      public void setSOAP11MustUnderstand(Boolean newMustUnderstand) {
76          if (newMustUnderstand != null) {
77              soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, 
78                      new XSBooleanValue(newMustUnderstand, true));
79          } else {
80              soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, null);
81          }
82      }
83  
84      /** {@inheritDoc} */
85      public void setSOAP11MustUnderstand(XSBooleanValue newMustUnderstand) {
86              soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, newMustUnderstand);
87      }
88  
89      /** {@inheritDoc} */
90      public String getSOAP11Actor() {
91          return soap11Actor;
92      }
93  
94      /** {@inheritDoc} */
95      public void setSOAP11Actor(String newActor) {
96          soap11Actor = prepareForAssignment(soap11Actor, newActor);
97      }
98      
99      /** {@inheritDoc} */
100     public List<XMLObject> getOrderedChildren() {
101         return null;
102     }
103 
104 }