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