public abstract class AbstractMetadataProvider extends BaseMetadataProvider
unmarshallerFactory
Constructor and Description |
---|
AbstractMetadataProvider()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearDescriptorIndex()
Clears the entity ID to entity descriptor index.
|
void |
destroy()
Destroys the metadata provider and frees any resources current held by it.
|
protected EntitiesDescriptor |
doGetEntitiesDescriptor(String name)
Gets the named EntitiesDescriptor from the metadata.
|
protected EntityDescriptor |
doGetEntityDescriptor(String entityID)
Gets the identified EntityDescriptor from the metadata.
|
protected abstract XMLObject |
doGetMetadata()
Gets the metadata currently held by the provider.
|
protected List<RoleDescriptor> |
doGetRole(String entityID,
QName roleName)
Gets the identified roles from an EntityDescriptor.
|
protected RoleDescriptor |
doGetRole(String entityID,
QName roleName,
String supportedProtocol)
Gets the role which supports the given protocol.
|
protected void |
doInitialization()
Subclasses should override this method to perform any initialization logic necessary.
|
protected void |
filterMetadata(XMLObject metadata)
Filters the given metadata.
|
EntitiesDescriptor |
getEntitiesDescriptor(String name)
Gets a valid named EntitiesDescriptor from the metadata.
|
protected EntitiesDescriptor |
getEntitiesDescriptorByName(String name,
EntitiesDescriptor rootDescriptor)
Gets the entities descriptor with the given name.
|
EntityDescriptor |
getEntityDescriptor(String entityID)
Gets the valid metadata for a given entity.
|
protected EntityDescriptor |
getEntityDescriptorById(String entityID,
EntitiesDescriptor descriptor)
Gets the entity descriptor with the given ID that is a descendant of the given entities descriptor.
|
protected EntityDescriptor |
getEntityDescriptorById(String entityID,
XMLObject metadata)
Gets the EntityDescriptor with the given ID from the cached metadata.
|
XMLObject |
getMetadata()
Gets the valid metadata tree, after the registered filter has been applied.
|
ParserPool |
getParserPool()
Gets the pool of parsers to use to parse XML.
|
List<RoleDescriptor> |
getRole(String entityID,
QName roleName)
Gets the valid role descriptors of a given type for a given entity.
|
RoleDescriptor |
getRole(String entityID,
QName roleName,
String supportedProtocol)
Gets the valid role descriptors of a given type for a given entity that support the given protocol.
|
void |
initialize()
Initializes this metadata provider.
|
boolean |
isFailFastInitialization()
Gets whether problems during initialization should cause the provider to fail or go on without metadata.
|
boolean |
isInitialized()
Gets whether this provider is initialized.
|
protected boolean |
isValid(XMLObject descriptor)
Returns whether the given descriptor is valid.
|
protected void |
releaseMetadataDOM(XMLObject metadata)
Releases the DOM representation from the metadata object.
|
void |
setFailFastInitialization(boolean failFast)
Sets whether problems during initialization should cause the provider to fail or go on without metadata.
|
protected void |
setInitialized(boolean isInitialized)
Sets whether this provider is initialized.
|
void |
setParserPool(ParserPool pool)
Sets the pool of parsers to use to parse XML.
|
protected XMLObject |
unmarshallMetadata(InputStream metadataInput)
Unmarshalls the metadata from the given stream.
|
getMetadataFilter, requireValidMetadata, setMetadataFilter, setRequireValidMetadata
public XMLObject getMetadata() throws MetadataProviderException
MetadataProviderException
- thrown if the provider can not fetch the metadata, must not be thrown simply if
there is no metadata to fetchprotected abstract XMLObject doGetMetadata() throws MetadataProviderException
MetadataProviderException
- thrown if there is a problem retrieving the metadatapublic EntitiesDescriptor getEntitiesDescriptor(String name) throws MetadataProviderException
name
- the name of the EntitiesDescriptorMetadataProviderException
- thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no EntitiesDescriptor with the given nameprotected EntitiesDescriptor doGetEntitiesDescriptor(String name) throws MetadataProviderException
name
- the name of the EntitiesDescriptor, never nullMetadataProviderException
- thrown if there is a problem searching for the EntitiesDescriptorpublic EntityDescriptor getEntityDescriptor(String entityID) throws MetadataProviderException
entityID
- the ID of the entityMetadataProviderException
- thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no EntityDescriptor with the given IDprotected EntityDescriptor doGetEntityDescriptor(String entityID) throws MetadataProviderException
entityID
- ID of the EntityDescriptor, never nullMetadataProviderException
- thrown if there is a problem searching for the EntityDescriptorpublic List<RoleDescriptor> getRole(String entityID, QName roleName) throws MetadataProviderException
entityID
- the ID of the entityroleName
- the role typeMetadataProviderException
- thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no such entity with the given rolesprotected List<RoleDescriptor> doGetRole(String entityID, QName roleName) throws MetadataProviderException
entityID
- ID of the entity from which to retrieve the roles, never nullroleName
- name of the roles to search for, never nullMetadataProviderException
- thrown if there is a problem searching for the rolespublic RoleDescriptor getRole(String entityID, QName roleName, String supportedProtocol) throws MetadataProviderException
entityID
- the ID of the entityroleName
- the role typesupportedProtocol
- the protocol supported by the roleMetadataProviderException
- thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no such entity with the given role supporting the given protocolprotected RoleDescriptor doGetRole(String entityID, QName roleName, String supportedProtocol) throws MetadataProviderException
entityID
- ID of the entity from which to retrieve roles, never nullroleName
- name of the role to search for, never nullsupportedProtocol
- protocol to search for, never nullMetadataProviderException
- thrown if there is a problem search for the rolespublic boolean isInitialized()
protected void setInitialized(boolean isInitialized)
isInitialized
- whether this provider is initializedpublic boolean isFailFastInitialization()
public void setFailFastInitialization(boolean failFast)
failFast
- whether problems during initialization should cause the provider to failpublic ParserPool getParserPool()
public void setParserPool(ParserPool pool)
pool
- pool of parsers to use to parse XMLpublic void initialize() throws MetadataProviderException
MetadataProviderException
- thrown if there is a problem initializing the problem and fail fast
Initialization is enabledpublic void destroy()
destroy
in class BaseMetadataProvider
protected void doInitialization() throws MetadataProviderException
MetadataProviderException
- thrown if there is a problem initializing the providerprotected void clearDescriptorIndex()
protected XMLObject unmarshallMetadata(InputStream metadataInput) throws UnmarshallingException
metadataInput
- the input reader to the metadata.UnmarshallingException
- thrown if the metadata can no be unmarshalledprotected void filterMetadata(XMLObject metadata) throws FilterException
metadata
- the metadata to be filteredFilterException
- thrown if there is an error filtering the metadataprotected void releaseMetadataDOM(XMLObject metadata)
metadata
- the metadata objectprotected EntityDescriptor getEntityDescriptorById(String entityID, XMLObject metadata)
entityID
- the ID of the entity to get the descriptor formetadata
- metadata associated with the entityprotected EntityDescriptor getEntityDescriptorById(String entityID, EntitiesDescriptor descriptor)
entityID
- the ID of the entity whose descriptor is to be fetcheddescriptor
- the entities descriptorprotected EntitiesDescriptor getEntitiesDescriptorByName(String name, EntitiesDescriptor rootDescriptor)
name
- name of the entities descriptorrootDescriptor
- the root descriptor to search inprotected boolean isValid(XMLObject descriptor)
descriptor
- the descriptor to checkCopyright © 2018 JBoss by Red Hat. All rights reserved.