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 boolean
equals(Object o)
@NotNull ActiveInstanceAdjustmentType
getActiveInstanceAdjustmentType()
Whether to bring # of instances to <=, >= or ==.String
getCronExpression()
Cron expression representing when the logic should be runElasticImageConfiguration
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 haveint
hashCode()
boolean
isAllElasticConfigurations()
Does this scheudle apply for all instances?boolean
isEnabled()
Is this schedule enabled or notboolean
isRunOnStartup()
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)
String
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 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: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
public void setCronExpression(String cronExpression)
- Specified by:
setCronExpression
in interfaceElasticInstanceSchedule
-
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 interfaceElasticInstanceSchedule
- 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 interfaceElasticInstanceSchedule
-
getActiveInstanceAdjustmentType
@NotNull public @NotNull ActiveInstanceAdjustmentType 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
public boolean equals(Object o)
- Overrides:
equals
in classcom.atlassian.core.bean.EntityObject
-
-