All Downloads are FREE. Search and download functionalities are using the official Maven repository.

brooklyn.policy.Policy Maven / Gradle / Ivy

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.policy;

import java.util.Map;

import brooklyn.config.ConfigKey;
import brooklyn.entity.rebind.RebindSupport;
import brooklyn.entity.rebind.Rebindable;
import brooklyn.mementos.PolicyMemento;

import com.google.common.annotations.Beta;

/**
 * Policies implement actions and thus must be suspendable; policies should continue to evaluate their sensors
 * and indicate their desired planned action even if they aren't invoking them
 */
public interface Policy extends EntityAdjunct, Rebindable {
    /**
     * A unique id for this policy.
     */
    String getId();

    /**
     * Get the name assigned to this policy.
     *
     * @return the name assigned to the policy.
     */
    String getName();

    /**
     * Information about the type of this entity; analogous to Java's object.getClass.
     */
    @Beta
    PolicyType getPolicyType();

    /**
     * Resume the policy
     */
    void resume();

    /**
     * Suspend the policy
     */
    void suspend();
    
    /**
     * Whether the policy is suspended
     */
    boolean isSuspended();
    
     T getConfig(ConfigKey key);
    
     T setConfig(ConfigKey key, T val);
    
    Map, Object> getAllConfig();

    @Override
    RebindSupport getRebindSupport();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy