/** * Gets the identified EntityDescriptor from the metadata. This method should not check if the provider is * initialized, if arguments are null, if the metadata is valid, etc. All of this is done by the invoker of this * method. * * @param entityID ID of the EntityDescriptor, never null * * @return the identified EntityDescriptor or null if no such EntityDescriptor exists * * @throws MetadataProviderException thrown if there is a problem searching for the EntityDescriptor */ protected EntityDescriptor doGetEntityDescriptor(String entityID) throws MetadataProviderException { XMLObject metadata = doGetMetadata(); if (metadata == null) { log.debug("Metadata document was empty, unable to look for an EntityDescriptor with the ID {}", entityID); return null; } return getEntityDescriptorById(entityID, metadata); }
/** * Gets the named EntitiesDescriptor from the metadata. This method should not check if the provider is initialized, * if arguments are null, if metadata is valid, etc. All of this is done by the invoker of this method. * * @param name the name of the EntitiesDescriptor, never null * * @return the named EntitiesDescriptor or null if no such EntitiesDescriptor exists * * @throws MetadataProviderException thrown if there is a problem searching for the EntitiesDescriptor */ protected EntitiesDescriptor doGetEntitiesDescriptor(String name) throws MetadataProviderException { XMLObject metadata = doGetMetadata(); if (metadata == null) { 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; }
/** {@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; }