brooklyn.management
Interface LocationManager


public interface LocationManager

For managing and querying entities.


Method Summary
<T extends Location>
T
createLocation(LocationSpec<T> spec)
          Creates a new location, which is tracked by the management context.
<T extends Location>
T
createLocation(Map<?,?> config, Class<T> type)
          Convenience (particularly for groovy code) to create a location.
 Location getLocation(String id)
          Returns the location under management (e.g.
 Collection<Location> getLocations()
          All locations under control of this management plane.
 boolean isManaged(Location loc)
          whether the location is under management by this management context
 Location manage(Location loc)
          Deprecated. in 0.6.0; use createLocation(LocationSpec) instead.
 void unmanage(Location loc)
          Causes the given location and its children, recursively, to be removed from the management plane (for instance because the location is no longer relevant).
 

Method Detail

createLocation

<T extends Location> T createLocation(LocationSpec<T> spec)
Creates a new location, which is tracked by the management context.

Parameters:
spec -

createLocation

<T extends Location> T createLocation(Map<?,?> config,
                                      Class<T> type)
Convenience (particularly for groovy code) to create a location. Equivalent to createLocation(LocationSpec.create(type).configure(config))

See Also:
createLocation(LocationSpec)

getLocations

Collection<Location> getLocations()
All locations under control of this management plane. This returns a snapshot of the current locations; it will not reflect future changes in the locations. If no locations are found, the collection will be empty (i.e. null is never returned).


getLocation

Location getLocation(String id)
Returns the location under management (e.g. in use) with the given identifier (e.g. random string; and different to the LocationDefinition id). May return a full instance, or a proxy to one which is remote. If no location found with that id, returns null.


isManaged

boolean isManaged(Location loc)
whether the location is under management by this management context


manage

Location manage(Location loc)
Deprecated. in 0.6.0; use createLocation(LocationSpec) instead.

Begins management for the given location and its children, recursively. depending on the implementation of the management context, this might push it out to one or more remote management nodes. Manage a location.

Since:
0.6.0 (added only for backwards compatibility, where locations are being created directly).

unmanage

void unmanage(Location loc)
Causes the given location and its children, recursively, to be removed from the management plane (for instance because the location is no longer relevant). If the given location is not managed (e.g. it has already been unmanaged) then this is a no-op (though it may be logged so duplicate calls are best avoided).



Copyright © 2013. All Rights Reserved.