org.opensaml.xml.io.MarshallingException Java Examples

The following examples show how to use org.opensaml.xml.io.MarshallingException. 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 Project: lams   Author: lamsfoundation   File: BaseMessageEncoder.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Helper method that marshalls the given message.
 * 
 * @param message message the marshall and serialize
 * 
 * @return marshalled message
 * 
 * @throws MessageEncodingException thrown if the give message can not be marshalled into its DOM representation
 */
protected Element marshallMessage(XMLObject message) throws MessageEncodingException {
    log.debug("Marshalling message");

    try {
        Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(message);
        if (marshaller == null) {
            log.error("Unable to marshall message, no marshaller registered for message object: "
                    + message.getElementQName());
            throw new MessageEncodingException(
                    "Unable to marshall message, no marshaller registered for message object: "
                    + message.getElementQName());
        }
        Element messageElem = marshaller.marshall(message);
        if (log.isTraceEnabled()) {
            log.trace("Marshalled message into DOM:\n{}", XMLHelper.nodeToString(messageElem));
        }
        return messageElem;
    } catch (MarshallingException e) {
        log.error("Encountered error marshalling message to its DOM representation", e);
        throw new MessageEncodingException("Encountered error marshalling message into its DOM representation", e);
    }
}
 
Example #2
Source Project: lams   Author: lamsfoundation   File: KeyDescriptorMarshaller.java    License: GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    KeyDescriptor keyDescriptor = (KeyDescriptor) xmlObject;

    if (keyDescriptor.getUse() != null) {
        UsageType use = keyDescriptor.getUse();
        // UsageType enum contains more values than are allowed by SAML 2 schema
        if (use.equals(UsageType.SIGNING) || use.equals(UsageType.ENCRYPTION)) {
            domElement.setAttribute(KeyDescriptor.USE_ATTRIB_NAME, use.toString().toLowerCase());
        } else if (use.equals(UsageType.UNSPECIFIED)) {
            // emit nothing for unspecified - this is semantically equivalent to non-existent attribute
        } else {
            // Just in case values are unknowingly added to UsageType in the future...
            throw new MarshallingException("KeyDescriptor had illegal value for use attribute: " + use.toString());
        }
    }
}
 
Example #3
Source Project: lams   Author: lamsfoundation   File: AssertionMarshaller.java    License: GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    Assertion assertion = (Assertion) samlObject;

    if (assertion.getVersion() != null) {
        domElement.setAttributeNS(null, Assertion.VERSION_ATTRIB_NAME, assertion.getVersion().toString());
    }

    if (assertion.getIssueInstant() != null) {
        String issueInstantStr = Configuration.getSAMLDateFormatter().print(assertion.getIssueInstant());
        domElement.setAttributeNS(null, Assertion.ISSUE_INSTANT_ATTRIB_NAME, issueInstantStr);
    }

    if (assertion.getID() != null) {
        domElement.setAttributeNS(null, Assertion.ID_ATTRIB_NAME, assertion.getID());
        domElement.setIdAttributeNS(null, Assertion.ID_ATTRIB_NAME, true);
    }
}
 
Example #4
Source Project: lams   Author: lamsfoundation   File: EncryptedTypeMarshaller.java    License: GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    EncryptedType et = (EncryptedType) xmlObject;

    if (et.getID() != null) {
        domElement.setAttributeNS(null, EncryptedType.ID_ATTRIB_NAME, et.getID());
        domElement.setIdAttributeNS(null, EncryptedType.ID_ATTRIB_NAME, true);
    }

    if (et.getType() != null) {
        domElement.setAttributeNS(null, EncryptedType.TYPE_ATTRIB_NAME, et.getType());
    }

    if (et.getMimeType() != null) {
        domElement.setAttributeNS(null, EncryptedType.MIMETYPE_ATTRIB_NAME, et.getMimeType());
    }

    if (et.getEncoding() != null) {
        domElement.setAttributeNS(null, EncryptedType.ENCODING_ATTRIB_NAME, et.getEncoding());
    }

}
 
Example #5
Source Project: lams   Author: lamsfoundation   File: Decrypter.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Ensure that the XMLObject is marshalled.
 * 
 * @param xmlObject the object to check and marshall
 * @throws DecryptionException thrown if there is an error when marshalling the XMLObject
 */
