com.atlassian.bamboo.agent.elastic.schedule
Class ElasticInstanceScheduleImpl

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.agent.elastic.schedule.ElasticInstanceScheduleImpl
All Implemented Interfaces:
ElasticInstanceSchedule, BambooObject, java.lang.Cloneable

public class ElasticInstanceScheduleImpl
extends BambooEntityObject
implements ElasticInstanceSchedule


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Constructor Summary
ElasticInstanceScheduleImpl()
           
ElasticInstanceScheduleImpl(java.lang.String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 ActiveInstanceAdjustmentType getActiveInstanceAdjustmentType()
          Whether to bring # of instances to <=, >= or ==.
 java.lang.String getCronExpression()
          Cron expression representing when the logic should be run
 ElasticImageConfiguration getElasticImageConfiguration()
          The Elastic Configuration that will be managed.
 int getNumberToAdjust(int currentInstances)
          Given the curent instance count, by how many agents do we need to adjust by?
 int getTargetActiveInstances()
          Postive integer for # of active instances to have
 int hashCode()
           
 boolean isAllElasticConfigurations()
          Does this scheudle apply for all instances?
 boolean isEnabled()
          Is this schedule enabled or not
 boolean isRunOnStartup()
          if the schedule should be run on startup
 void setActiveInstanceAdjustmentType(ActiveInstanceAdjustmentType activeInstanceAdjustmentType)
           
 void setCronExpression(java.lang.String cronExpression)
           
 void setElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
           
 void setEnabled(boolean enabled)
           
 void setTargetActiveInstances(int targetActiveInstances)
           
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.bamboo.core.BambooEntityObject
getId, setId
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, setClock, setCreationDate, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
getId, setId
 

Constructor Detail

ElasticInstanceScheduleImpl

public ElasticInstanceScheduleImpl()

ElasticInstanceScheduleImpl

public ElasticInstanceScheduleImpl(java.lang.String cronExpression,
                                   ElasticImageConfiguration elasticImageConfiguration,
                                   ActiveInstanceAdjustmentType activeInstanceAdjustmentType,
                                   int targetActiveInstances)
Method Detail

getCronExpression

public java.lang.String getCronExpression()
Description copied from interface: ElasticInstanceSchedule
Cron expression representing when the logic should be run

Specified by:
getCronExpression in interface ElasticInstanceSchedule
Returns:
may return null. Null will mean that the schedule will be run on start up

setCronExpression

public void setCronExpression(java.lang.String cronExpression)
Specified by:
setCronExpression in interface ElasticInstanceSchedule

getElasticImageConfiguration

public ElasticImageConfiguration getElasticImageConfiguration()
Description copied from interface: ElasticInstanceSchedule
The Elastic Configuration that will be managed. If null, it means schedule will be applied for all / any elastic configuration

Specified by:
getElasticImageConfiguration in interface ElasticInstanceSchedule
Returns:
may be null. Null means schedule will be applied for all / any elastic configuration

setElasticImageConfiguration

public void setElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
Specified by:
setElasticImageConfiguration in interface ElasticInstanceSchedule

getActiveInstanceAdjustmentType

@NotNull
public ActiveInstanceAdjustmentType getActiveInstanceAdjustmentType()
Description copied from interface: ElasticInstanceSchedule
Whether to bring # of instances to <=, >= or ==. Defaults to ActiveInstanceAdjustmentType.EQUALS

Specified by:
getActiveInstanceAdjustmentType in interface ElasticInstanceSchedule
Returns:

setActiveInstanceAdjustmentType

public void setActiveInstanceAdjustmentType(ActiveInstanceAdjustmentType activeInstanceAdjustmentType)
Specified by:
setActiveInstanceAdjustmentType in interface ElasticInstanceSchedule

getTargetActiveInstances

public int getTargetActiveInstances()
Description copied from interface: ElasticInstanceSchedule
Postive integer for # of active instances to have

Specified by:
getTargetActiveInstances in interface ElasticInstanceSchedule
Returns:

setTargetActiveInstances

public void setTargetActiveInstances(int targetActiveInstances)
Specified by:
setTargetActiveInstances in interface ElasticInstanceSchedule

getNumberToAdjust

public int getNumberToAdjust(int currentInstances)
Description copied from interface: ElasticInstanceSchedule
Given the curent instance count, by how many agents do we need to adjust by?

Specified by:
getNumberToAdjust in interface ElasticInstanceSchedule
Returns:
+n number means to start n agents. -x means shut down x agents. 0 means do nothing

isEnabled

public boolean isEnabled()
Description copied from interface: ElasticInstanceSchedule
Is this schedule enabled or not

Specified by:
isEnabled in interface ElasticInstanceSchedule
Returns:

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface ElasticInstanceSchedule

isRunOnStartup

public boolean isRunOnStartup()
Description copied from interface: ElasticInstanceSchedule
if the schedule should be run on startup

Specified by:
isRunOnStartup in interface ElasticInstanceSchedule

isAllElasticConfigurations

public boolean isAllElasticConfigurations()
Description copied from interface: ElasticInstanceSchedule
Does this scheudle apply for all instances?

Specified by:
isAllElasticConfigurations in interface ElasticInstanceSchedule

hashCode

public int hashCode()
Overrides:
hashCode in class com.atlassian.core.bean.EntityObject

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class com.atlassian.core.bean.EntityObject

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 Atlassian. All Rights Reserved.