public class ChainingMetadataProvider extends BaseMetadataProvider implements ObservableMetadataProvider
ObservableMetadataProvider.Observer
unmarshallerFactory
Constructor and Description |
---|
ChainingMetadataProvider()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetadataProvider(MetadataProvider newProvider)
Adds a metadata provider to the list of registered providers.
|
void |
destroy()
Destroys the metadata provider and frees any resources current held by it.
|
protected void |
doAddMetadataProvider(MetadataProvider provider,
List<MetadataProvider> providerList)
Adds a metadata provider to the given collection.
|
protected void |
emitChangeEvent()
Convenience method for calling
ObservableMetadataProvider.Observer.onEvent(MetadataProvider) on
every registered Observer passing in this provider. |
EntitiesDescriptor |
getEntitiesDescriptor(String name)
Gets a valid named EntitiesDescriptor from the metadata.
|
EntityDescriptor |
getEntityDescriptor(String entityID)
Gets the valid metadata for a given entity.
|
XMLObject |
getMetadata()
Gets the metadata from every registered provider and places each within a newly created EntitiesDescriptor.
|
MetadataFilter |
getMetadataFilter()
Gets the metadata filter applied to the metadata.
|
List<ObservableMetadataProvider.Observer> |
getObservers()
Gets the list of observers for the provider.
|
List<MetadataProvider> |
getProviders()
Gets an immutable the list of currently registered providers.
|
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 |
removeMetadataProvider(MetadataProvider provider)
Removes a metadata provider from the list of registered providers.
|
void |
setMetadataFilter(MetadataFilter newFilter)
Sets the metadata filter applied to the metadata.
|
void |
setProviders(List<MetadataProvider> newProviders)
Replaces the current set of metadata providers with give collection.
|
void |
setRequireValidMetadata(boolean requireValidMetadata)
Sets whether the metadata returned by queries must be valid.
|
requireValidMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
requireValidMetadata
public List<MetadataProvider> getProviders()
public void setProviders(List<MetadataProvider> newProviders) throws MetadataProviderException
newProviders
- the metadata providers to replace the current providers withMetadataProviderException
- thrown if there is a problem adding the metadata providerpublic void addMetadataProvider(MetadataProvider newProvider) throws MetadataProviderException
newProvider
- the provider to be addedMetadataProviderException
- thrown if there is a problem adding the metadata providerprotected void doAddMetadataProvider(MetadataProvider provider, List<MetadataProvider> providerList)
MetadataProvider.requireValidMetadata()
property is set to the value of this metadata
provider's property. If the given metadata provider is an instance of ObservableMetadataProvider
then a
ContainedProviderObserver is added to it as well.provider
- provider to be added to the collectionproviderList
- collection to which the provider is addedpublic void removeMetadataProvider(MetadataProvider provider)
provider
- provider to be removedpublic void setRequireValidMetadata(boolean requireValidMetadata)
setRequireValidMetadata
in interface MetadataProvider
setRequireValidMetadata
in class BaseMetadataProvider
requireValidMetadata
- whether the metadata returned by queries must be validpublic MetadataFilter getMetadataFilter()
getMetadataFilter
in interface MetadataProvider
getMetadataFilter
in class BaseMetadataProvider
public void setMetadataFilter(MetadataFilter newFilter) throws MetadataProviderException
setMetadataFilter
in interface MetadataProvider
setMetadataFilter
in class BaseMetadataProvider
newFilter
- the metadata filter applied to the metadataMetadataProviderException
- thrown if the provider can not apply the filter to the metadatapublic XMLObject getMetadata() throws MetadataProviderException
getMetadata
in interface MetadataProvider
MetadataProviderException
- thrown if the provider can not fetch the metadata, must not be thrown simply if
there is no metadata to fetchpublic EntitiesDescriptor getEntitiesDescriptor(String name) throws MetadataProviderException
getEntitiesDescriptor
in interface MetadataProvider
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 namepublic EntityDescriptor getEntityDescriptor(String entityID) throws MetadataProviderException
getEntityDescriptor
in interface MetadataProvider
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 IDpublic List<RoleDescriptor> getRole(String entityID, QName roleName) throws MetadataProviderException
getRole
in interface MetadataProvider
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 rolespublic RoleDescriptor getRole(String entityID, QName roleName, String supportedProtocol) throws MetadataProviderException
getRole
in interface MetadataProvider
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 protocolpublic List<ObservableMetadataProvider.Observer> getObservers()
getObservers
in interface ObservableMetadataProvider
public void destroy()
destroy
in class BaseMetadataProvider
protected void emitChangeEvent()
ObservableMetadataProvider.Observer.onEvent(MetadataProvider)
on
every registered Observer passing in this provider.Copyright © 2018 JBoss by Red Hat. All rights reserved.