示例#1
0
  /** {@inheritDoc} */
  protected void processAttribute(XMLObject samlObject, Attr attribute)
      throws UnmarshallingException {
    Action action = (Action) samlObject;

    if (attribute.getLocalName().equals(Action.NAMEPSACE_ATTRIB_NAME)) {
      action.setNamespace(attribute.getValue());
    } else {
      super.processAttribute(samlObject, attribute);
    }
  }
  /** {@inheritDoc} */
  protected void processChildElement(XMLObject parentObject, XMLObject childObject)
      throws UnmarshallingException {
    AttributeStatement attributeStatement = (AttributeStatement) parentObject;

    if (childObject instanceof Attribute) {
      attributeStatement.getAttributes().add((Attribute) childObject);
    } else if (childObject instanceof EncryptedAttribute) {
      attributeStatement.getEncryptedAttributes().add((EncryptedAttribute) childObject);
    } else {
      super.processChildElement(parentObject, childObject);
    }
  }
  /**
   * Process child element.
   *
   * @param parentSAMLObject parent SAMLObject
   * @param childSAMLObject child SAMLObject
   * @throws UnmarshallingException error at unmarshall XML object
   */
  protected final void processChildElement(
      final XMLObject parentSAMLObject, final XMLObject childSAMLObject)
      throws UnmarshallingException {

    final RequestedAttribute requestedAttr = (RequestedAttribute) parentSAMLObject;

    final QName childQName = childSAMLObject.getElementQName();
    if ("AttributeValue".equals(childQName.getLocalPart())
        && childQName.getNamespaceURI().equals(SAMLCore.STORK10_NS.getValue())) {
      requestedAttr.getAttributeValues().add(childSAMLObject);
    } else {
      super.processChildElement(parentSAMLObject, childSAMLObject);
    }
  }
示例#4
0
  /** {@inheritDoc} */
  protected void processAttribute(XMLObject samlObject, Attr attribute)
      throws UnmarshallingException {
    Response response = (Response) samlObject;

    QName attrName = XMLHelper.getNodeQName(attribute);
    if (Response.SOAP11_MUST_UNDERSTAND_ATTR_NAME.equals(attrName)) {
      response.setSOAP11MustUnderstand(XSBooleanValue.valueOf(attribute.getValue()));
    } else if (Response.SOAP11_ACTOR_ATTR_NAME.equals(attrName)) {
      response.setSOAP11Actor(attribute.getValue());
    } else if (Response.REF_TO_MESSAGE_ID_ATTRIB_NAME.equals(attribute.getLocalName())) {
      response.setRefToMessageID(attribute.getValue());
    } else {
      super.processAttribute(samlObject, attribute);
    }
  }
  /** {@inheritDoc} */
  protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
      throws UnmarshallingException {
    EntityDescriptor entityDescriptor = (EntityDescriptor) parentSAMLObject;

    if (childSAMLObject instanceof Extensions) {
      entityDescriptor.setExtensions((Extensions) childSAMLObject);
    } else if (childSAMLObject instanceof Signature) {
      entityDescriptor.setSignature((Signature) childSAMLObject);
    } else if (childSAMLObject instanceof RoleDescriptor) {
      entityDescriptor.getRoleDescriptors().add((RoleDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof AffiliationDescriptor) {
      entityDescriptor.setAffiliationDescriptor((AffiliationDescriptor) childSAMLObject);
    } else if (childSAMLObject instanceof Organization) {
      entityDescriptor.setOrganization((Organization) childSAMLObject);
    } else if (childSAMLObject instanceof ContactPerson) {
      entityDescriptor.getContactPersons().add((ContactPerson) childSAMLObject);
    } else if (childSAMLObject instanceof AdditionalMetadataLocation) {
      entityDescriptor
          .getAdditionalMetadataLocations()
          .add((AdditionalMetadataLocation) childSAMLObject);
    } else {
      super.processChildElement(parentSAMLObject, childSAMLObject);
    }
  }