Class CloudClientCanStartProxy
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.profile.CloudClientCanStartProxy
-
- All Implemented Interfaces:
CloudClient,CloudClientEx,CloudErrorProvider
public class CloudClientCanStartProxy extends Object implements CloudClientEx
-
-
Field Summary
Fields Modifier and Type Field Description protected CloudClientExmyDelegate
-
Constructor Summary
Constructors Constructor Description CloudClientCanStartProxy(CloudClientEx delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanStartNewInstance(CloudImage image)Call this method to check if it is possible (in theory) to start new instance of a given image in this profile.CanStartNewInstanceResultcanStartNewInstanceWithDetails(CloudImage image)Call this method to check if it is possible (in theory) to start new instance of a given image in this profile.voiddispose()Notifies client that it is no longer needed, This is a good time to release all resources allocated to implement the clientCloudImagefindImageById(String imageId)Looks for an image with the specified identifier and returns its handle.CloudInstancefindInstanceByAgent(AgentDescription agent)Checks if the agent is an instnce of one of the running instances of that cloud profile.StringgenerateAgentName(AgentDescription agent)Generated name for build agent that is thought to be running as instance of this cloud client.CloudClientExgetDelegate()CloudErrorInfogetErrorInfo()Returns currect error info if there was any or null.Collection<? extends CloudImage>getImages()Lists all user selected images.static booleanhasOnlyOldCanStartImplementation(CloudClient client)booleanisInitialized()Checks if the client data is fully ready to be queried by the system.voidrestartInstance(CloudInstance instance)Restarts instance if possibleCloudInstancestartNewInstance(CloudImage image, CloudInstanceUserData tag)Starts a new virtual machine instancevoidterminateInstance(CloudInstance instance)Terminates instance.-
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.CloudClient
getInstancesLimit
-
-
-
-
Field Detail
-
myDelegate
@NotNull protected final CloudClientEx myDelegate
-
-
Constructor Detail
-
CloudClientCanStartProxy
public CloudClientCanStartProxy(@NotNull CloudClientEx delegate)
-
-
Method Detail
-
isInitialized
public boolean isInitialized()
Description copied from interface:CloudClientChecks if the client data is fully ready to be queried by the system. Actually, it may take some time to communicate to the cloud service. All interface members may not return full information if false was returned from this method.- Specified by:
isInitializedin interfaceCloudClient- Returns:
- true if the cloud is fully initialized.
-
findImageById
@Nullable public CloudImage findImageById(@NotNull String imageId) throws CloudException
Description copied from interface:CloudClientLooks for an image with the specified identifier and returns its handle.- Specified by:
findImageByIdin interfaceCloudClient- Parameters:
imageId- idetifier of the image to look for. SeeCloudImage.getId().- Returns:
- image handle.
- Throws:
CloudException- on error
-
findInstanceByAgent
@Nullable public CloudInstance findInstanceByAgent(@NotNull AgentDescription agent)
Description copied from interface:CloudClientChecks if the agent is an instnce of one of the running instances of that cloud profile.- Specified by:
findInstanceByAgentin interfaceCloudClient- Parameters:
agent- agent description of an agent that is going to connect- Returns:
- corresponding
CloudInstanceif found or null
-
getImages
@NotNull public Collection<? extends CloudImage> getImages() throws CloudException
Description copied from interface:CloudClientLists all user selected images. The method should either return an unmodifiable snapshot of the images or a thread-safe collection.- Specified by:
getImagesin interfaceCloudClient- Returns:
- list of all available images; their order is undefined.
- Throws:
CloudException- on error
-
getErrorInfo
@Nullable public CloudErrorInfo getErrorInfo()
Description copied from interface:CloudClientReturns currect error info if there was any or null. Can be null. Returning error info marks this profile as error-containing and not relayable.- Specified by:
getErrorInfoin interfaceCloudClient- Specified by:
getErrorInfoin interfaceCloudErrorProvider- Returns:
- error info or null
-
canStartNewInstance
public boolean canStartNewInstance(@NotNull CloudImage image)Description copied from interface:CloudClientCall this method to check if it is possible (in theory) to start new instance of a given image in this profile. Deprecated since 2018.1. jetbrains.buildServer.clouds.CloudClient#canStartNewInstanceWithDetails(jetbrains.buildServer.clouds.CloudImage) is being used instead.- Specified by:
canStartNewInstancein interfaceCloudClient- Parameters:
image- image to start new instance from- Returns:
- can start new instance or not
-
canStartNewInstanceWithDetails
@NotNull public CanStartNewInstanceResult canStartNewInstanceWithDetails(@NotNull CloudImage image)
Description copied from interface:CloudClientCall this method to check if it is possible (in theory) to start new instance of a given image in this profile.- Specified by:
canStartNewInstanceWithDetailsin interfaceCloudClient- Parameters:
image- image to start new instance from- Returns:
- can start new instance result with details
-
generateAgentName
@Nullable public String generateAgentName(@NotNull AgentDescription agent)
Description copied from interface:CloudClientGenerated name for build agent that is thought to be running as instance of this cloud client.- Specified by:
generateAgentNamein interfaceCloudClient- Parameters:
agent- agent instance- Returns:
- proposed build agent name or null
-
startNewInstance
@NotNull public CloudInstance startNewInstance(@NotNull CloudImage image, @NotNull CloudInstanceUserData tag) throws QuotaException
Description copied from interface:CloudClientExStarts a new virtual machine instance- Specified by:
startNewInstancein interfaceCloudClientEx- Parameters:
image- image to start instancetag- portion of agent setup-replated data.- Returns:
- just started instance handle.
- Throws:
QuotaException- if start can not be performed due to a quota lack
-
restartInstance
public void restartInstance(@NotNull CloudInstance instance)Description copied from interface:CloudClientExRestarts instance if possible- Specified by:
restartInstancein interfaceCloudClientEx- Parameters:
instance- instance to apply action to
-
terminateInstance
public void terminateInstance(@NotNull CloudInstance instance)Description copied from interface:CloudClientExTerminates instance.- Specified by:
terminateInstancein interfaceCloudClientEx- Parameters:
instance- instance to apply action to
-
dispose
public void dispose()
Description copied from interface:CloudClientExNotifies client that it is no longer needed, This is a good time to release all resources allocated to implement the client- Specified by:
disposein interfaceCloudClientEx
-
hasOnlyOldCanStartImplementation
public static boolean hasOnlyOldCanStartImplementation(@NotNull CloudClient client)
-
getDelegate
public CloudClientEx getDelegate()
-
-