Package org.opensaml.saml2.core

Examples of org.opensaml.saml2.core.RequestAbstractType


*/
public class RequestAbstractTypeMarshaller extends AbstractSAMLObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
        RequestAbstractType request = (RequestAbstractType) samlElement;

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

        if (request.getIssueInstant() != null) {
            String date = Configuration.getSAMLDateFormatter().print(request.getIssueInstant());
            domElement.setAttributeNS(null, RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME, date);
        }
        if (request.getMinorVersion() != 0) {
            domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME, "1");
            domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME, Integer.toString(request
                    .getMinorVersion()));
        }
    }
View Full Code Here


    private final Logger log = LoggerFactory.getLogger(RequestAbstractType.class);

    /** {@inheritDoc} */
    public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
        // After regular unmarshalling, check the minor version and set ID-ness if not SAML 1.0
        RequestAbstractType request = (RequestAbstractType) super.unmarshall(domElement);
        if (request.getMinorVersion() != 0 && !DatatypeHelper.isEmpty(request.getID())) {
            domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
        }
        return request;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        RequestAbstractType request = (RequestAbstractType) parentSAMLObject;

        if (childSAMLObject instanceof Signature) {
            request.setSignature((Signature) childSAMLObject);
        } else if (childSAMLObject instanceof RespondWith) {
            request.getRespondWiths().add((RespondWith) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlElement, Attr attribute) throws UnmarshallingException {
        RequestAbstractType request = (RequestAbstractType) samlElement;

        if (RequestAbstractType.ID_ATTRIB_NAME.equals(attribute.getLocalName())) {
            request.setID(attribute.getValue());
        } else if (RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
                && !DatatypeHelper.isEmpty(attribute.getValue())) {
            DateTime cal = new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC());
            request.setIssueInstant(cal);
        } else if (RequestAbstractType.MINORVERSION_ATTRIB_NAME.equals(attribute.getLocalName())) {
            int minor;
            try {
                minor = Integer.parseInt(attribute.getValue());
            } catch (NumberFormatException n) {
                log.error("Unable to parse minor version string", n);
                throw new UnmarshallingException(n);
            }
            if (minor == 0) {
                request.setVersion(SAMLVersion.VERSION_10);
            } else if (minor == 1) {
                request.setVersion(SAMLVersion.VERSION_11);
            }
        } else {
            super.processAttribute(samlElement, attribute);
        }
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
        // After regular unmarshalling, check the minor version and set ID-ness if not SAML 1.0
        RequestAbstractType request = (RequestAbstractType) super.unmarshall(domElement);
        if (request.getMinorVersion() != 0 && !DatatypeHelper.isEmpty(request.getID())) {
            domElement.setIdAttributeNS(null, RequestAbstractType.ID_ATTRIB_NAME, true);
        }
        return request;
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {
        RequestAbstractType request = (RequestAbstractType) parentSAMLObject;

        if (childSAMLObject instanceof Signature) {
            request.setSignature((Signature) childSAMLObject);
        } else if (childSAMLObject instanceof RespondWith) {
            request.getRespondWiths().add((RespondWith) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlElement, Attr attribute) throws UnmarshallingException {
        RequestAbstractType request = (RequestAbstractType) samlElement;

        if (RequestAbstractType.ID_ATTRIB_NAME.equals(attribute.getLocalName())) {
            request.setID(attribute.getValue());
        } else if (RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
                && !DatatypeHelper.isEmpty(attribute.getValue())) {
            DateTime cal = new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC());
            request.setIssueInstant(cal);
        } else if (RequestAbstractType.MINORVERSION_ATTRIB_NAME.equals(attribute.getLocalName())) {
            int minor;
            try {
                minor = Integer.parseInt(attribute.getValue());
            } catch (NumberFormatException n) {
                log.error("Unable to parse minor version string", n);
                throw new UnmarshallingException(n);
            }
            if (minor == 0) {
                request.setVersion(SAMLVersion.VERSION_10);
            } else if (minor == 1) {
                request.setVersion(SAMLVersion.VERSION_11);
            }
        } else {
            super.processAttribute(samlElement, attribute);
        }
    }
View Full Code Here

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
        RequestAbstractType request = (RequestAbstractType) samlElement;

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

        if (request.getIssueInstant() != null) {
            String date = Configuration.getSAMLDateFormatter().print(request.getIssueInstant());
            domElement.setAttributeNS(null, RequestAbstractType.ISSUEINSTANT_ATTRIB_NAME, date);
        }
        if (request.getMinorVersion() != 0) {
            domElement.setAttributeNS(null, RequestAbstractType.MAJORVERSION_ATTRIB_NAME, "1");
            domElement.setAttributeNS(null, RequestAbstractType.MINORVERSION_ATTRIB_NAME, Integer.toString(request
                    .getMinorVersion()));
        }
    }
View Full Code Here

  protected SAMLMessageDecoder samlMessageDecoder() {
    final BasicParserPool basicParserPool = new BasicParserPool();
    basicParserPool.setMaxPoolSize(maxParserPoolSize);

    return new HTTPPostSimpleSignDecoder(basicParserPool);
  }
View Full Code Here

                authDecision.setDecision(
                    transformDecisionType(decisionStatementBean.getDecision())
                );

                for (ActionBean actionBean : decisionStatementBean.getActions()) {
                    Action actionElement = createSamlAction(actionBean);
                    authDecision.getActions().add(actionElement);
                }

                if (decisionStatementBean.getEvidence() instanceof Evidence) {                                   
                    authDecision.setEvidence((Evidence)decisionStatementBean.getEvidence());
View Full Code Here

TOP

Related Classes of org.opensaml.saml2.core.RequestAbstractType

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.