Class CloudStateHolder
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.CloudStateHolder
-
- All Implemented Interfaces:
CloudInstancesProviderCallback
,CloudInstancesProviderExtendedCallback
public class CloudStateHolder extends Object implements CloudInstancesProviderExtendedCallback
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CloudStateHolder.ChangeState
static class
CloudStateHolder.CollectedCloudState
static class
CloudStateHolder.ImageState
static class
CloudStateHolder.ImageStateKey
static class
CloudStateHolder.InstanceState
static class
CloudStateHolder.InstanceStateKey
static class
CloudStateHolder.ProfileState
static class
CloudStateHolder.ProfileStateKey
static class
CloudStateHolder.StateBase<K>
-
Constructor Summary
Constructors Constructor Description CloudStateHolder(CloudInstancesProvider provider, RunningAgentsTracker runningAgentsTracker, CloudManagerBase cloudManagerBase)
-
Method Summary
-
-
-
Constructor Detail
-
CloudStateHolder
public CloudStateHolder(@NotNull CloudInstancesProvider provider, @NotNull RunningAgentsTracker runningAgentsTracker, @NotNull CloudManagerBase cloudManagerBase)
-
-
Method Detail
-
getProfiles
public Map<CloudStateHolder.ProfileStateKey,CloudStateHolder.ProfileState> getProfiles()
-
collectState
public void collectState()
-
collectImageState
@NotNull public CloudStateHolder.CollectedCloudState collectImageState(@NotNull CloudStateHolder.ImageStateKey imageStateKey)
-
getProcessedProfiles
public Map<CloudStateHolder.ProfileStateKey,CloudStateHolder.ChangeState> getProcessedProfiles()
-
getProcessedImages
public Map<CloudStateHolder.ImageStateKey,CloudStateHolder.ChangeState> getProcessedImages()
-
getProcessedInstances
public Map<CloudStateHolder.InstanceStateKey,CloudStateHolder.ChangeState> getProcessedInstances()
-
isInitialized
public boolean isInitialized()
-
setInitialized
public void setInitialized()
-
findProfileByKey
@Nullable public CloudStateHolder.ProfileState findProfileByKey(@NotNull String projectId, @NotNull String profileId)
-
findProfileByKey
public CloudStateHolder.ProfileState findProfileByKey(@NotNull CloudStateHolder.ProfileStateKey key)
-
findImageByKey
@Nullable public CloudStateHolder.ImageState findImageByKey(@NotNull CloudStateHolder.ImageStateKey imageStateKey)
-
findInstanceByKey
@Nullable public CloudStateHolder.InstanceState findInstanceByKey(@NotNull CloudStateHolder.InstanceStateKey instanceStateKey)
-
getAllInstanceKeys
public Set<CloudStateHolder.InstanceStateKey> getAllInstanceKeys()
-
getAllImageKeys
public Set<CloudStateHolder.ImageStateKey> getAllImageKeys()
-
removeImage
public void removeImage(@NotNull CloudStateHolder.ImageStateKey imageStateKey)
-
removeInstance
public void removeInstance(@NotNull CloudStateHolder.InstanceStateKey instanceStateKey)
-
clearState
public void clearState()
Drops all images from all profiles. This is done to reinit state from DB to ensure they are in sync
-
processNotReady
public void processNotReady(@NotNull CloudProfile profile)
Description copied from interface:CloudInstancesProviderExtendedCallback
Called if - client is still connecting - client error occoured - image error occoured - instance error occoured- Specified by:
processNotReady
in interfaceCloudInstancesProviderExtendedCallback
- Parameters:
profile
- profile
-
processClientError
public void processClientError(@NotNull CloudProfile profile, @NotNull CloudErrorInfo cloudErrorInfo)
Description copied from interface:CloudInstancesProviderExtendedCallback
Called if - client error occoured- Specified by:
processClientError
in interfaceCloudInstancesProviderExtendedCallback
- Parameters:
profile
- profile
-
processClient
public void processClient(@NotNull CloudProfile profile)
Description copied from interface:CloudInstancesProviderExtendedCallback
process client- Specified by:
processClient
in interfaceCloudInstancesProviderExtendedCallback
-
processImageError
public void processImageError(@NotNull CloudProfile profile, @NotNull CloudImage image)
Description copied from interface:CloudInstancesProviderExtendedCallback
Called if - image error occoured- Specified by:
processImageError
in interfaceCloudInstancesProviderExtendedCallback
- Parameters:
profile
- profileimage
- errorneous image
-
processImage
public boolean processImage(@NotNull CloudProfile profile, @NotNull CloudImage image)
Description copied from interface:CloudInstancesProviderCallback
Indicates whether to process this particular image. UnlikeCloudInstancesProviderCallback.processInstance(CloudProfile, CloudInstance)
returning false will skip just this image and continue further processing- Specified by:
processImage
in interfaceCloudInstancesProviderCallback
- Returns:
- true to process this image
-
processInstanceError
public void processInstanceError(@NotNull CloudProfile profile, @NotNull CloudInstance instance)
Description copied from interface:CloudInstancesProviderExtendedCallback
Called if - instance error occoured- Specified by:
processInstanceError
in interfaceCloudInstancesProviderExtendedCallback
- Parameters:
profile
- profileinstance
- errorneous instance
-
processInstance
public boolean processInstance(@NotNull CloudProfile profile, @NotNull CloudInstance instance)
Description copied from interface:CloudInstancesProviderCallback
Processes instance and indicates whether to process next allocated instance- Specified by:
processInstance
in interfaceCloudInstancesProviderCallback
- Parameters:
profile
- profileinstance
- instance- Returns:
- true to continue iteration and false otherwise
-
processImageEx
public void processImageEx(@NotNull CloudProfile profile, @NotNull CloudImage image, @NotNull CanStartNewInstanceResult canStart)
-
processInstanceExpired
public void processInstanceExpired(@NotNull CloudProfile profile, @NotNull CloudClientEx client, @NotNull CloudInstance instance)
Description copied from interface:CloudInstancesProviderExtendedCallback
Called if - instance is expired and should be terminated waiting if necessary for the current build to finish- Specified by:
processInstanceExpired
in interfaceCloudInstancesProviderExtendedCallback
- Parameters:
profile
- profileinstance
- expired instance
-
processInstanceMaintained
public void processInstanceMaintained(@NotNull CloudProfile profile, @NotNull CloudClientEx client, @NotNull CloudInstance instance)
Description copied from interface:CloudInstancesProviderExtendedCallback
Called if - instance is maintained (should not be terminated)- Specified by:
processInstanceMaintained
in interfaceCloudInstancesProviderExtendedCallback
- Parameters:
profile
- profileinstance
- expired instance
-
-