Package org.opensaml.xml

Examples of org.opensaml.xml.XMLObject


       
        AssertionWrapper assertion = new AssertionWrapper(token);
        List<Attribute> attributes = assertion.getSaml2().getAttributeStatements().get(0).getAttributes();
        assertEquals(attributes.size(), 1);
        assertEquals(attributes.get(0).getName(), CLAIM_STATIC_COMPANY.toString());
        XMLObject valueObj = attributes.get(0).getAttributeValues().get(0);
        assertEquals(valueObj.getDOM().getTextContent(), CLAIM_STATIC_COMPANY_VALUE);     
    }
View Full Code Here


       
        AssertionWrapper assertion = new AssertionWrapper(token);
        List<Attribute> attributes = assertion.getSaml2().getAttributeStatements().get(0).getAttributes();
        assertEquals(attributes.size(), 1);
        assertEquals(attributes.get(0).getName(), CLAIM_APPLICATION.toString());
        XMLObject valueObj = attributes.get(0).getAttributeValues().get(0);
        assertEquals(valueObj.getDOM().getTextContent(), CLAIM_APPLICATION_VALUE);     
    }
View Full Code Here

            for (SubjectStatement subjectStatement : subjectStatements) {
                Subject subject = subjectStatement.getSubject();
                if (subject != null) {
                    SubjectConfirmation confirmation = subject.getSubjectConfirmation();
                    if (confirmation != null) {
                        XMLObject data = confirmation.getSubjectConfirmationData();
                        if (data instanceof ConfirmationMethod) {
                            ConfirmationMethod method = (ConfirmationMethod) data;
                            methods.add(method.getConfirmationMethod());
                        }
                        List<ConfirmationMethod> confirmationMethods =
View Full Code Here

            throw new WebApplicationException(400);
        }
       
        LOG.fine("Received response: " + DOM2Writer.nodeToString(responseDoc.getDocumentElement()));
       
        XMLObject responseObject = null;
        try {
            responseObject = OpenSAMLUtil.fromDom(responseDoc.getDocumentElement());
        } catch (WSSecurityException ex) {
            throw ExceptionUtils.toBadRequestException(ex, null);
        }
View Full Code Here

            throws DecryptionException {
        List<XMLObject> xmlObjects = new LinkedList<XMLObject>();

        DocumentFragment docFragment = decryptDataToDOM(encryptedData);

        XMLObject xmlObject;
        Node node;
        Element element;

        NodeList children = docFragment.getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
View Full Code Here

    public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
        log.trace("Starting to unmarshall DOM element {}", XMLHelper.getNodeQName(domElement));

        checkElementIsTarget(domElement);

        XMLObject xmlObject = buildXMLObject(domElement);

        log.trace("Unmarshalling attributes of DOM Element {}", XMLHelper.getNodeQName(domElement));
        NamedNodeMap attributes = domElement.getAttributes();
        Node attribute;
        for (int i = 0; i < attributes.getLength(); i++) {
            attribute = attributes.item(i);

            // These should allows be attribute nodes, but just in case...
            if (attribute.getNodeType() == Node.ATTRIBUTE_NODE) {
                unmarshallAttribute(xmlObject, (Attr) attribute);
            }
        }

        log.trace("Unmarshalling other child nodes of DOM Element {}", XMLHelper.getNodeQName(domElement));
        NodeList childNodes = domElement.getChildNodes();
        Node childNode;
        for (int i = 0; i < childNodes.getLength(); i++) {
            childNode = childNodes.item(i);

            if (childNode.getNodeType() == Node.ATTRIBUTE_NODE) {
                unmarshallAttribute(xmlObject, (Attr) childNode);
            } else if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                unmarshallChildElement(xmlObject, (Element) childNode);
            } else if (childNode.getNodeType() == Node.TEXT_NODE) {
                unmarshallTextContent(xmlObject, (Text) childNode);
            }
        }

        xmlObject.setDOM(domElement);
        return xmlObject;
    }
View Full Code Here

    public XMLObject getMetadata() throws MetadataProviderException {
        if (!isInitialized()) {
            throw new MetadataProviderException("Metadata provider has not been initialized");
        }

        XMLObject metadata = doGetMetadata();

        if (metadata == null) {
            log.debug("Metadata provider does not currently contain any metadata");
        }
View Full Code Here

     * @return the named EntitiesDescriptor or null if no such EntitiesDescriptor exists
     *
     * @throws MetadataProviderException thrown if there is a problem searching for the EntitiesDescriptor
     */
    protected EntitiesDescriptor doGetEntitiesDescriptor(String name) throws MetadataProviderException {
        XMLObject metadata = doGetMetadata();
        if (metadata == null) {
            log.debug("Metadata provider does not currently contain any metadata, unable to look for an EntitiesDescriptor with the name {}",
                            name);
            return null;
        }
View Full Code Here

     * @return the identified EntityDescriptor or null if no such EntityDescriptor exists
     *
     * @throws MetadataProviderException thrown if there is a problem searching for the EntityDescriptor
     */
    protected EntityDescriptor doGetEntityDescriptor(String entityID) throws MetadataProviderException {
        XMLObject metadata = doGetMetadata();
        if (metadata == null) {
            log.debug("Metadata document was empty, unable to look for an EntityDescriptor with the ID {}", entityID);
            return null;
        }

View Full Code Here

                String msg ="No unmarshaller registered for document element " + XMLHelper
                        .getNodeQName(mdDocument.getDocumentElement());
                log.error(msg);
                throw new UnmarshallingException(msg);
            }
            XMLObject metadata = unmarshaller.unmarshall(mdDocument.getDocumentElement());
            return metadata;
        } catch (Exception e) {
            throw new UnmarshallingException(e);
        } finally {
            try {
View Full Code Here

TOP

Related Classes of org.opensaml.xml.XMLObject

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.