public interface LocationRegistry
String
representation of a spec, this can
be used to create a Location
instance.Modifier and Type | Method and Description |
---|---|
boolean |
canMaybeResolve(java.lang.String spec)
Deprecated.
since 0.7.0, not really needed, and semantics are weak; use
resolve(String, Boolean, Map) |
LocationDefinition |
getDefinedLocationById(java.lang.String id)
returns a LocationDefinition given its ID (usually a random string), or null if none
|
LocationDefinition |
getDefinedLocationByName(java.lang.String name)
returns a LocationDefinition given its name (e.g.
|
java.util.Map<java.lang.String,LocationDefinition> |
getDefinedLocations()
map of ID (possibly randomly generated) to the definition (spec, name, id, and props;
where spec is the spec as defined, for instance possibly another named:xxx location)
|
java.util.Map |
getProperties() |
void |
removeDefinedLocation(java.lang.String id)
removes the defined location from the registry (applications running there are unaffected)
|
java.util.List<Location> |
resolve(java.lang.Iterable<?> spec)
As
resolve(String) but takes collections (of strings or locations) |
Location |
resolve(LocationDefinition l)
As {@link #resolve(LocationDefinition, Boolean, Map), with the location managed, and no additional flags,
unwrapping the result (throwing if not resolvable)
|
Maybe<Location> |
resolve(LocationDefinition ld,
java.lang.Boolean manage,
java.util.Map locationFlags)
Returns a fully populated (config etc) location from the given definition, with optional add'l flags.
|
Location |
resolve(LocationDefinition l,
java.util.Map<?,?> locationFlags)
Deprecated.
since 0.7.0, use
resolve(LocationDefinition, Boolean, Map) |
Location |
resolve(java.lang.String spec)
See
resolve(String, Boolean, Map) ; asks for the location to be managed, and supplies no additional flags,
and unwraps the result (throwing if the spec cannot be resolve) |
Maybe<Location> |
resolve(java.lang.String spec,
java.lang.Boolean manage,
java.util.Map locationFlags)
Returns a location created from the given spec, which might correspond to a definition, or created on-the-fly.
|
Location |
resolve(java.lang.String spec,
java.util.Map locationFlags)
As
resolve(String, Boolean, Map) , but unwrapped |
Location |
resolveForPeeking(LocationDefinition l)
Deprecated.
since 0.7.0, use
resolve(LocationDefinition, Boolean, Map) |
Location |
resolveIfPossible(java.lang.String spec)
Deprecated.
since 0.7.0 use
resolve(String, Boolean, Map) |
java.util.List<Location> |
resolveList(java.lang.Object specList)
Takes a string, interpreted as a comma-separated (or JSON style, when you need internal double quotes or commas) list;
or a list, passed to
resolve(Iterable) ; or null/empty (empty list),
and returns a list of resolved (created and managed) locations |
void |
updateDefinedLocation(LocationDefinition l)
adds or updates the given defined location
|
java.util.Map<java.lang.String,LocationDefinition> getDefinedLocations()
LocationDefinition getDefinedLocationById(java.lang.String id)
LocationDefinition getDefinedLocationByName(java.lang.String name)
void updateDefinedLocation(LocationDefinition l)
void removeDefinedLocation(java.lang.String id)
@Beta Maybe<Location> resolve(LocationDefinition ld, java.lang.Boolean manage, java.util.Map locationFlags)
The manage parameter is Boolean
so that null can be used to say rely on anything in the flags.
Location resolve(LocationDefinition l)
@Beta Maybe<Location> resolve(java.lang.String spec, java.lang.Boolean manage, java.util.Map locationFlags)
@Deprecated Location resolveForPeeking(LocationDefinition l)
resolve(LocationDefinition, Boolean, Map)
@Deprecated Location resolve(LocationDefinition l, java.util.Map<?,?> locationFlags)
resolve(LocationDefinition, Boolean, Map)
Location resolve(java.lang.String spec)
resolve(String, Boolean, Map)
; asks for the location to be managed, and supplies no additional flags,
and unwraps the result (throwing if the spec cannot be resolve)@Deprecated boolean canMaybeResolve(java.lang.String spec)
resolve(String, Boolean, Map)
resolve(String, Boolean, Map)
which has stronger guaranteesLocation resolve(java.lang.String spec, @Nullable java.util.Map locationFlags)
resolve(String, Boolean, Map)
, but unwrappedjava.util.NoSuchElementException
- if the spec cannot be resolved@Deprecated Location resolveIfPossible(java.lang.String spec)
resolve(String, Boolean, Map)
resolve(String)
but returning null (never throwing)java.util.List<Location> resolve(java.lang.Iterable<?> spec)
resolve(String)
but takes collections (of strings or locations)
Expects a collection of elements being individual location spec strings or locations, and returns a list of resolved (newly created and managed) locations.
From 0.7.0 this no longer flattens lists (nested lists are disallowed) or parses comma-separated elements (they are resolved as-is)
java.util.List<Location> resolveList(java.lang.Object specList)
resolve(Iterable)
; or null/empty (empty list),
and returns a list of resolved (created and managed) locationsjava.util.Map getProperties()