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
ConstructorDescriptionElasticInstanceScheduleImpl
(String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances) -
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull ActiveInstanceAdjustmentType
Whether to bring # of instances to <=, >= or ==.Cron expression representing when the logic should be runThe 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
Postive integer for # of active instances to haveint
hashCode()
boolean
Does this scheudle apply for all instances?boolean
Is this schedule enabled or notboolean
if the schedule should be run on startupvoid
setActiveInstanceAdjustmentType
(ActiveInstanceAdjustmentType activeInstanceAdjustmentType) void
setCronExpression
(String cronExpression) void
setElasticImageConfiguration
(ElasticImageConfiguration elasticImageConfiguration) void
setEnabled
(boolean enabled) void
setTargetActiveInstances
(int targetActiveInstances) toString()
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 Details
-
ElasticInstanceScheduleImpl
public ElasticInstanceScheduleImpl() -
ElasticInstanceScheduleImpl
public ElasticInstanceScheduleImpl(String cronExpression, ElasticImageConfiguration elasticImageConfiguration, ActiveInstanceAdjustmentType activeInstanceAdjustmentType, int targetActiveInstances)
-
-
Method Details
-
getCronExpression
Description copied from interface:ElasticInstanceSchedule
Cron expression representing when the logic should be run- Specified by:
getCronExpression
in interfaceElasticInstanceSchedule
- Returns:
- may return null. Null will mean that the schedule will be run on start up
-
setCronExpression
- Specified by:
setCronExpression
in interfaceElasticInstanceSchedule
-
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 interfaceElasticInstanceSchedule
- Returns:
- may be null. Null means schedule will be applied for all / any elastic configuration
-
setElasticImageConfiguration
- Specified by:
setElasticImageConfiguration
in interfaceElasticInstanceSchedule
-
getActiveInstanceAdjustmentType
Description copied from interface:ElasticInstanceSchedule
Whether to bring # of instances to <=, >= or ==. Defaults toActiveInstanceAdjustmentType.EQUALS
- Specified by:
getActiveInstanceAdjustmentType
in interfaceElasticInstanceSchedule
- Returns:
-
setActiveInstanceAdjustmentType
public void setActiveInstanceAdjustmentType(ActiveInstanceAdjustmentType activeInstanceAdjustmentType) - Specified by:
setActiveInstanceAdjustmentType
in interfaceElasticInstanceSchedule
-
getTargetActiveInstances
public int getTargetActiveInstances()Description copied from interface:ElasticInstanceSchedule
Postive integer for # of active instances to have- Specified by:
getTargetActiveInstances
in interfaceElasticInstanceSchedule
- Returns:
-
setTargetActiveInstances
public void setTargetActiveInstances(int targetActiveInstances) - Specified by:
setTargetActiveInstances
in interfaceElasticInstanceSchedule
-
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 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:ElasticInstanceSchedule
Is this schedule enabled or not- Specified by:
isEnabled
in interfaceElasticInstanceSchedule
- Returns:
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabled
in interfaceElasticInstanceSchedule
-
isRunOnStartup
public boolean isRunOnStartup()Description copied from interface:ElasticInstanceSchedule
if the schedule should be run on startup- Specified by:
isRunOnStartup
in interfaceElasticInstanceSchedule
-
isAllElasticConfigurations
public boolean isAllElasticConfigurations()Description copied from interface:ElasticInstanceSchedule
Does this scheudle apply for all instances?- Specified by:
isAllElasticConfigurations
in interfaceElasticInstanceSchedule
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.atlassian.core.bean.EntityObject
-
equals
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
toString
-