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
ConstructorsConstructorDescriptionElasticInstanceScheduleImpl(String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances) -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull ActiveInstanceAdjustmentTypeWhether to bring # of instances to <=, >= or ==.Cron expression representing when the logic should be runThe Elastic Configuration that will be managed.intgetNumberToAdjust(int currentInstances) Given the curent instance count, by how many agents do we need to adjust by?intPostive integer for # of active instances to haveinthashCode()booleanDoes this scheudle apply for all instances?booleanIs this schedule enabled or notbooleanif the schedule should be run on startupvoidsetActiveInstanceAdjustmentType(ActiveInstanceAdjustmentType activeInstanceAdjustmentType) voidsetCronExpression(String cronExpression) voidsetElasticImageConfiguration(ElasticImageConfiguration elasticImageConfiguration) voidsetEnabled(boolean enabled) voidsetTargetActiveInstances(int targetActiveInstances) toString()Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getIdMethods inherited from interface com.atlassian.bamboo.core.BambooObject
setId
-
Constructor Details
-
ElasticInstanceScheduleImpl
public ElasticInstanceScheduleImpl() -
ElasticInstanceScheduleImpl
public ElasticInstanceScheduleImpl(String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances)
-
-
Method Details
-
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
- Specified by:
setCronExpressionin interfaceElasticInstanceSchedule
-
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
- Specified by:
setElasticImageConfigurationin interfaceElasticInstanceSchedule
-
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- Parameters:
currentInstances-- 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
- Overrides:
equalsin classcom.atlassian.core.bean.EntityObject
-
toString
-