Class CloudStateHolder.ImageState
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.CloudStateHolder.StateBase<CloudStateHolder.ImageStateKey>
-
- jetbrains.buildServer.clouds.server.impl.CloudStateHolder.ImageState
-
- All Implemented Interfaces:
CloudErrorProvider
,CloudImage
- Enclosing class:
- CloudStateHolder
public static class CloudStateHolder.ImageState extends CloudStateHolder.StateBase<CloudStateHolder.ImageStateKey> implements CloudImage
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.clouds.server.impl.CloudStateHolder.StateBase
myAddtionalData, myKey
-
-
Constructor Summary
Constructors Constructor Description ImageState(String projectId, String profileId, String imageId, String name, String additionalData)
ImageState(String projectId, String profileId, CloudImage image, CanStartNewInstanceResult canStartNewInstanceResult)
-
Method Summary
-
Methods inherited from class jetbrains.buildServer.clouds.server.impl.CloudStateHolder.StateBase
getAdditionalDataJson, getAddtionalData, getErrorInfo, getKey, setAddtionalData, setErrorInfo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.clouds.CloudErrorProvider
getErrorInfo
-
Methods inherited from interface jetbrains.buildServer.clouds.CloudImage
getInstancesLimit, getPriority, getRunningInstancesCount
-
-
-
-
Constructor Detail
-
ImageState
public ImageState(@NotNull String projectId, @NotNull String profileId, @NotNull CloudImage image, @NotNull CanStartNewInstanceResult canStartNewInstanceResult)
-
-
Method Detail
-
addInstance
public void addInstance(@NotNull CloudStateHolder.InstanceState instanceState)
-
removeInstance
public void removeInstance(@NotNull CloudStateHolder.InstanceStateKey key)
-
canStartNewInstance
public CanStartNewInstanceResult canStartNewInstance()
-
getId
@NotNull public String getId()
Description copied from interface:CloudImage
Returns the identifier of this image, in the vendor-specific form.
Images with different ids are considered different images.
Must be unique within the profile.- Specified by:
getId
in interfaceCloudImage
- Returns:
- image identifier.
-
getName
@NotNull public String getName()
- Specified by:
getName
in interfaceCloudImage
- Returns:
- human readable image name
-
getInstances
@NotNull public Collection<CloudStateHolder.InstanceState> getInstances()
Description copied from interface:CloudImage
Returns all instances of the image. The method should either return an unmodifiable snapshot of the instances or a thread-safe collection.- Specified by:
getInstances
in interfaceCloudImage
- Returns:
- instances
-
findInstanceById
@Nullable public CloudStateHolder.InstanceState findInstanceById(@NotNull String id)
Description copied from interface:CloudImage
Finds instance by instanceId- Specified by:
findInstanceById
in interfaceCloudImage
- Parameters:
id
- id- Returns:
- instance or null
-
findInstanceByAgentId
@Nullable public CloudStateHolder.InstanceState findInstanceByAgentId(int agentId)
-
getAgentPoolId
@Nullable public Integer getAgentPoolId()
Description copied from interface:CloudImage
Internal agent pool id associated with this cloud image.
If this feature is not implemented, the function must return null.
Must useCloudImageData.getAgentPoolId()
if returns non-null value.- Specified by:
getAgentPoolId
in interfaceCloudImage
- Returns:
- internal pool id
-
getProfileId
@NotNull public String getProfileId()
Description copied from interface:CloudImage
Identifier of a cloud profile where this cloud image belongs. Or null if this id is not available.- Specified by:
getProfileId
in interfaceCloudImage
- Returns:
- see above
-
getProjectId
@NotNull public String getProjectId()
-
update
public void update(@NotNull CloudStateHolder.ImageState image)
-
update
public void update(@NotNull CloudImage image, CanStartNewInstanceResult canStart)
-
getCanStart
public CanStartNewInstanceResult getCanStart()
-
setCanStart
public void setCanStart(@NotNull CanStartNewInstanceResult canStart)
-
isStillActual
public boolean isStillActual(@NotNull CloudImage image, CanStartNewInstanceResult canStart)
-
dummyImage
public static CloudStateHolder.ImageState dummyImage(@NotNull String projectId, @NotNull String profileId, @NotNull String imageId)
-
-