Package org.opensaml.ws.wssecurity

Examples of org.opensaml.ws.wssecurity.UsernameToken


*/
public class UsernameTokenMarshaller extends AbstractWSSecurityObjectMarshaller {

    /** {@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);
       
    }
View Full Code Here


public class UsernameTokenUnmarshaller extends AbstractWSSecurityObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        UsernameToken token = (UsernameToken) parentXMLObject;
        if (childXMLObject instanceof Username) {
            token.setUsername((Username) childXMLObject);
        } else {
            token.getUnknownXMLObjects().add(childXMLObject);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        UsernameToken token = (UsernameToken) xmlObject;
       
        QName attribQName =
            XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix());
        if (UsernameToken.WSU_ID_ATTR_NAME.equals(attribQName)) {
            token.setWSUId(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else {
            XMLHelper.unmarshallToAttributeMap(token.getUnknownAttributes(), attribute);
        }
    }
View Full Code Here

*/
public class UsernameTokenMarshaller extends AbstractWSSecurityObjectMarshaller {

    /** {@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);
       
    }
View Full Code Here

public class UsernameTokenUnmarshaller extends AbstractWSSecurityObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        UsernameToken token = (UsernameToken) parentXMLObject;
        if (childXMLObject instanceof Username) {
            token.setUsername((Username) childXMLObject);
        } else {
            token.getUnknownXMLObjects().add(childXMLObject);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        UsernameToken token = (UsernameToken) xmlObject;
       
        QName attribQName =
            XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix());
        if (UsernameToken.WSU_ID_ATTR_NAME.equals(attribQName)) {
            token.setWSUId(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else {
            XMLHelper.unmarshallToAttributeMap(token.getUnknownAttributes(), attribute);
        }
    }
View Full Code Here

TOP

Related Classes of org.opensaml.ws.wssecurity.UsernameToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.