Class CloudInstancesProviderImpl
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.CloudInstancesProviderImpl
-
- All Implemented Interfaces:
CloudInstancesExpiration
,CloudInstancesMaintenance
,CloudInstancesProvider
,ExpiredInstancesAgents
- Direct Known Subclasses:
SecuredCloudInstancesProvider
public class CloudInstancesProviderImpl extends Object implements CloudInstancesProvider, ExpiredInstancesAgents, CloudInstancesMaintenance
- Author:
- Eugene Petrenko Created: 04.11.2009 19:00:40
-
-
Constructor Summary
Constructors Constructor Description CloudInstancesProviderImpl(CloudManagerBase manager, CloudAgentRelation cloudAgentRelation, CloudEventDispatcher cloudEventsDispatcher, EventDispatcher<BuildServerListener> serverEventsDispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAgentExpired(BuildAgent agent)
boolean
isInstanceExpired(String profileId, String instanceId)
boolean
isInstanceMaintained(String profileId, String instanceId)
void
iterateInstances(CloudInstancesProviderExtendedCallback callback)
Iterates through all running instances of all profiles.void
iterateProfileInstances(CloudProfile profile, CloudInstancesProviderExtendedCallback callback)
Iterates through instances of particular cloud profilevoid
markInstanceExpired(String profileId, String instanceId)
Terminate instance after current build finishesvoid
markInstanceMaintained(String profileId, String instanceId)
Marks the instance as being under maintenancevoid
setRunningAgentsTracker(RunningAgentsTrackerEx runningAgentsTracker)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.clouds.server.CloudInstancesProvider
isInstanceExpired, iterateInstances, iterateProfileInstances, markInstanceExpired
-
-
-
-
Constructor Detail
-
CloudInstancesProviderImpl
public CloudInstancesProviderImpl(@NotNull CloudManagerBase manager, @NotNull CloudAgentRelation cloudAgentRelation, @NotNull CloudEventDispatcher cloudEventsDispatcher, @NotNull EventDispatcher<BuildServerListener> serverEventsDispatcher)
-
-
Method Detail
-
setRunningAgentsTracker
public void setRunningAgentsTracker(@NotNull RunningAgentsTrackerEx runningAgentsTracker)
-
iterateInstances
public void iterateInstances(@NotNull CloudInstancesProviderExtendedCallback callback)
Description copied from interface:CloudInstancesProvider
Iterates through all running instances of all profiles.- Specified by:
iterateInstances
in interfaceCloudInstancesProvider
- Parameters:
callback
- uses this interface to notify next instance
-
iterateProfileInstances
public void iterateProfileInstances(@NotNull CloudProfile profile, @NotNull CloudInstancesProviderExtendedCallback callback)
Description copied from interface:CloudInstancesProvider
Iterates through instances of particular cloud profile- Specified by:
iterateProfileInstances
in interfaceCloudInstancesProvider
- Parameters:
profile
- profile to processcallback
- uses this interface to notify next instance
-
markInstanceExpired
public void markInstanceExpired(@NotNull String profileId, @NotNull String instanceId)
Description copied from interface:CloudInstancesExpiration
Terminate instance after current build finishes- Specified by:
markInstanceExpired
in interfaceCloudInstancesExpiration
- Parameters:
profileId
- profile idinstanceId
- id of instance to terminate after current build finishes
-
isAgentExpired
public boolean isAgentExpired(@NotNull BuildAgent agent)
- Specified by:
isAgentExpired
in interfaceExpiredInstancesAgents
-
isInstanceExpired
public boolean isInstanceExpired(@NotNull String profileId, @NotNull String instanceId)
- Specified by:
isInstanceExpired
in interfaceCloudInstancesExpiration
- Returns:
- true, if no other builds will be run on this instance. False otherwise
-
markInstanceMaintained
public void markInstanceMaintained(@NotNull String profileId, @NotNull String instanceId)
Description copied from interface:CloudInstancesMaintenance
Marks the instance as being under maintenance- Specified by:
markInstanceMaintained
in interfaceCloudInstancesMaintenance
- Parameters:
profileId
- profile idinstanceId
- id of instance to terminate after current build finishes
-
isInstanceMaintained
public boolean isInstanceMaintained(@NotNull String profileId, @NotNull String instanceId)
- Specified by:
isInstanceMaintained
in interfaceCloudInstancesMaintenance
- Returns:
- true, instance is marked as maintained. False otherwise
-
-