public class ResolverMap extends Object implements Cloneable, Resolver
SchemaResolvers.
It is itself a Resolver: Requests to resolve a URL are delegated
to the corresponding SchemaResolver child depending on the URL's
schema.
Note that this class is not thread-safe! The ResolverMap is setup during
Membrane's single-threaded startup and is only used read-only thereafter.| Modifier and Type | Class and Description |
|---|---|
class |
ResolverMap.ExternalResolverConverter |
| Constructor and Description |
|---|
ResolverMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSchemaResolver(SchemaResolver sr) |
ResolverMap |
clone() |
static String |
combine(String... locations) |
List<String> |
getChildren(String uri)
Returns the list of child resources of the resource identified by the URL.
|
EtcdResolver |
getEtcdResolver() |
SchemaResolver |
getFileSchemaResolver() |
HTTPSchemaResolver |
getHTTPSchemaResolver() |
long |
getTimestamp(String uri)
Returns the modification date of the resource.
|
void |
observeChange(String uri,
Consumer<InputStream> consumer)
Calls the consumer when the InputStream for the requested URL changes.
|
InputStream |
resolve(String uri)
Returns the InputStream for the requested URL.
|
void |
setEtcdResolver(EtcdResolver etcdResolver) |
ResolverMap.ExternalResolverConverter |
toExternalResolver() |
LSResourceResolver |
toLSResourceResolver() |
public ResolverMap clone()
public void addSchemaResolver(SchemaResolver sr)
public long getTimestamp(String uri) throws FileNotFoundException
ResolvergetTimestamp in interface ResolverFileNotFoundException - if the resource identified by the URL does not exist.public InputStream resolve(String uri) throws ResourceRetrievalException
Resolverresolve in interface ResolverResourceRetrievalException - if the resource identified by the URL does not exist.public void observeChange(String uri, Consumer<InputStream> consumer) throws ResourceRetrievalException
ResolverobserveChange in interface ResolverResourceRetrievalException - if the resource identified by the URL does not exist.public List<String> getChildren(String uri) throws FileNotFoundException
ResolvergetChildren in interface ResolverFileNotFoundException - if the resource identified by the URL does not exist.public HTTPSchemaResolver getHTTPSchemaResolver()
public SchemaResolver getFileSchemaResolver()
public LSResourceResolver toLSResourceResolver()
public ResolverMap.ExternalResolverConverter toExternalResolver()
public EtcdResolver getEtcdResolver()
public void setEtcdResolver(EtcdResolver etcdResolver)
Copyright © 2021. All Rights Reserved.