protected void checkAndMarshall(XMLObject xmlObject) throws DecryptionException {
    Element targetElement = xmlObject.getDOM();
    if (targetElement == null) {
        Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(xmlObject);
        if (marshaller == null) {
            marshaller =
                    Configuration.getMarshallerFactory().getMarshaller(Configuration.getDefaultProviderQName());
            if (marshaller == null) {
                String errorMsg = "No marshaller available for " + xmlObject.getElementQName();
                log.error(errorMsg);
                throw new DecryptionException(errorMsg);
            }
        }
        try {
            targetElement = marshaller.marshall(xmlObject);
        } catch (MarshallingException e) {
            log.error("Error marshalling target XMLObject", e);
            throw new DecryptionException("Error marshalling target XMLObject", e);
        }
    }
}
 
Example #6
Source Project: lams   Author: lamsfoundation   File: ResponseMarshaller.java    License: 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 #7
Source Project: lams   Author: lamsfoundation   File: MissingAttributeDetailTypeMarshaller.java    License: GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    MissingAttributeDetailType madt = (MissingAttributeDetailType) xmlObject;

    if (madt.getAttributeId() != null) {
        domElement.setAttributeNS(null, MissingAttributeDetailType.ATTRIBUTE_ID_ATTRIB_NAME, madt.getAttributeId());
    }

    if (madt.getDataType() != null) {
        domElement.setAttributeNS(null, MissingAttributeDetailType.DATA_TYPE_ATTRIB_NAME, madt.getDataType());
    }

    if (madt.getIssuer() != null) {
        domElement.setAttributeNS(null, MissingAttributeDetailType.ISSUER_ATTRIB_NAME, madt.getIssuer());
    }
}
 
Example #8
Source Project: lams   Author: lamsfoundation   File: AttributeTypeMarshaller.java    License: GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
    AttributeType attribute = (AttributeType) samlElement;

    if (attribute.getIssuer() != null) {
        domElement.setAttributeNS(null, AttributeType.ISSUER_ATTRIB_NAME, attribute.getIssuer());
    }

    if (attribute.getDataType() != null) {
        domElement.setAttributeNS(null, AttributeType.DATATYPE_ATTRIB_NAME, attribute.getDataType());
    }

    if (attribute.getAttributeID() != null) {
        domElement.setAttributeNS(null, AttributeType.ATTRIBUTEID_ATTTRIB_NAME, attribute.getAttributeID());
    }
}
 
Example #9
Source Project: lams   Author: lamsfoundation   File: XMLObjectHelper.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Marshall an XMLObject.  If the XMLObject already has a cached DOM via {@link XMLObject#getDOM()},
 * that Element will be returned.  Otherwise the object will be fully marshalled and that Element returned.
 * 
 * @param xmlObject the XMLObject to marshall
 * @return the marshalled Element
 * @throws MarshallingException if there is a problem marshalling the XMLObject
 */
public static Element marshall(XMLObject xmlObject) throws MarshallingException {
    Logger log = getLogger();
    log.debug("Marshalling XMLObject");
    
    if (xmlObject.getDOM() != null) {
        log.debug("XMLObject already had cached DOM, returning that element");
        return xmlObject.getDOM();
    }

    Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(xmlObject);
    if (marshaller == null) {
        log.error("Unable to marshall XMLOBject, no marshaller registered for object: "
                + xmlObject.getElementQName());
    }
    
    Element messageElem = marshaller.marshall(xmlObject);
    
    if (log.isTraceEnabled()) {
        log.trace("Marshalled XMLObject into DOM:");
        log.trace(XMLHelper.nodeToString(messageElem));
    }
    
    return messageElem;
}
 
Example #10
Source Project: lams   Author: lamsfoundation   File: ChannelBindingsMarshaller.java    License: 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 #11
Source Project: lams   Author: lamsfoundation   File: RequestMarshaller.java    License: 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 #12
Source Project: lams   Author: lamsfoundation   File: SessionKeyMarshaller.java    License: 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 #13
Source Project: lams   Author: lamsfoundation   File: ResponseAbstractTypeMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
    ResponseAbstractType response = (ResponseAbstractType) samlElement;

    if (response.getID() != null) {
        domElement.setAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, response.getID());
        if (response.getMinorVersion() != 0) {
            domElement.setIdAttributeNS(null, ResponseAbstractType.ID_ATTRIB_NAME, true);
        }
    }

    if (response.getInResponseTo() != null) {
        domElement.setAttributeNS(null, ResponseAbstractType.INRESPONSETO_ATTRIB_NAME, response.getInResponseTo());
    }

    if (response.getIssueInstant() != null) {
        String date = Configuration.getSAMLDateFormatter().print(response.getIssueInstant());
        domElement.setAttributeNS(null, ResponseAbstractType.ISSUEINSTANT_ATTRIB_NAME, date);
    }

    if (response.getMinorVersion() != 0) {
        String minorVersion = Integer.toString(response.getMinorVersion());
        domElement.setAttributeNS(null, ResponseAbstractType.MINORVERSION_ATTRIB_NAME, minorVersion);
        domElement.setAttributeNS(null, ResponseAbstractType.MAJORVERSION_ATTRIB_NAME, "1");
    }

    if (response.getRecipient() != null) {
        domElement.setAttributeNS(null, ResponseAbstractType.RECIPIENT_ATTRIB_NAME, response.getRecipient());
    }
}
 
