Package org.opensaml.saml2.metadata

Examples of org.opensaml.saml2.metadata.EntitiesDescriptor


     * @param rootDescriptor the root descriptor to search in
     *
     * @return the EntitiesDescriptor with the given name
     */
    protected EntitiesDescriptor getEntitiesDescriptorByName(String name, EntitiesDescriptor rootDescriptor) {
        EntitiesDescriptor descriptor = null;

        if (DatatypeHelper.safeEquals(name, rootDescriptor.getName()) && isValid(rootDescriptor)) {
            descriptor = rootDescriptor;
        } else {
            List<EntitiesDescriptor> childDescriptors = rootDescriptor.getEntitiesDescriptors();
View Full Code Here


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

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

            log.debug("Metadata provider does not currently contain any metadata, unable to look for an EntitiesDescriptor with the name {}",
                            name);
            return null;
        }

        EntitiesDescriptor descriptor = null;
        if (metadata instanceof EntitiesDescriptor) {
            descriptor = getEntitiesDescriptorByName(name, (EntitiesDescriptor) metadata);
        }

        return descriptor;
View Full Code Here

     * @param rootDescriptor the root descriptor to search in
     *
     * @return the EntitiesDescriptor with the given name
     */
    protected EntitiesDescriptor getEntitiesDescriptorByName(String name, EntitiesDescriptor rootDescriptor) {
        EntitiesDescriptor descriptor = null;

        if (DatatypeHelper.safeEquals(name, rootDescriptor.getName()) && isValid(rootDescriptor)) {
            descriptor = rootDescriptor;
        } else {
            List<EntitiesDescriptor> childDescriptors = rootDescriptor.getEntitiesDescriptors();
View Full Code Here

    /** {@inheritDoc} */
    public EntitiesDescriptor getEntitiesDescriptor(String name) throws MetadataProviderException {
        Lock readLock = providerLock.readLock();
        readLock.lock();

        EntitiesDescriptor descriptor = null;
        try {
            for (MetadataProvider provider : providers) {
                log.debug("Checking child metadata provider for entities descriptor with name: {}", name);
                try {
                    descriptor = provider.getEntitiesDescriptor(name);
View Full Code Here

            toRemove.clear();
        }
       
        Iterator<EntitiesDescriptor> entitiesIter = entitiesDescriptor.getEntitiesDescriptors().iterator();
        while(entitiesIter.hasNext()) {
            EntitiesDescriptor entitiesChild = entitiesIter.next();
            log.trace("Processing EntitiesDescriptor member: {}", entitiesChild.getName());
            try {
                processEntityGroup(entitiesChild);
            } catch (FilterException e) {
               log.error("EntitiesDescriptor '{}' failed signature verification, removing from metadata provider",
                       entitiesChild.getName());
               toRemove.add(entitiesChild);
            }
        }
       
        if (!toRemove.isEmpty()) {
View Full Code Here

    /** {@inheritDoc} */
    public EntitiesDescriptor getEntitiesDescriptor(String name) throws MetadataProviderException {
        Lock readLock = providerLock.readLock();
        readLock.lock();

        EntitiesDescriptor descriptor = null;
        try {
            for (MetadataProvider provider : providers) {
                log.debug("Checking child metadata provider for entities descriptor with name: {}", name);
                try {
                    descriptor = provider.getEntitiesDescriptor(name);
View Full Code Here

        // Next, contained EntityDescriptors
        List<EntitiesDescriptor> entitiesDescriptors = descriptor.getEntitiesDescriptors();
        if (entitiesDescriptors != null && !entitiesDescriptors.isEmpty()) {
            List<EntitiesDescriptor> emptyEntitiesDescriptors = new ArrayList<EntitiesDescriptor>();
            Iterator<EntitiesDescriptor> entitiesDescriptorsItr = entitiesDescriptors.iterator();
            EntitiesDescriptor entitiesDescriptor;
            while (entitiesDescriptorsItr.hasNext()) {
                entitiesDescriptor = entitiesDescriptorsItr.next();
                filterEntitiesDescriptor(entitiesDescriptor);
                if (getRemoveEmptyEntitiesDescriptors()) {
                    // Remove the EntitiesDescriptor if does not contain any EntitiesDescriptors or EntityDescriptors
                    if ((entitiesDescriptor.getEntityDescriptors() == null || entitiesDescriptor.getEntityDescriptors()
                            .isEmpty())
                            && (entitiesDescriptor.getEntitiesDescriptors() == null || entitiesDescriptor
                                    .getEntitiesDescriptors().isEmpty())) {
                        log.trace("Filtering out entity descriptor {} from entity group {}", entitiesDescriptor
                                .getName(), descriptor.getName());
                        emptyEntitiesDescriptors.add(entitiesDescriptor);
                    }
                }
            }
View Full Code Here

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

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlElement, Element domElement) {

        EntitiesDescriptor entitiesDescriptor = (EntitiesDescriptor) samlElement;

        // Set the ID attribute
        if (entitiesDescriptor.getID() != null) {
            log.debug("Writing ID attribute to EntitiesDescriptor DOM element.");
            domElement.setAttributeNS(null, EntitiesDescriptor.ID_ATTRIB_NAME, entitiesDescriptor.getID());
            domElement.setIdAttributeNS(null, EntitiesDescriptor.ID_ATTRIB_NAME, true);
        }

        // Set the validUntil attribute
        if (entitiesDescriptor.getValidUntil() != null) {
            log.debug("Writting validUntil attribute to EntitiesDescriptor DOM element");
            String validUntilStr = Configuration.getSAMLDateFormatter().print(entitiesDescriptor.getValidUntil());
            domElement.setAttributeNS(null, TimeBoundSAMLObject.VALID_UNTIL_ATTRIB_NAME, validUntilStr);
        }

        // Set the cacheDuration attribute
        if (entitiesDescriptor.getCacheDuration() != null) {
            log.debug("Writting cacheDuration attribute to EntitiesDescriptor DOM element");
            String cacheDuration = XMLHelper.longToDuration(entitiesDescriptor.getCacheDuration());
            domElement.setAttributeNS(null, CacheableSAMLObject.CACHE_DURATION_ATTRIB_NAME, cacheDuration);
        }

        // Set the Name attribute
        if (entitiesDescriptor.getName() != null) {
            log.debug("Writting Name attribute to EntitiesDescriptor DOM element");
            domElement.setAttributeNS(null, EntitiesDescriptor.NAME_ATTRIB_NAME, entitiesDescriptor.getName());
        }
    }
View Full Code Here

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

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

TOP

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

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.