Class ElasticInstanceScheduleImpl
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.bamboo.core.BambooEntityObject
-
- com.atlassian.bamboo.agent.elastic.schedule.ElasticInstanceScheduleImpl
-
- All Implemented Interfaces:
ElasticInstanceSchedule,BambooIdProvider,BambooObject,Cloneable
@Entity public class ElasticInstanceScheduleImpl extends BambooEntityObject implements ElasticInstanceSchedule
-
-
Constructor Summary
Constructors Constructor Description ElasticInstanceScheduleImpl()ElasticInstanceScheduleImpl(String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)@NotNull ActiveInstanceAdjustmentTypegetActiveInstanceAdjustmentType()Whether to bring # of instances to <=, >= or ==.StringgetCronExpression()Cron expression representing when the logic should be runElasticImageConfigurationgetElasticImageConfiguration()The Elastic Configuration that will be managed.intgetNumberToAdjust(int currentInstances)Given the curent instance count, by how many agents do we need to adjust by?intgetTargetActiveInstances()Postive integer for # of active instances to haveinthashCode()booleanisAllElasticConfigurations()Does this scheudle apply for all instances?booleanisEnabled()Is this schedule enabled or notbooleanisRunOnStartup()if the schedule should be run on startupvoidsetActiveInstanceAdjustmentType(ActiveInstanceAdjustmentType activeInstanceAdjustmentType)voidsetCronExpression(String cronExpression)voidsetElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)voidsetEnabled(boolean enabled)voidsetTargetActiveInstances(int targetActiveInstances)StringtoString()-
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
-
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
-
-
-
Constructor Detail
-
ElasticInstanceScheduleImpl
public ElasticInstanceScheduleImpl()
-
ElasticInstanceScheduleImpl
public ElasticInstanceScheduleImpl(String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances)
-
-
Method Detail
-
getCronExpression
public String getCronExpression()
Description copied from interface:ElasticInstanceScheduleCron expression representing when the logic should be run- Specified by:
getCronExpressionin interfaceElasticInstanceSchedule- Returns:
- may return null. Null will mean that the schedule will be run on start up
-
setCronExpression
public void setCronExpression(String cronExpression)
- Specified by:
setCronExpressionin interfaceElasticInstanceSchedule
-
getElasticImageConfiguration
public ElasticImageConfiguration getElasticImageConfiguration()
Description copied from interface:ElasticInstanceScheduleThe Elastic Configuration that will be managed. If null, it means schedule will be applied for all / any elastic configuration- Specified by:
getElasticImageConfigurationin interfaceElasticInstanceSchedule- Returns:
- may be null. Null means schedule will be applied for all / any elastic configuration
-
setElasticImageConfiguration
public void setElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration)
- Specified by:
setElasticImageConfigurationin interfaceElasticInstanceSchedule
-
getActiveInstanceAdjustmentType
@NotNull public @NotNull ActiveInstanceAdjustmentType getActiveInstanceAdjustmentType()
Description copied from interface:ElasticInstanceScheduleWhether to bring # of instances to <=, >= or ==. Defaults toActiveInstanceAdjustmentType.EQUALS- Specified by:
getActiveInstanceAdjustmentTypein interfaceElasticInstanceSchedule- Returns:
-
setActiveInstanceAdjustmentType
public void setActiveInstanceAdjustmentType(ActiveInstanceAdjustmentType activeInstanceAdjustmentType)
- Specified by:
setActiveInstanceAdjustmentTypein interfaceElasticInstanceSchedule
-
getTargetActiveInstances
public int getTargetActiveInstances()
Description copied from interface:ElasticInstanceSchedulePostive integer for # of active instances to have- Specified by:
getTargetActiveInstancesin interfaceElasticInstanceSchedule- Returns:
-
setTargetActiveInstances
public void setTargetActiveInstances(int targetActiveInstances)
- Specified by:
setTargetActiveInstancesin interfaceElasticInstanceSchedule
-
getNumberToAdjust
public int getNumberToAdjust(int currentInstances)
Description copied from interface:ElasticInstanceScheduleGiven the curent instance count, by how many agents do we need to adjust by?- Specified by:
getNumberToAdjustin interfaceElasticInstanceSchedule- 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:ElasticInstanceScheduleIs this schedule enabled or not- Specified by:
isEnabledin interfaceElasticInstanceSchedule- Returns:
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfaceElasticInstanceSchedule
-
isRunOnStartup
public boolean isRunOnStartup()
Description copied from interface:ElasticInstanceScheduleif the schedule should be run on startup- Specified by:
isRunOnStartupin interfaceElasticInstanceSchedule
-
isAllElasticConfigurations
public boolean isAllElasticConfigurations()
Description copied from interface:ElasticInstanceScheduleDoes this scheudle apply for all instances?- Specified by:
isAllElasticConfigurationsin interfaceElasticInstanceSchedule
-
hashCode
public int hashCode()
- Overrides:
hashCodein classcom.atlassian.core.bean.EntityObject
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classcom.atlassian.core.bean.EntityObject
-
-