Package org.opensaml.saml2.metadata

Examples of org.opensaml.saml2.metadata.ContactPerson


        Subject subject = subjectBuilder.buildObject();
       
        NameID nameID = SAML2ComponentBuilder.createNameID(subjectBean);
        subject.setNameID(nameID);
       
        SubjectConfirmationData subjectConfData = null;
        if (subjectBean.getKeyInfo() != null || subjectBean.getSubjectConfirmationData() != null) {
            subjectConfData =
                SAML2ComponentBuilder.createSubjectConfirmationData(
                    subjectBean.getSubjectConfirmationData(),
                    subjectBean.getKeyInfo()
View Full Code Here


    @SuppressWarnings("unchecked")
    public static SubjectConfirmationData createSubjectConfirmationData(
        SubjectConfirmationDataBean subjectConfirmationDataBean,
        KeyInfoBean keyInfoBean
    ) throws org.opensaml.xml.security.SecurityException, WSSecurityException {
        SubjectConfirmationData subjectConfirmationData = null;
        KeyInfo keyInfo = null;
        if (keyInfoBean == null) {
            if (subjectConfirmationDataBuilder == null) {
                subjectConfirmationDataBuilder = (SAMLObjectBuilder<SubjectConfirmationData>)
                    builderFactory.getBuilder(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
            }
            subjectConfirmationData = subjectConfirmationDataBuilder.buildObject();
        } else {
            if (keyInfoConfirmationDataBuilder == null) {
                keyInfoConfirmationDataBuilder = (SAMLObjectBuilder<KeyInfoConfirmationDataType>)
                    builderFactory.getBuilder(KeyInfoConfirmationDataType.TYPE_NAME);
            }
            subjectConfirmationData = keyInfoConfirmationDataBuilder.buildObject();
            keyInfo = SAML1ComponentBuilder.createKeyInfo(keyInfoBean);
            ((KeyInfoConfirmationDataType)subjectConfirmationData).getKeyInfos().add(keyInfo);
        }
       
        if (subjectConfirmationDataBean != null) {
            if (subjectConfirmationDataBean.getInResponseTo() != null) {
                subjectConfirmationData.setInResponseTo(subjectConfirmationDataBean.getInResponseTo());
            }
            if (subjectConfirmationDataBean.getRecipient() != null) {
                subjectConfirmationData.setRecipient(subjectConfirmationDataBean.getRecipient());
            }
            if (subjectConfirmationDataBean.getAddress() != null) {
                subjectConfirmationData.setAddress(subjectConfirmationDataBean.getAddress());
            }
            if (subjectConfirmationDataBean.getNotAfter() != null) {
                subjectConfirmationData.setNotOnOrAfter(subjectConfirmationDataBean.getNotAfter());
            }
            if (subjectConfirmationDataBean.getNotBefore() != null) {
                subjectConfirmationData.setNotBefore(subjectConfirmationDataBean.getNotBefore());
            }
        }
       
        return subjectConfirmationData;
    }
View Full Code Here

                authnContext.setAuthnContextClassRef(authnContextClassRef);
                authnStatement.setAuthnContext(authnContext);

                SubjectLocalityBean subjectLocalityBean = statementBean.getSubjectLocality();
                if (subjectLocalityBean != null) {
                    SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
                    subjectLocality.setDNSName(subjectLocalityBean.getDnsAddress());
                    subjectLocality.setAddress(subjectLocalityBean.getIpAddress());

                    authnStatement.setSubjectLocality(subjectLocality);
                }
               
                authnStatements.add(authnStatement);
View Full Code Here

                authnContext.setAuthnContextClassRef(authnContextClassRef);
                authnStatement.setAuthnContext(authnContext);

                SubjectLocalityBean subjectLocalityBean = statementBean.getSubjectLocality();
                if (subjectLocalityBean != null) {
                    SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
                    subjectLocality.setDNSName(subjectLocalityBean.getDnsAddress());
                    subjectLocality.setAddress(subjectLocalityBean.getIpAddress());

                    authnStatement.setSubjectLocality(subjectLocality);
                }
               
                authnStatements.add(authnStatement);
View Full Code Here

public class ContactPersonUnmarshaller extends AbstractSAMLObjectUnmarshaller {

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

        if (childSAMLObject instanceof Extensions) {
            person.setExtensions((Extensions) childSAMLObject);
        } else if (childSAMLObject instanceof Company) {
            person.setCompany((Company) childSAMLObject);
        } else if (childSAMLObject instanceof GivenName) {
            person.setGivenName((GivenName) childSAMLObject);
        } else if (childSAMLObject instanceof SurName) {
            person.setSurName((SurName) childSAMLObject);
        } else if (childSAMLObject instanceof EmailAddress) {
            person.getEmailAddresses().add((EmailAddress) childSAMLObject);
        } else if (childSAMLObject instanceof TelephoneNumber) {
            person.getTelephoneNumbers().add((TelephoneNumber) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        ContactPerson person = (ContactPerson) samlObject;

        if (attribute.getLocalName().equals(ContactPerson.CONTACT_TYPE_ATTRIB_NAME)) {
            if (ContactPersonTypeEnumeration.TECHNICAL.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.TECHNICAL);
            } else if (ContactPersonTypeEnumeration.SUPPORT.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.SUPPORT);
            } else if (ContactPersonTypeEnumeration.ADMINISTRATIVE.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.ADMINISTRATIVE);
            } else if (ContactPersonTypeEnumeration.BILLING.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.BILLING);
            } else if (ContactPersonTypeEnumeration.OTHER.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.OTHER);
            } else {
                super.processAttribute(samlObject, attribute);
            }
        } else {
            QName attribQName = XMLHelper.getNodeQName(attribute);
            if (attribute.isId()) {
                person.getUnknownAttributes().registerID(attribQName);
            }
            person.getUnknownAttributes().put(attribQName, attribute.getValue());
        }
    }
