Brooklyn

brooklyn.location
[Java] Interface LocationRegistry


@SuppressWarnings("rawtypes")
public interface LocationRegistry

The registry of the sorts of locations that brooklyn knows about. Given a {@LocationDefinition} or a java.lang.String representation of a spec, this can be used to create a Location instance.


Method Summary
boolean canMaybeResolve(java.lang.String spec)

Returns true/false depending whether spec seems like a valid location, that is it has a chance of being resolved (depending on the spec) but NOT guaranteed; see resolveIfPossible(String) which has stronger guarantees

boolean canResolve(java.lang.String spec)

deprecated:
since 0.6.0,
@see resolveIfPossible(String) and #canMaybeResolve(String) as a "true" here does not mean it can actually resolve it

LocationDefinition getDefinedLocation(java.lang.String id)

@deprecated since 0.6.0; use getDefinedLocationById(String) (ID should be explicit because this is usually *not* the method people want)

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. for named locations, supply the bit after the "named:" prefix), or null if none

java.util.Map 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)

Location resolve(LocationDefinition l)

returns fully populated (config etc) location from the given definition

Location resolve(java.lang.String spec)

See resolve(String, Map) (with no options)

Location resolve(java.lang.String spec, java.util.Map locationFlags)

Returns a location created from the given spec, which might correspond to a definition, or created on-the-fly.

java.util.List resolve(java.lang.Iterable spec)

As resolve(String) but works with a collection of location specs.

Location resolveIfPossible(java.lang.String spec)

as resolve(String) but returning null (never throwing)

void updateDefinedLocation(LocationDefinition l)

adds or updates the given defined location

 

Method Detail

canMaybeResolve

public boolean canMaybeResolve(java.lang.String spec)
Returns true/false depending whether spec seems like a valid location, that is it has a chance of being resolved (depending on the spec) but NOT guaranteed; see resolveIfPossible(String) which has stronger guarantees


canResolve

@Deprecated
public boolean canResolve(java.lang.String spec)
deprecated:
since 0.6.0,
See Also:


getDefinedLocation

@Deprecated
public LocationDefinition getDefinedLocation(java.lang.String id)
deprecated:
since 0.6.0; use getDefinedLocationById(String) (ID should be explicit because this is usually *not* the method people want)


getDefinedLocationById

public LocationDefinition getDefinedLocationById(java.lang.String id)
returns a LocationDefinition given its ID (usually a random string), or null if none


getDefinedLocationByName

public LocationDefinition getDefinedLocationByName(java.lang.String name)
returns a LocationDefinition given its name (e.g. for named locations, supply the bit after the "named:" prefix), or null if none


getDefinedLocations

public java.util.Map 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)


getProperties

public java.util.Map getProperties()


removeDefinedLocation

public void removeDefinedLocation(java.lang.String id)
removes the defined location from the registry (applications running there are unaffected)


resolve

public Location resolve(LocationDefinition l)
returns fully populated (config etc) location from the given definition


resolve

public Location resolve(java.lang.String spec)
See resolve(String, Map) (with no options)


resolve

public Location resolve(java.lang.String spec, java.util.Map locationFlags)
Returns a location created from the given spec, which might correspond to a definition, or created on-the-fly. Optional flags can be passed through to underlying the location.
throws:
NoSuchElementException if the spec cannot be resolved


resolve

public java.util.List resolve(java.lang.Iterable spec)
As resolve(String) but works with a collection of location specs.

Usually given a collection of string specs. Also supports comma-separated lists as a single spec.

For legacy compatibility this also accepts nested lists, but that is deprecated (and triggers a warning).


resolveIfPossible

public Location resolveIfPossible(java.lang.String spec)
as resolve(String) but returning null (never throwing)


updateDefinedLocation

public void updateDefinedLocation(LocationDefinition l)
adds or updates the given defined location


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.