Пример #1
0
  public void writeIndexedEndpointType(IndexedEndpointType indexedEndpoint)
      throws ProcessingException {
    writeEndpointType(indexedEndpoint);
    if (indexedEndpoint.isIsDefault() != null)
      StaxUtil.writeAttribute(
          writer, JBossSAMLConstants.ISDEFAULT.get(), "" + indexedEndpoint.isIsDefault());

    StaxUtil.writeAttribute(
        writer, JBossSAMLConstants.INDEX.get(), "" + indexedEndpoint.getIndex());

    StaxUtil.writeEndElement(writer);
    StaxUtil.flush(writer);
  }
Пример #2
0
  public void writeAttributeConsumingService(AttributeConsumingServiceType attributeConsumer)
      throws ProcessingException {
    StaxUtil.writeStartElement(
        writer,
        METADATA_PREFIX,
        JBossSAMLConstants.ATTRIBUTE_CONSUMING_SERVICE.get(),
        METADATA_NSURI.get());

    StaxUtil.writeAttribute(
        writer, JBossSAMLConstants.ISDEFAULT.get(), "" + attributeConsumer.isIsDefault());
    StaxUtil.writeAttribute(
        writer, JBossSAMLConstants.INDEX.get(), "" + attributeConsumer.getIndex());

    // Service Name
    List<LocalizedNameType> serviceNames = attributeConsumer.getServiceName();
    for (LocalizedNameType serviceName : serviceNames) {
      writeLocalizedNameType(
          serviceName,
          new QName(METADATA_NSURI.get(), JBossSAMLConstants.SERVICE_NAME.get(), METADATA_PREFIX));
    }

    List<LocalizedNameType> serviceDescriptions = attributeConsumer.getServiceDescription();
    for (LocalizedNameType serviceDescription : serviceDescriptions) {
      writeLocalizedNameType(
          serviceDescription,
          new QName(
              METADATA_NSURI.get(), JBossSAMLConstants.SERVICE_DESCRIPTION.get(), METADATA_PREFIX));
    }

    List<RequestedAttributeType> requestedAttributes = attributeConsumer.getRequestedAttribute();
    for (RequestedAttributeType requestedAttribute : requestedAttributes) {
      StaxUtil.writeStartElement(
          writer,
          METADATA_PREFIX,
          JBossSAMLConstants.REQUESTED_ATTRIBUTE.get(),
          METADATA_NSURI.get());
      Boolean isRequired = requestedAttribute.isIsRequired();
      if (isRequired != null) {
        StaxUtil.writeAttribute(
            writer, new QName(JBossSAMLConstants.IS_REQUIRED.get()), isRequired.toString());
      }
      writeAttributeTypeWithoutRootTag(requestedAttribute);
      StaxUtil.writeEndElement(writer);
    }

    StaxUtil.writeEndElement(writer);
    StaxUtil.flush(writer);
  }