/** {@inheritDoc} */ public XMLObject getMetadata() throws MetadataProviderException { if (!isInitialized()) { throw new MetadataProviderException("Metadata provider has not been initialized"); } XMLObject metadata = doGetMetadata(); if (metadata == null) { log.debug("Metadata provider does not currently contain any metadata"); } if (!isValid(metadata)) { log.debug("Metadata document exists, but it is no longer valid"); return null; } return metadata; }
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 if (!isValid(descriptor)) { log.trace("Found entity descriptor for entity with ID {} but it is no longer valid, skipping it.", entityID);
if (!isValid(roleDescItr.next())) { log.debug("Metadata document contained a role of type {} for entity {}, but it was invalid", roleName, entityID);
/** {@inheritDoc} */ public EntitiesDescriptor getEntitiesDescriptor(String name) throws MetadataProviderException { if (!isInitialized()) { throw new MetadataProviderException("Metadata provider has not been initialized"); } 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", name); return null; } return descriptor; }
/** {@inheritDoc} */ public EntityDescriptor getEntityDescriptor(String entityID) throws MetadataProviderException { if (!isInitialized()) { throw new MetadataProviderException("Metadata provider has not been initialized"); } 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", entityID); return null; } return descriptor; }
if (!isValid(role)) { log .debug(
/** * Gets the entities descriptor with the given name. * * @param name name of the entities descriptor * @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(); if (childDescriptors == null || childDescriptors.isEmpty()) { return null; } for (EntitiesDescriptor childDescriptor : childDescriptors) { childDescriptor = getEntitiesDescriptorByName(name, childDescriptor); if (childDescriptor != null) { descriptor = childDescriptor; } } } return descriptor; }
for (EntityDescriptor entityDescriptor : entityDescriptors) { log.trace("Checking entity descriptor with entity ID {}", entityDescriptor.getEntityID()); if (DatatypeHelper.safeEquals(entityDescriptor.getEntityID(), entityID) && isValid(entityDescriptor)) { return entityDescriptor;