Example #14
Source Project: lams   Author: lamsfoundation   File: AuthenticationStatementMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
    AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlElement;

    if (authenticationStatement.getAuthenticationMethod() != null) {
        domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME,
                authenticationStatement.getAuthenticationMethod());
    }

    if (authenticationStatement.getAuthenticationInstant() != null) {
        String value = Configuration.getSAMLDateFormatter().print(
                authenticationStatement.getAuthenticationInstant());
        domElement.setAttributeNS(null, AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME, value);
    }
}
 
Example #15
Source Project: lams   Author: lamsfoundation   File: ResultTypeMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
    ResultType result = (ResultType) samlElement;

    if (result.getResourceId() != null) {
        domElement.setAttributeNS(null, ResultType.RESOURCE_ID_ATTTRIB_NAME, result.getResourceId());
    }
}
 
Example #16
Source Project: lams   Author: lamsfoundation   File: KeyIdentifierMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    KeyIdentifier keyIdentifier = (KeyIdentifier) xmlObject;
    if (!DatatypeHelper.isEmpty(keyIdentifier.getValueType())) {
        domElement.setAttributeNS(null, KeyIdentifier.VALUE_TYPE_ATTRIB_NAME, keyIdentifier.getValueType());
    }
    super.marshallAttributes(xmlObject, domElement);
}
 
Example #17
Source Project: lams   Author: lamsfoundation   File: AttributedURIMarshaller.java    License: 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);
    
}
 
Example #18
Source Project: lams   Author: lamsfoundation   File: AttributeAssignmentTypeMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
    AttributeAssignmentType attributeAssignment = (AttributeAssignmentType) samlElement;

    if (!DatatypeHelper.isEmpty(attributeAssignment.getAttributeId())) {
        domElement.setAttributeNS(null, AttributeAssignmentType.ATTR_ID_ATTRIB_NAME, attributeAssignment
                .getAttributeId());
    }
    if(!DatatypeHelper.isEmpty(attributeAssignment.getDataType())){
    	super.marshallAttributes(samlElement, domElement);
    }
    
}
 
Example #19
Source Project: lams   Author: lamsfoundation   File: AbstractSAMLObjectMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
public Element marshall(XMLObject xmlObject, Element parentElement) throws MarshallingException {
    if (xmlObject instanceof SignableSAMLObject) {
        SAMLObjectHelper.declareNonVisibleNamespaces((SignableSAMLObject) xmlObject);
    }
    return super.marshall(xmlObject, parentElement);
}
 
Example #20
Source Project: lams   Author: lamsfoundation   File: EncodedStringMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    EncodedString encodedString = (EncodedString) xmlObject;
    if (!DatatypeHelper.isEmpty(encodedString.getEncodingType())){
        domElement.setAttributeNS(null, EncodedString.ENCODING_TYPE_ATTRIB_NAME, encodedString.getEncodingType());
    }
    super.marshallAttributes(xmlObject, domElement);
}
 
