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 classCloudStateHolder.ChangeStatestatic classCloudStateHolder.CollectedCloudStatestatic classCloudStateHolder.ImageStatestatic classCloudStateHolder.ImageStateKeystatic classCloudStateHolder.InstanceStatestatic classCloudStateHolder.InstanceStateKeystatic classCloudStateHolder.ProfileStatestatic classCloudStateHolder.ProfileStateKeystatic classCloudStateHolder.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:CloudInstancesProviderExtendedCallbackCalled if - client is still connecting - client error occoured - image error occoured - instance error occoured- Specified by:
processNotReadyin interfaceCloudInstancesProviderExtendedCallback- Parameters:
profile- profile
-
processClientError
public void processClientError(@NotNull CloudProfile profile, @NotNull CloudErrorInfo cloudErrorInfo)Description copied from interface:CloudInstancesProviderExtendedCallbackCalled if - client error occoured- Specified by:
processClientErrorin interfaceCloudInstancesProviderExtendedCallback- Parameters:
profile- profile
-
processClient
public void processClient(@NotNull CloudProfile profile)Description copied from interface:CloudInstancesProviderExtendedCallbackprocess client- Specified by:
processClientin interfaceCloudInstancesProviderExtendedCallback
-
processImageError
public void processImageError(@NotNull CloudProfile profile, @NotNull CloudImage image)Description copied from interface:CloudInstancesProviderExtendedCallbackCalled if - image error occoured- Specified by:
processImageErrorin interfaceCloudInstancesProviderExtendedCallback- Parameters:
profile- profileimage- errorneous image
-
processImage
public boolean processImage(@NotNull CloudProfile profile, @NotNull CloudImage image)Description copied from interface:CloudInstancesProviderCallbackIndicates whether to process this particular image. UnlikeCloudInstancesProviderCallback.processInstance(CloudProfile, CloudInstance)returning false will skip just this image and continue further processing- Specified by:
processImagein interfaceCloudInstancesProviderCallback- Returns:
- true to process this image
-
processInstanceError
public void processInstanceError(@NotNull CloudProfile profile, @NotNull CloudInstance instance)Description copied from interface:CloudInstancesProviderExtendedCallbackCalled if - instance error occoured- Specified by:
processInstanceErrorin interfaceCloudInstancesProviderExtendedCallback- Parameters:
profile- profileinstance- errorneous instance
-
processInstance
public boolean processInstance(@NotNull CloudProfile profile, @NotNull CloudInstance instance)Description copied from interface:CloudInstancesProviderCallbackProcesses instance and indicates whether to process next allocated instance- Specified by:
processInstancein 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:CloudInstancesProviderExtendedCallbackCalled if - instance is expired and should be terminated waiting if necessary for the current build to finish- Specified by:
processInstanceExpiredin interfaceCloudInstancesProviderExtendedCallback- Parameters:
profile- profileinstance- expired instance
-
processInstanceMaintained
public void processInstanceMaintained(@NotNull CloudProfile profile, @NotNull CloudClientEx client, @NotNull CloudInstance instance)Description copied from interface:CloudInstancesProviderExtendedCallbackCalled if - instance is maintained (should not be terminated)- Specified by:
processInstanceMaintainedin interfaceCloudInstancesProviderExtendedCallback- Parameters:
profile- profileinstance- expired instance
-
-