Package org.opensaml.saml2.metadata

Examples of org.opensaml.saml2.metadata.IndexedEndpoint


*/
public class IndexedEndpointUnmarshaller extends EndpointUnmarshaller {

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

        if (attribute.getLocalName().equals(IndexedEndpoint.INDEX_ATTRIB_NAME)) {
            iEndpoint.setIndex(Integer.valueOf(attribute.getValue()));
        } else if (attribute.getLocalName().equals(IndexedEndpoint.IS_DEFAULT_ATTRIB_NAME)) {
            iEndpoint.setIsDefault(XSBooleanValue.valueOf(attribute.getValue()));
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here


     * @return appropriate endpoint from a list of indexed endpoints or null
     */
    protected Endpoint selectIndexedEndpoint(List<IndexedEndpoint> endpoints) {
        List<IndexedEndpoint> endpointsCopy = new ArrayList<IndexedEndpoint>(endpoints);
        Iterator<IndexedEndpoint> endpointItr = endpointsCopy.iterator();
        IndexedEndpoint firstNoDefaultEndpoint = null;
        IndexedEndpoint currentEndpoint;
        while (endpointItr.hasNext()) {
            currentEndpoint = endpointItr.next();

            // endpoint is the default endpoint
            if (currentEndpoint.isDefault() != null) {
                if (currentEndpoint.isDefault()) {
                    return currentEndpoint;
                }

                if (firstNoDefaultEndpoint == null) {
                    firstNoDefaultEndpoint = currentEndpoint;
View Full Code Here

    }

    /** {@inheritDoc} */
    public SAML2ArtifactType0004 buildArtifact(SAMLMessageContext<SAMLObject, SAMLObject, NameID> requestContext) {
        try {
            IndexedEndpoint acsEndpoint = (IndexedEndpoint) getAcsEndpoint(requestContext);
            if (acsEndpoint == null) {
                return null;
            }

            byte[] endpointIndex = DatatypeHelper.intToByteArray(acsEndpoint.getIndex());
            byte[] trimmedIndex = new byte[2];
            trimmedIndex[0] = endpointIndex[2];
            trimmedIndex[1] = endpointIndex[3];

            MessageDigest sha1Digester = MessageDigest.getInstance("SHA-1");
View Full Code Here

*/
public class IndexedEndpointMarshaller extends EndpointMarshaller {

    /** {@inheritDoc} */
    public void marshallAttributes(XMLObject samlObject, Element domElement) {
        IndexedEndpoint iEndpoint = (IndexedEndpoint) samlObject;

        if (iEndpoint.getIndex() != null) {
            domElement.setAttributeNS(null, IndexedEndpoint.INDEX_ATTRIB_NAME, iEndpoint.getIndex().toString());
        }

        if (iEndpoint.isDefaultXSBoolean() != null) {
            domElement.setAttributeNS(null, IndexedEndpoint.IS_DEFAULT_ATTRIB_NAME, iEndpoint.isDefaultXSBoolean()
                    .toString());
        }

        super.marshallAttributes(samlObject, domElement);
    }
View Full Code Here

        super(targetNamespaceURI, targetLocalName);
    }

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

        if (attribute.getLocalName().equals(IndexedEndpoint.INDEX_ATTRIB_NAME)) {
            iEndpoint.setIndex(Integer.valueOf(attribute.getValue()));
        } else if (attribute.getLocalName().equals(IndexedEndpoint.IS_DEFAULT_ATTRIB_NAME)) {
            iEndpoint.setIsDefault(XSBooleanValue.valueOf(attribute.getValue()));
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here

        super(targetNamespaceURI, targetLocalName);
    }

    /** {@inheritDoc} */
    public void marshallAttributes(XMLObject samlObject, Element domElement) {
        IndexedEndpoint iEndpoint = (IndexedEndpoint) samlObject;

        if (iEndpoint.getIndex() != null) {
            domElement.setAttributeNS(null, IndexedEndpoint.INDEX_ATTRIB_NAME, iEndpoint.getIndex().toString());
        }

        if (iEndpoint.isDefaultXSBoolean() != null) {
            domElement.setAttributeNS(null, IndexedEndpoint.IS_DEFAULT_ATTRIB_NAME, iEndpoint.isDefaultXSBoolean().toString());
        }

        super.marshallAttributes(samlObject, domElement);
    }
View Full Code Here

     * @return appropriate endpoint from a list of indexed endpoints or null
     */
    protected Endpoint selectIndexedEndpoint(List<IndexedEndpoint> endpoints) {
        List<IndexedEndpoint> endpointsCopy = new ArrayList<IndexedEndpoint>(endpoints);
        Iterator<IndexedEndpoint> endpointItr = endpointsCopy.iterator();
        IndexedEndpoint firstNoDefaultEndpoint = null;
        IndexedEndpoint currentEndpoint;
        while (endpointItr.hasNext()) {
            currentEndpoint = endpointItr.next();

            // endpoint is the default endpoint
            if (currentEndpoint.isDefault() != null) {
                if (currentEndpoint.isDefault()) {
                    return currentEndpoint;
                }

                if (firstNoDefaultEndpoint == null) {
                    firstNoDefaultEndpoint = currentEndpoint;
View Full Code Here

    }

    /** {@inheritDoc} */
    public SAML2ArtifactType0004 buildArtifact(SAMLMessageContext<SAMLObject, SAMLObject, NameID> requestContext) {
        try {
            IndexedEndpoint acsEndpoint = (IndexedEndpoint) getAcsEndpoint(requestContext);
            byte[] endpointIndex = DatatypeHelper.intToByteArray(acsEndpoint.getIndex());
            byte[] trimmedIndex = new byte[2];
            trimmedIndex[0] = endpointIndex[2];
            trimmedIndex[1] = endpointIndex[3];

            MessageDigest sha1Digester = MessageDigest.getInstance("SHA-1");
View Full Code Here

        if (DatatypeHelper.isEmpty(supportedProtocol)) {
            log.debug("Supported protocol was null, skipping search for role.");
            return null;
        }

        RoleDescriptor role = doGetRole(entityID, roleName, supportedProtocol);
        if (role == null) {
            log.debug("Metadata document does not contain a role of type {} supporting protocol {} for entity {}",
                    new Object[] { roleName, supportedProtocol, entityID });
            return null;
        }
View Full Code Here

                    entityID);
            return null;
        }

        Iterator<RoleDescriptor> rolesItr = roles.iterator();
        RoleDescriptor role = null;
        while (rolesItr.hasNext()) {
            role = rolesItr.next();
            if (role != null && role.isSupportedProtocol(supportedProtocol)) {
                return role;
            }
        }

        return null;
View Full Code Here

TOP

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

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.