Java Code Examples for org.opensaml.xml.util.XMLHelper#marshallAttribute()

The following examples show how to use org.opensaml.xml.util.XMLHelper#marshallAttribute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResponseMarshaller.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    Response response = (Response) xmlObject;
    
    if (response.getAssertionConsumerServiceURL() != null) {
        domElement.setAttributeNS(null, Response.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME,
                response.getAssertionConsumerServiceURL());
    }
    if (response.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(Response.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                response.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    if (response.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(Response.SOAP11_ACTOR_ATTR_NAME, 
                response.getSOAP11Actor(), domElement, false);
    }
}
 
Example 2
Source File: RequestMarshaller.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    Request request = (Request) xmlObject;
    
    if (request.getProviderName() != null) {
        domElement.setAttributeNS(null, Request.PROVIDER_NAME_ATTRIB_NAME, request.getProviderName());
    }
    if (request.isPassiveXSBoolean() != null) {
        domElement.setAttributeNS(null, Request.IS_PASSIVE_NAME_ATTRIB_NAME,
                request.isPassiveXSBoolean().toString());
    }
    if (request.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                request.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    if (request.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(Request.SOAP11_ACTOR_ATTR_NAME, 
                request.getSOAP11Actor(), domElement, false);
    }
    
}
 
Example 3
Source File: SubjectConfirmationMarshaller.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    SubjectConfirmation sc = (SubjectConfirmation) samlObject;

    if (sc.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(SubjectConfirmation.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                sc.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    
    if (sc.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(SubjectConfirmation.SOAP11_ACTOR_ATTR_NAME, 
                sc.getSOAP11Actor(), domElement, false);
    }
    
    if (sc.getMethod() != null) {
        domElement.setAttributeNS(null, SubjectConfirmation.METHOD_ATTRIB_NAME, sc.getMethod());
    }
}
 
Example 4
Source File: ChannelBindingsMarshaller.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    ChannelBindings cb = (ChannelBindings) xmlObject;

    if (cb.getType() != null) {
        domElement.setAttributeNS(null, ChannelBindings.TYPE_ATTRIB_NAME, cb.getType());
    }

    if (cb.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(ChannelBindings.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                cb.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    
    if (cb.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(ChannelBindings.SOAP11_ACTOR_ATTR_NAME, 
                cb.getSOAP11Actor(), domElement, false);
    }
}
 
Example 5
Source File: SessionKeyMarshaller.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    SessionKey key = (SessionKey) samlObject;

    if (key.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(SessionKey.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                key.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    
    if (key.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(SessionKey.SOAP11_ACTOR_ATTR_NAME, 
                key.getSOAP11Actor(), domElement, false);
    }
    
    if (key.getAlgorithm() != null) {
        domElement.setAttributeNS(null, SessionKey.ALGORITHM_ATTRIB_NAME, key.getAlgorithm());
    }
}
 
Example 6
Source File: SignatureConfirmationMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    SignatureConfirmation sc = (SignatureConfirmation) xmlObject;
    
    if (!DatatypeHelper.isEmpty(sc.getWSUId())) {
        XMLHelper.marshallAttribute(SignatureConfirmation.WSU_ID_ATTR_NAME, sc.getWSUId(), domElement, true);
    }
    if (!DatatypeHelper.isEmpty(sc.getValue())) {
        domElement.setAttributeNS(null, SignatureConfirmation.VALUE_ATTRIB_NAME, sc.getValue());
    }
}
 
Example 7
Source File: RelayStateMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    RelayState relayState = (RelayState) xmlObject;
    
    if (relayState.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(RelayState.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                relayState.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    if (relayState.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(RelayState.SOAP11_ACTOR_ATTR_NAME, 
                relayState.getSOAP11Actor(), domElement, false);
    }
    
}
 
Example 8
Source File: RequestAuthenticatedMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    RequestAuthenticated ra = (RequestAuthenticated) xmlObject;
    
    if (ra.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(RequestAuthenticated.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                ra.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    if (ra.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(RequestAuthenticated.SOAP11_ACTOR_ATTR_NAME, 
                ra.getSOAP11Actor(), domElement, false);
    }
}
 
Example 9
Source File: GeneratedKeyMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    GeneratedKey key = (GeneratedKey) samlObject;

    if (key.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(GeneratedKey.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                key.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    
    if (key.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(GeneratedKey.SOAP11_ACTOR_ATTR_NAME, 
                key.getSOAP11Actor(), domElement, false);
    }
}
 
Example 10
Source File: PolicyMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    Policy policy = (Policy) xmlObject;
    
    if (policy.getName() != null) {
        domElement.setAttributeNS(null, Policy.NAME_ATTRIB_NAME, policy.getName());
    }
    
    if (policy.getWSUId() != null) {
        XMLHelper.marshallAttribute(IdBearing.WSU_ID_ATTR_NAME, policy.getWSUId(), domElement, true);
    }
    
    XMLHelper.marshallAttributeMap(policy.getUnknownAttributes(), domElement);
}
 
Example 11
Source File: SecurityTokenReferenceMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    SecurityTokenReference str = (SecurityTokenReference) xmlObject;
    
    if (!DatatypeHelper.isEmpty(str.getWSUId())) {
        XMLHelper.marshallAttribute(SecurityTokenReference.WSU_ID_ATTR_NAME, str.getWSUId(), domElement, true);
    }
    
    List<String> usages = str.getWSSEUsages();
    if (usages != null && ! usages.isEmpty()) {
        XMLHelper.marshallAttribute(SecurityTokenReference.WSSE_USAGE_ATTR_NAME, usages, domElement, false);
    }
    
    XMLHelper.marshallAttributeMap(str.getUnknownAttributes(), domElement);
}
 
Example 12
Source File: AttributedStringMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    AttributedString attributedString = (AttributedString) xmlObject;
    
    if (!DatatypeHelper.isEmpty(attributedString.getWSUId())) {
        XMLHelper.marshallAttribute(AttributedString.WSU_ID_ATTR_NAME, attributedString.getWSUId(), domElement, true);
    }
    
    XMLHelper.marshallAttributeMap(attributedString.getUnknownAttributes(), domElement);
    
}
 
Example 13
Source File: UsernameTokenMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    UsernameToken usernameToken = (UsernameToken) xmlObject;
    
    if (!DatatypeHelper.isEmpty(usernameToken.getWSUId())) {
        XMLHelper.marshallAttribute(UsernameToken.WSU_ID_ATTR_NAME, usernameToken.getWSUId(), domElement, true);
    }
    
    XMLHelper.marshallAttributeMap(usernameToken.getUnknownAttributes(), domElement);
    
}
 
Example 14
Source File: EncryptedHeaderMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    EncryptedHeader eh = (EncryptedHeader) xmlObject;
    
    if (eh.getWSUId() != null) {
        XMLHelper.marshallAttribute(EncryptedHeader.WSU_ID_ATTR_NAME, 
                eh.getWSUId(), domElement, true);
    }
    if (eh.isSOAP11MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(EncryptedHeader.SOAP11_MUST_UNDERSTAND_ATTR_NAME, 
                eh.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
    }
    if (eh.getSOAP11Actor() != null) {
        XMLHelper.marshallAttribute(EncryptedHeader.SOAP11_ACTOR_ATTR_NAME, 
                eh.getSOAP11Actor(), domElement, false);
    }
    if (eh.isSOAP12MustUnderstandXSBoolean() != null) {
        XMLHelper.marshallAttribute(EncryptedHeader.SOAP12_MUST_UNDERSTAND_ATTR_NAME, 
                eh.isSOAP12MustUnderstandXSBoolean().toString(), domElement, false);
    }
    if (eh.getSOAP12Role() != null) {
        XMLHelper.marshallAttribute(EncryptedHeader.SOAP12_ROLE_ATTR_NAME,
                eh.getSOAP12Role(), domElement, false);
    }
    if (eh.isSOAP12RelayXSBoolean() != null) {
        XMLHelper.marshallAttribute(EncryptedHeader.SOAP12_RELAY_ATTR_NAME, 
                eh.isSOAP12RelayXSBoolean().toString(), domElement, false);
    }
    
    super.marshallAttributes(xmlObject, domElement);
}
 
Example 15
Source File: AttributedDateTimeMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    AttributedDateTime dateTime = (AttributedDateTime) xmlObject;
    
    if (!DatatypeHelper.isEmpty(dateTime.getWSUId())) {
        XMLHelper.marshallAttribute(AttributedDateTime.WSU_ID_ATTR_NAME, dateTime.getWSUId(), domElement, true);
    }
    
    XMLHelper.marshallAttributeMap(dateTime.getUnknownAttributes(), domElement);
    
}
 
Example 16
Source File: TimestampMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    Timestamp timestamp = (Timestamp) xmlObject;
    
    if (!DatatypeHelper.isEmpty(timestamp.getWSUId())) {
        XMLHelper.marshallAttribute(Timestamp.WSU_ID_ATTR_NAME, timestamp.getWSUId(), domElement, true);
    }
    
    XMLHelper.marshallAttributeMap(timestamp.getUnknownAttributes(), domElement);
}
 
Example 17
Source File: AttributedURIMarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    AttributedURI attributedURI = (AttributedURI) xmlObject;
    
    if (!DatatypeHelper.isEmpty(attributedURI.getWSUId())) {
        XMLHelper.marshallAttribute(AttributedURI.WSU_ID_ATTR_NAME, attributedURI.getWSUId(), domElement, true);
    }
    
    XMLHelper.marshallAttributeMap(attributedURI.getUnknownAttributes(), domElement);
    
}