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()
Deprecated.
since 0.12.0 use
getDefinedLocations(boolean) passing true .
some clients might only want the things actually defined here, which is cheaper. |
java.util.Map<java.lang.String,LocationDefinition> |
getDefinedLocations(boolean includeThingsWeAreFacadeFor)
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.List<Location> |
getListOfLocationsManaged(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 of strings, or null (giving the empty list) and returns a list of managed locations.
|
Location |
getLocationManaged(java.lang.String spec)
A combination of
getLocationSpec(String) then LocationManager.createLocation(LocationSpec) ,
mainly for use in tests or specialised situations where a managed location is needed directly. |
Location |
getLocationManaged(java.lang.String spec,
java.util.Map<?,?> locationFlags)
As
getLocationManaged(String) applying the config as per getLocationSpec(String, Map) . |
Maybe<LocationSpec<? extends Location>> |
getLocationSpec(LocationDefinition ld)
As
getLocationSpec(String) where the caller has a LocationDefinition . |
Maybe<LocationSpec<? extends Location>> |
getLocationSpec(LocationDefinition ld,
java.util.Map<?,?> locationFlags)
As
getLocationSpec(String,Map) where the caller has a LocationDefinition . |
Maybe<LocationSpec<? extends Location>> |
getLocationSpec(java.lang.String spec)
Create a
LocationSpec representing the given spec string such as a named location
or using a resolver prefix such as jclouds:aws-ec2. |
Maybe<LocationSpec<? extends Location>> |
getLocationSpec(java.lang.String spec,
java.util.Map<?,?> locationFlags)
As
getLocationSpec(String) but also setting the given flags configured on the resulting spec. |
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)
Deprecated.
since 0.9.0 use
getListOfLocationsManaged(Object) |
Location |
resolve(LocationDefinition l)
Deprecated.
since 0.9.0 use
getLocationSpec(LocationDefinition, Map) and then manage it as needed |
Maybe<Location> |
resolve(LocationDefinition ld,
java.lang.Boolean manage,
java.util.Map locationFlags)
Deprecated.
since 0.9.0 use
getLocationSpec(String, Map) or getLocationManaged(String, Map) |
Location |
resolve(java.lang.String spec)
Deprecated.
since 0.9.0 use
getLocationSpec(String) or getLocationManaged(String) |
Maybe<Location> |
resolve(java.lang.String spec,
java.lang.Boolean manage,
java.util.Map locationFlags)
Deprecated.
since 0.9.0 use
getLocationSpec(String, Map) or getLocationManaged(String, Map) |
Location |
resolve(java.lang.String spec,
java.util.Map locationFlags)
Deprecated.
since 0.9.0 use
getLocationSpec(String, Map) and then manage it as needed |
java.util.List<Location> |
resolveList(java.lang.Object specList)
Deprecated.
since 0.9.0 use
getListOfLocationsManaged(Object) |
void |
updateDefinedLocation(LocationDefinition l)
Deprecated.
since 0.12.0 use
updateDefinedLocationNonPersisted(LocationDefinition) ;
it's exactly the same, just the name makes it clear |
void |
updateDefinedLocationNonPersisted(LocationDefinition l)
adds or updates the given defined location in this registry; note it is not persisted;
callers should consider adding to the
BrooklynTypeRegistry instead |
java.util.Map<java.lang.String,LocationDefinition> getDefinedLocations(boolean includeThingsWeAreFacadeFor)
@Deprecated java.util.Map<java.lang.String,LocationDefinition> getDefinedLocations()
getDefinedLocations(boolean)
passing true
.
some clients might only want the things actually defined here, which is cheaper.LocationDefinition getDefinedLocationById(java.lang.String id)
LocationDefinition getDefinedLocationByName(java.lang.String name)
BrooklynTypeRegistry
for registered items, then in this list, or null if none@Deprecated void updateDefinedLocation(LocationDefinition l)
updateDefinedLocationNonPersisted(LocationDefinition)
;
it's exactly the same, just the name makes it clearvoid updateDefinedLocationNonPersisted(LocationDefinition l)
BrooklynTypeRegistry
insteadvoid removeDefinedLocation(java.lang.String id)
@Deprecated Maybe<Location> resolve(LocationDefinition ld, java.lang.Boolean manage, java.util.Map locationFlags)
getLocationSpec(String, Map)
or getLocationManaged(String, Map)
The manage parameter is Boolean
so that null can be used to say rely on anything in the flags.
@Deprecated Location resolve(LocationDefinition l)
getLocationSpec(LocationDefinition, Map)
and then manage it as needed@Deprecated Maybe<Location> resolve(java.lang.String spec, java.lang.Boolean manage, java.util.Map locationFlags)
getLocationSpec(String, Map)
or getLocationManaged(String, Map)
@Deprecated Location resolve(java.lang.String spec)
getLocationSpec(String)
or getLocationManaged(String)
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 guarantees@Deprecated Location resolve(java.lang.String spec, @Nullable java.util.Map locationFlags)
getLocationSpec(String, Map)
and then manage it as neededresolve(String, Boolean, Map)
, but unwrappedjava.util.NoSuchElementException
- if the spec cannot be resolved@Deprecated java.util.List<Location> resolve(java.lang.Iterable<?> spec)
getListOfLocationsManaged(Object)
getLocationManaged(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)
@Deprecated java.util.List<Location> resolveList(java.lang.Object specList)
getListOfLocationsManaged(Object)
resolve(Iterable)
; or null/empty (empty list),
and returns a list of resolved (created and managed) locationsMaybe<LocationSpec<? extends Location>> getLocationSpec(java.lang.String spec)
LocationSpec
representing the given spec string such as a named location
or using a resolver prefix such as jclouds:aws-ec2.
This can then be inspected, assigned to an EntitySpec
,
or passed to LocationManager.createLocation(LocationSpec)
to create directly.
(For that last case, common in tests, see getLocationManaged(String)
.)Maybe<LocationSpec<? extends Location>> getLocationSpec(java.lang.String spec, java.util.Map<?,?> locationFlags)
getLocationSpec(String)
but also setting the given flags configured on the resulting spec.Maybe<LocationSpec<? extends Location>> getLocationSpec(LocationDefinition ld)
getLocationSpec(String)
where the caller has a LocationDefinition
.Maybe<LocationSpec<? extends Location>> getLocationSpec(LocationDefinition ld, java.util.Map<?,?> locationFlags)
getLocationSpec(String,Map)
where the caller has a LocationDefinition
.Location getLocationManaged(java.lang.String spec)
getLocationSpec(String)
then LocationManager.createLocation(LocationSpec)
,
mainly for use in tests or specialised situations where a managed location is needed directly.
The caller is responsible for ensuring that the resulting Location
is cleaned up, ie removed from management via LocationManager.unmanage(Location)
directly or linking it to
an Entity
or another Location
which will unmanage it.Location getLocationManaged(java.lang.String spec, java.util.Map<?,?> locationFlags)
getLocationManaged(String)
applying the config as per getLocationSpec(String, Map)
.java.util.List<Location> getListOfLocationsManaged(java.lang.Object specList)
The caller is responsible for ensuring these get cleaned up, as described at getLocationManaged(String)
.
java.util.Map getProperties()