Package org.opensaml.saml2.metadata

Examples of org.opensaml.saml2.metadata.LocalizedString


        if (DatatypeHelper.isEmpty(entityID)) {
            log.debug("EntityDescriptor entityID was null or empty, skipping search for it");
            return null;
        }

        EntityDescriptor descriptor = doGetEntityDescriptor(entityID);
        if (descriptor == null) {
            log.debug("Metadata document does not contain an EntityDescriptor with the ID {}", entityID);
            return null;
        } else if (!isValid(descriptor)) {
            log.debug("Metadata document contained an EntityDescriptor with the ID {}, but it was no longer valid",
View Full Code Here


     * @return the modifiable list of identified roles or an empty list if no roles exists
     *
     * @throws MetadataProviderException thrown if there is a problem searching for the roles
     */
    protected List<RoleDescriptor> doGetRole(String entityID, QName roleName) throws MetadataProviderException {
        EntityDescriptor entity = doGetEntityDescriptor(entityID);
        if (entity == null) {
            log.debug("Metadata document did not contain a descriptor for entity {}", entityID);
            return Collections.emptyList();
        }

        List<RoleDescriptor> descriptors = entity.getRoleDescriptors(roleName);
        if (descriptors != null && !descriptors.isEmpty()) {
            return new ArrayList<RoleDescriptor>(descriptors);
        }

        return Collections.emptyList();
View Full Code Here

     * @param metadata metadata associated with the entity
     *
     * @return the EntityDescriptor
     */
    protected EntityDescriptor getEntityDescriptorById(String entityID, XMLObject metadata) {
        EntityDescriptor descriptor = null;

        log.debug("Searching for entity descriptor with an entity ID of {}", entityID);
        if (entityID != null && indexedDescriptors.containsKey(entityID)) {
            descriptor = indexedDescriptors.get(entityID);
            if (isValid(descriptor)) {
                log.trace("Entity descriptor for the ID {} was found in index cache, returning", entityID);
                return descriptor;
            } else {
                indexedDescriptors.remove(descriptor);
            }
        }

        if (metadata != null) {
            if (metadata instanceof EntityDescriptor) {
                log.trace("Metadata root is an entity descriptor, checking if it's the one we're looking for.");
                descriptor = (EntityDescriptor) metadata;
                if (!DatatypeHelper.safeEquals(descriptor.getEntityID(), entityID)) {
                    // skip this one, it isn't what we're looking for
                    descriptor = null;
                }
                if (!isValid(descriptor)) {
                    log.trace("Found entity descriptor for entity with ID {} but it is no longer valid, skipping it.",
View Full Code Here

                }
            }
        }

        log.trace("Checking to see if any of the child entities descriptors contains the entity descriptor requested");
        EntityDescriptor entityDescriptor;
        List<EntitiesDescriptor> entitiesDescriptors = descriptor.getEntitiesDescriptors();
        if (entitiesDescriptors != null && !entitiesDescriptors.isEmpty()) {
            for (EntitiesDescriptor entitiesDescriptor : descriptor.getEntitiesDescriptors()) {
                entityDescriptor = getEntityDescriptorById(entityID, entitiesDescriptor);
                if (entityDescriptor != null) {
View Full Code Here

    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        if (attribute.getLocalName().equals(LangBearing.XML_LANG_ATTR_LOCAL_NAME)
                && SAMLConstants.XML_NS.equals(attribute.getNamespaceURI())) {
            LocalizedURI uri = (LocalizedURI) samlObject;

            LocalizedString uriStr = uri.getURI();
            if (uriStr == null) {
                uriStr = new LocalizedString();
            }

            uriStr.setLanguage(attribute.getValue());
            uri.setURI(uriStr);
        }
    }
View Full Code Here

    /** {@inheritDoc} */
    protected void processElementContent(XMLObject samlObject, String elementContent) {
        LocalizedURI uri = (LocalizedURI) samlObject;

        LocalizedString uriStr = uri.getURI();
        if (uriStr == null) {
            uriStr = new LocalizedString();
        }

        uriStr.setLocalizedString(elementContent);
        uri.setURI(uriStr);
    }
View Full Code Here

    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        QName attribName = XMLHelper.getNodeQName(attribute);
        if (LangBearing.XML_LANG_ATTR_NAME.equals(attribName)) {
            ServiceName name = (ServiceName) samlObject;

            LocalizedString nameStr = name.getName();
            if (nameStr == null) {
                nameStr = new LocalizedString();
            }

            nameStr.setLanguage(attribute.getValue());
            name.setName(nameStr);
        }
    }
View Full Code Here

    /** {@inheritDoc} */
    protected void processElementContent(XMLObject samlObject, String elementContent) {
        ServiceName name = (ServiceName) samlObject;

        LocalizedString nameStr = name.getName();
        if (nameStr == null) {
            nameStr = new LocalizedString();
        }

        nameStr.setLocalizedString(elementContent);
        name.setName(nameStr);
    }
View Full Code Here

    protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
        QName attribName = XMLHelper.getNodeQName(attribute);
        if (LangBearing.XML_LANG_ATTR_NAME.equals(attribName)) {
            ServiceDescription description = (ServiceDescription) samlObject;

            LocalizedString descStr = description.getDescription();
            if (descStr == null) {
                descStr = new LocalizedString();
            }

            descStr.setLanguage(attribute.getValue());
            description.setDescription(descStr);
        }
    }
View Full Code Here

    /** {@inheritDoc} */
    protected void processElementContent(XMLObject samlObject, String elementContent) {
        ServiceDescription description = (ServiceDescription) samlObject;

        LocalizedString descStr = description.getDescription();
        if (descStr == null) {
            descStr = new LocalizedString();
        }

        descStr.setLocalizedString(elementContent);
        description.setDescription(descStr);
    }
View Full Code Here

TOP

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

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.