View Full Code Here

*/
public class ContactPersonMarshaller extends AbstractSAMLObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        ContactPerson person = (ContactPerson) samlObject;

        if (person.getType() != null) {
            domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, person.getType().toString());
        }

        Attr attribute;
        for (Entry<QName, String> entry : person.getUnknownAttributes().entrySet()) {
            attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
            attribute.setValue(entry.getValue());
            domElement.setAttributeNodeNS(attribute);
            if (Configuration.isIDAttribute(entry.getKey())
                    || person.getUnknownAttributes().isIDAttribute(entry.getKey())) {
                attribute.getOwnerElement().setIdAttributeNode(attribute, true);
            }
        }
    }
View Full Code Here

    }

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

        if (childSAMLObject instanceof Extensions) {
            person.setExtensions((Extensions) childSAMLObject);
        } else if (childSAMLObject instanceof Company) {
            person.setCompany((Company) childSAMLObject);
        } else if (childSAMLObject instanceof GivenName) {
            person.setGivenName((GivenName) childSAMLObject);
        } else if (childSAMLObject instanceof SurName) {
            person.setSurName((SurName) childSAMLObject);
        } else if (childSAMLObject instanceof EmailAddress) {
            person.getEmailAddresses().add((EmailAddress) childSAMLObject);
        } else if (childSAMLObject instanceof TelephoneNumber) {
            person.getTelephoneNumbers().add((TelephoneNumber) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        ContactPerson person = (ContactPerson) samlObject;

        if (attribute.getLocalName().equals(ContactPerson.CONTACT_TYPE_ATTRIB_NAME)) {
            if (ContactPersonTypeEnumeration.TECHNICAL.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.TECHNICAL);
            } else if (ContactPersonTypeEnumeration.SUPPORT.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.SUPPORT);
            } else if (ContactPersonTypeEnumeration.ADMINISTRATIVE.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.ADMINISTRATIVE);
            } else if (ContactPersonTypeEnumeration.BILLING.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.BILLING);
            } else if (ContactPersonTypeEnumeration.OTHER.toString().equals(attribute.getValue())) {
                person.setType(ContactPersonTypeEnumeration.OTHER);
            } else {
                super.processAttribute(samlObject, attribute);
            }
        } else {
            QName attribQName = XMLHelper.getNodeQName(attribute);
            if (attribute.isId()) {
               person.getUnknownAttributes().registerID(attribQName);
            }
            person.getUnknownAttributes().put(attribQName, attribute.getValue());
        }
    }
View Full Code Here

        super(namespaceURI, elementLocalName);
    }

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        ContactPerson person = (ContactPerson) samlObject;

        if (person.getType() != null) {
            domElement.setAttributeNS(null, ContactPerson.CONTACT_TYPE_ATTRIB_NAME, person.getType().toString());
        }
       
        Attr attribute;
        for(Entry<QName, String> entry: person.getUnknownAttributes().entrySet()){
            attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
            attribute.setValue(entry.getValue());
            domElement.setAttributeNodeNS(attribute);
            if (Configuration.isIDAttribute(entry.getKey())
                    || person.getUnknownAttributes().isIDAttribute(entry.getKey())) {
                attribute.getOwnerElement().setIdAttributeNode(attribute, true);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.opensaml.saml2.metadata.ContactPerson

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.