Class ResolverMap
java.lang.Object
com.predic8.membrane.core.resolver.ResolverMap
A ResolverMap consists of a list of
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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionResolverMap(TimerManager timerManager, HttpClientFactory httpClientFactory, KubernetesClientFactory kubernetesClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclone()static StringFirst param is the parent.getChildren(String uri) Returns the list of child resources of the resource identified by the URL.longgetTimestamp(String uri) Returns the modification date of the resource.voidobserveChange(String uri, ExceptionThrowingConsumer<InputStream> consumer) Calls the consumer when the InputStream for the requested URL changes.Returns the InputStream for the requested URL.voidsetEtcdResolver(EtcdResolver etcdResolver)
-
Constructor Details
-
ResolverMap
public ResolverMap() -
ResolverMap
public ResolverMap(TimerManager timerManager, HttpClientFactory httpClientFactory, KubernetesClientFactory kubernetesClientFactory)
-
-
Method Details
-
combine
First param is the parent. The following params will be combined to one path e.g. "/foo/bar", "baz/x.yaml" ", "soo" => "/foo/bar/baz/soo"- Parameters:
locations- List of relative paths- Returns:
- combined path
-
clone
-
addSchemaResolver
-
addRuleResolver
-
getTimestamp
Description copied from interface:ResolverReturns the modification date of the resource.- Specified by:
getTimestampin interfaceResolver- Returns:
- 0 if the resolver does not support this functionality.
- Throws:
FileNotFoundException- if the resource identified by the URL does not exist.
-
resolve
Description copied from interface:ResolverReturns the InputStream for the requested URL.- Specified by:
resolvein interfaceResolver- Throws:
ResourceRetrievalException- if the resource identified by the URL does not exist.
-
observeChange
public void observeChange(String uri, ExceptionThrowingConsumer<InputStream> consumer) throws ResourceRetrievalException Description copied from interface:ResolverCalls the consumer when the InputStream for the requested URL changes.- Specified by:
observeChangein interfaceResolver- Throws:
ResourceRetrievalException- if the resource identified by the URL does not exist.
-
getChildren
Description copied from interface:ResolverReturns the list of child resources of the resource identified by the URL.For example, a list of filenames in the directory identified by the URL.
- Specified by:
getChildrenin interfaceResolver- Returns:
- null if the resolver does not support this functionality.
- Throws:
FileNotFoundException- if the resource identified by the URL does not exist.
-
getHTTPSchemaResolver
-
getFileSchemaResolver
-
toLSResourceResolver
-
toExternalResolver
-
getEtcdResolver
-
setEtcdResolver
-
getKubernetesSchemaResolver
-