Example #21
Source Project: lams   Author: lamsfoundation   File: FunctionTypeMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    FunctionType functionType = (FunctionType) xmlObject;
    if(!DatatypeHelper.isEmpty(functionType.getFunctionId())){
        domElement.setAttribute(FunctionType.FUNCTION_ID_ATTRIB_NAME,functionType.getFunctionId());
    }
}
 
Example #22
Source Project: lams   Author: lamsfoundation   File: AttributedStringMarshaller.java    License: 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 #23
Source Project: lams   Author: lamsfoundation   File: IDPEntryMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    IDPEntry entry = (IDPEntry) samlObject;

    if (entry.getProviderID() != null) {
        domElement.setAttributeNS(null, IDPEntry.PROVIDER_ID_ATTRIB_NAME, entry.getProviderID());
    }
    if (entry.getName() != null) {
        domElement.setAttributeNS(null, IDPEntry.NAME_ATTRIB_NAME, entry.getName());
    }
    if (entry.getLoc() != null) {
        domElement.setAttributeNS(null, IDPEntry.LOC_ATTRIB_NAME, entry.getLoc());
    }
}
 
Example #24
Source Project: lams   Author: lamsfoundation   File: AttributeValueTypeMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException {
    AttributeValueType attributeValue = (AttributeValueType) xmlObject;

    if (attributeValue.getValue() != null) {
        XMLHelper.appendTextContent(domElement, attributeValue.getValue());
    }
}
 
Example #25
Source Project: lams   Author: lamsfoundation   File: BinarySecurityTokenMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
    BinarySecurityToken token = (BinarySecurityToken) xmlObject;
    if (!DatatypeHelper.isEmpty(token.getValueType())) {
        domElement.setAttributeNS(null, BinarySecurityToken.ENCODING_TYPE_ATTRIB_NAME, token.getValueType());
    }
    super.marshallAttributes(xmlObject, domElement);
}
 
Example #26
Source Project: lams   Author: lamsfoundation   File: SignatureConfirmationMarshaller.java    License: 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 #27
Source Project: lams   Author: lamsfoundation   File: AttributeDesignatorTypeMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
   protected void marshallAttributes(XMLObject xmlObject, Element domElement)
    throws MarshallingException {
AttributeDesignatorType attributeDesignatorType = (AttributeDesignatorType) xmlObject;

if (!DatatypeHelper.isEmpty(attributeDesignatorType.getAttributeId())) {
    domElement.setAttribute(
	    AttributeDesignatorType.ATTRIBUTE_ID_ATTRIB_NAME,
	    attributeDesignatorType.getAttributeId());
}
if (!DatatypeHelper.isEmpty(attributeDesignatorType.getDataType())) {
    domElement.setAttribute(
	    AttributeDesignatorType.DATA_TYPE_ATTRIB_NAME,
	    attributeDesignatorType.getDataType());
}
if (!DatatypeHelper.isEmpty(attributeDesignatorType.getIssuer())) {
    domElement.setAttribute(AttributeDesignatorType.ISSUER_ATTRIB_NAME,
	    attributeDesignatorType.getIssuer());
}
if (attributeDesignatorType.getMustBePresentXSBoolean() != null) {
    domElement.setAttribute(
	    AttributeDesignatorType.MUST_BE_PRESENT_ATTRIB_NAME,
	    Boolean.toString(attributeDesignatorType
		    .getMustBePresentXSBoolean().getValue()));
}

   }
 
Example #28
Source Project: lams   Author: lamsfoundation   File: ScopingMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    Scoping scoping = (Scoping) samlObject;

    if (scoping.getProxyCount() != null) {
        domElement.setAttributeNS(null, Scoping.PROXY_COUNT_ATTRIB_NAME, scoping.getProxyCount().toString());
    }
}
 
Example #29
Source Project: lams   Author: lamsfoundation   File: NewIDMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
    NewID newID = (NewID) samlObject;

    if (newID.getNewID() != null) {
        XMLHelper.appendTextContent(domElement, newID.getNewID());
    }
}
 
Example #30
Source Project: lams   Author: lamsfoundation   File: AttributeQueryMarshaller.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {

    AttributeQuery attributeQuery = (AttributeQuery) samlElement;

    if (attributeQuery.getResource() != null) {
        domElement.setAttributeNS(null, AttributeQuery.RESOURCE_ATTRIB_NAME, attributeQuery.getResource());
    }
}