brooklyn.location
Class LocationSpec<T extends Location>

java.lang.Object
  extended by brooklyn.location.LocationSpec<T>
Type Parameters:
T - The type of location to be created
All Implemented Interfaces:
Serializable

public class LocationSpec<T extends Location>
extends Object
implements Serializable

Gives details of a location to be created. It describes the location's configuration, and is reusable to create multiple locations with the same configuration. To create a LocationSpec, it is strongly encouraged to use create(...) methods.

See Also:
Serialized Form

Constructor Summary
protected LocationSpec(Class<T> type)
           
 
Method Summary
 LocationSpec<T> configure(CharSequence key, Object val)
           
<V> LocationSpec<T>
configure(brooklyn.config.ConfigKey.HasConfigKey<V> key, Task<? extends V> val)
           
<V> LocationSpec<T>
configure(brooklyn.config.ConfigKey.HasConfigKey<V> key, V val)
           
<V> LocationSpec<T>
configure(brooklyn.config.ConfigKey<V> key, Task<? extends V> val)
           
<V> LocationSpec<T>
configure(brooklyn.config.ConfigKey<V> key, V val)
           
 LocationSpec<T> configure(Map<?,?> val)
           
<V> LocationSpec<T>
configureIfNotNull(brooklyn.config.ConfigKey<V> key, V val)
           
static
<T extends Location>
LocationSpec<T>
create(Class<T> type)
          Creates a new LocationSpec instance for a location of the given type.
static
<T extends Location>
LocationSpec<T>
create(Map<?,?> config, Class<T> type)
          Creates a new LocationSpec instance with the given config, for a location of the given type.
 LocationSpec<T> displayName(String val)
           
<E> LocationSpec<T>
extension(Class<E> extensionType, E extension)
           
 Map<brooklyn.config.ConfigKey<?>,Object> getConfig()
           
 String getDisplayName()
           
 Map<Class<?>,Object> getExtensions()
           
 Map<String,?> getFlags()
           
 Location getParent()
           
 Class<T> getType()
           
 LocationSpec<T> parent(Location val)
           
static
<T extends Location>
LocationSpec<T>
spec(Class<T> type)
          Deprecated. since 0.6 (added 0.6.0-M1); use create(Class)
static
<T extends Location>
LocationSpec<T>
spec(Map<?,?> config, Class<T> type)
          Deprecated. since 0.6 (added 0.6.0-M1); use create(Map, Class)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocationSpec

protected LocationSpec(Class<T> type)
Method Detail

spec

@Deprecated
public static <T extends Location> LocationSpec<T> spec(Class<T> type)
Deprecated. since 0.6 (added 0.6.0-M1); use create(Class)


spec

@Deprecated
public static <T extends Location> LocationSpec<T> spec(Map<?,?> config,
                                                                   Class<T> type)
Deprecated. since 0.6 (added 0.6.0-M1); use create(Map, Class)


create

public static <T extends Location> LocationSpec<T> create(Class<T> type)
Creates a new LocationSpec instance for a location of the given type. The returned LocationSpec can then be customized.

Parameters:
type - A Location class

create

public static <T extends Location> LocationSpec<T> create(Map<?,?> config,
                                                          Class<T> type)
Creates a new LocationSpec instance with the given config, for a location of the given type. This is primarily for groovy code; equivalent to LocationSpec.create(type).configure(config).

Parameters:
config - The spec's configuration (see configure(Map)).
type - A Location class

displayName

public LocationSpec<T> displayName(String val)

parent

public LocationSpec<T> parent(Location val)

configure

public LocationSpec<T> configure(Map<?,?> val)

configure

public LocationSpec<T> configure(CharSequence key,
                                 Object val)

configure

public <V> LocationSpec<T> configure(brooklyn.config.ConfigKey<V> key,
                                     V val)

configureIfNotNull

public <V> LocationSpec<T> configureIfNotNull(brooklyn.config.ConfigKey<V> key,
                                              V val)

configure

public <V> LocationSpec<T> configure(brooklyn.config.ConfigKey<V> key,
                                     Task<? extends V> val)

configure

public <V> LocationSpec<T> configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
                                     V val)

configure

public <V> LocationSpec<T> configure(brooklyn.config.ConfigKey.HasConfigKey<V> key,
                                     Task<? extends V> val)

extension

public <E> LocationSpec<T> extension(Class<E> extensionType,
                                     E extension)

getType

public Class<T> getType()
Returns:
The type of the location

getDisplayName

public String getDisplayName()
Returns:
The display name of the location

getParent

public Location getParent()
Returns:
The location's parent

getFlags

public Map<String,?> getFlags()
Returns:
Read-only construction flags
See Also:
declarations on the location type

getConfig

public Map<brooklyn.config.ConfigKey<?>,Object> getConfig()
Returns:
Read-only configuration values

getExtensions

public Map<Class<?>,Object> getExtensions()
Returns:
Read-only extension values

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.