Brooklyn

brooklyn.policy
[Java] Class PolicySpec

java.lang.Object
  brooklyn.policy.PolicySpec
All Implemented Interfaces:
java.io.Serializable

public class PolicySpec

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

Parameters:
- The type of policy to be created
Authors:
aled


Constructor Summary
protected PolicySpec(java.lang.Class type)

 
Method Summary
PolicySpec configure(java.util.Map val)

PolicySpec configure(java.lang.CharSequence key, java.lang.Object val)

PolicySpec configure(ConfigKey key, java.lang.Object val)

PolicySpec configure(ConfigKey key, Task val)

PolicySpec configure(HasConfigKey key, java.lang.Object val)

PolicySpec configure(HasConfigKey key, Task val)

PolicySpec configureIfNotNull(ConfigKey key, java.lang.Object val)

static PolicySpec create(java.lang.Class type)

Creates a new PolicySpec instance for a policy of the given type.

static PolicySpec create(java.util.Map config, java.lang.Class type)

Creates a new PolicySpec instance with the given config, for a policy of the given type.

PolicySpec displayName(java.lang.String val)

java.util.Map getConfig()

@return Read-only configuration values

java.lang.String getDisplayName()

@return The display name of the policy

java.util.Map getFlags()

@return Read-only construction flags

java.lang.Class getType()

@return The type of the policy

java.lang.String toString()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

PolicySpec

protected PolicySpec(java.lang.Class type)


 
Method Detail

configure

public PolicySpec configure(java.util.Map val)


configure

public PolicySpec configure(java.lang.CharSequence key, java.lang.Object val)


configure

public PolicySpec configure(ConfigKey key, java.lang.Object val)


configure

public PolicySpec configure(ConfigKey key, Task val)


configure

public PolicySpec configure(HasConfigKey key, java.lang.Object val)


configure

public PolicySpec configure(HasConfigKey key, Task val)


configureIfNotNull

public PolicySpec configureIfNotNull(ConfigKey key, java.lang.Object val)


create

public static PolicySpec create(java.lang.Class type)
Creates a new PolicySpec instance for a policy of the given type. The returned PolicySpec can then be customized.
Parameters:
type - A Policy class


create

public static PolicySpec create(java.util.Map config, java.lang.Class type)
Creates a new PolicySpec instance with the given config, for a policy of the given type. This is primarily for groovy code; equivalent to PolicySpec.create(type).configure(config).
Parameters:
config - The spec's configuration (see PolicySpec#configure(Map)#configure(Map)).
type - A Policy class


displayName

public PolicySpec displayName(java.lang.String val)


getConfig

public java.util.Map getConfig()
Returns:
Read-only configuration values


getDisplayName

public java.lang.String getDisplayName()
Returns:
The display name of the policy


getFlags

public java.util.Map getFlags()
Returns:
Read-only construction flags
See Also:
SetFromFlag


getType

public java.lang.Class getType()
Returns:
The type of the policy


toString

@Override
public java.lang.String toString()


 

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