Class CloudEventsLogger
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.CloudEventsLogger
-
- All Implemented Interfaces:
EventListener
,CloudEventListener
public class CloudEventsLogger extends Object implements CloudEventListener
- Author:
- Eugene Petrenko Created: 11.11.2009 16:16:01
-
-
Constructor Summary
Constructors Constructor Description CloudEventsLogger(CloudEventDispatcher disp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeCloudClientDisposed(CloudProfile cloudProfile, CloudClientEx client)
Fired before disposing cloud client for extra actions, such as unauthorization of agents (if necessary)void
beforeInstanceStarted(CloudProfile profile, CloudImage image, BeforeStartInstanceArguments args)
Notified before instance is started.void
cloudClientFactoryRegistered(String cloudCode)
Notifies of registration of new cloudClient plugingvoid
imageRemoved(String projectId, String imageId)
This event is called when image is removedvoid
imageUpdated(String projectId, CloudImageParameters imageParameters)
This event is called when a single image settings change was detected.void
instanceAgentMatched(CloudProfile profile, CloudInstance instance, SBuildAgent agent)
TeamCity started instance has been started and connected to TeamCity as build agent This event may be fired about same object for many times.void
instanceAgentUnmatched(String profileId, String imageId, String instanceId, SBuildAgent agent)
Fired if agent matched to the instance has gonevoid
instanceFailedToStart(CloudProfile profile, CloudImage cloudImage, Throwable reason)
Fired if the agent start action has failedvoid
instanceFailedToStop(CloudProfile profile, CloudInstance instance, Throwable cause)
Fired if an exception thrown while attempting to stop running instance.void
instanceGone(String profileId, String imageId, String instanceId)
Fired if an instance has stoped to be reported in the modelvoid
instanceStarting(CloudProfile profile, CloudInstance instance)
Agent start action has just been called.void
instanceStatusChanged(CloudProfile profile, CloudInstance instance)
Notifies on cloud instance status changevoid
instanceTerminating(CloudProfile profile, CloudInstance instance)
TeamCity has called terminate instance command.void
instanceTerminating(CloudProfile profile, CloudInstance instance, TerminateInstanceReason reason)
TeamCity has called terminate instance command.void
integrationStatusChanged(String projectId, ProjectCloudIntegrationStatus integrationStatus)
This event is called when project's integration status is changed.void
profileRemoved(String projectId, String profileId)
This event is called when profile is removedvoid
profileUpdated(String projectId, CloudProfile cloudProfile)
This event is called when a single profile settings change was detected from the disk.
-
-
-
Constructor Detail
-
CloudEventsLogger
public CloudEventsLogger(@NotNull CloudEventDispatcher disp)
-
-
Method Detail
-
instanceAgentMatched
public void instanceAgentMatched(@NotNull CloudProfile profile, @NotNull CloudInstance instance, @NotNull SBuildAgent agent)
Description copied from interface:CloudEventListener
TeamCity started instance has been started and connected to TeamCity as build agent This event may be fired about same object for many times. Instances reflecting an object may change. It's to recommended storing instances.- Specified by:
instanceAgentMatched
in interfaceCloudEventListener
- Parameters:
profile
- profileinstance
- could instanceagent
- agent
-
instanceAgentUnmatched
public void instanceAgentUnmatched(@NotNull String profileId, @NotNull String imageId, @NotNull String instanceId, @NotNull SBuildAgent agent)
Description copied from interface:CloudEventListener
Fired if agent matched to the instance has gone- Specified by:
instanceAgentUnmatched
in interfaceCloudEventListener
- Parameters:
profileId
- profileimageId
- imageIdinstanceId
- instanceagent
- agent
-
instanceGone
public void instanceGone(@NotNull String profileId, @NotNull String imageId, @NotNull String instanceId)
Description copied from interface:CloudEventListener
Fired if an instance has stoped to be reported in the model- Specified by:
instanceGone
in interfaceCloudEventListener
- Parameters:
profileId
- profileIdimageId
- imageIdinstanceId
- instanceId
-
instanceStarting
public void instanceStarting(@NotNull CloudProfile profile, @NotNull CloudInstance instance)
Description copied from interface:CloudEventListener
Agent start action has just been called.- Specified by:
instanceStarting
in interfaceCloudEventListener
- Parameters:
profile
- instance profileinstance
- cloud instance
-
instanceFailedToStart
public void instanceFailedToStart(@NotNull CloudProfile profile, @NotNull CloudImage cloudImage, @NotNull Throwable reason)
Description copied from interface:CloudEventListener
Fired if the agent start action has failed- Specified by:
instanceFailedToStart
in interfaceCloudEventListener
- Parameters:
profile
- instance profilecloudImage
- image of the profilereason
- reason as to why it has failed
-
cloudClientFactoryRegistered
public void cloudClientFactoryRegistered(@NotNull String cloudCode)
Description copied from interface:CloudEventListener
Notifies of registration of new cloudClient pluging- Specified by:
cloudClientFactoryRegistered
in interfaceCloudEventListener
- Parameters:
cloudCode
- code of registered plugin
-
instanceStatusChanged
public void instanceStatusChanged(@NotNull CloudProfile profile, @NotNull CloudInstance instance)
Description copied from interface:CloudEventListener
Notifies on cloud instance status change- Specified by:
instanceStatusChanged
in interfaceCloudEventListener
- Parameters:
profile
- profileinstance
- instance
-
instanceTerminating
public void instanceTerminating(@NotNull CloudProfile profile, @NotNull CloudInstance instance)
Description copied from interface:CloudEventListener
TeamCity has called terminate instance command. Instance should disappear in a shoult while after.- Specified by:
instanceTerminating
in interfaceCloudEventListener
- Parameters:
profile
- profileinstance
- instance
-
instanceTerminating
public void instanceTerminating(@NotNull CloudProfile profile, @NotNull CloudInstance instance, @NotNull TerminateInstanceReason reason)
Description copied from interface:CloudEventListener
TeamCity has called terminate instance command. Instance should disappear in a shoult while after.- Specified by:
instanceTerminating
in interfaceCloudEventListener
- Parameters:
profile
- profileinstance
- instancereason
- reason
-
integrationStatusChanged
public void integrationStatusChanged(@NotNull String projectId, ProjectCloudIntegrationStatus integrationStatus)
Description copied from interface:CloudEventListener
This event is called when project's integration status is changed.- Specified by:
integrationStatusChanged
in interfaceCloudEventListener
- Parameters:
projectId
- new loaded profilesintegrationStatus
- cloud integration status
-
profileUpdated
public void profileUpdated(String projectId, @NotNull CloudProfile cloudProfile)
Description copied from interface:CloudEventListener
This event is called when a single profile settings change was detected from the disk.- Specified by:
profileUpdated
in interfaceCloudEventListener
-
imageUpdated
public void imageUpdated(@NotNull String projectId, @NotNull CloudImageParameters imageParameters)
Description copied from interface:CloudEventListener
This event is called when a single image settings change was detected.- Specified by:
imageUpdated
in interfaceCloudEventListener
-
profileRemoved
public void profileRemoved(String projectId, @NotNull String profileId)
Description copied from interface:CloudEventListener
This event is called when profile is removed- Specified by:
profileRemoved
in interfaceCloudEventListener
profileId
- id of removed profile
-
imageRemoved
public void imageRemoved(String projectId, @NotNull String imageId)
Description copied from interface:CloudEventListener
This event is called when image is removed- Specified by:
imageRemoved
in interfaceCloudEventListener
imageId
- id of removed image
-
beforeInstanceStarted
public void beforeInstanceStarted(@NotNull CloudProfile profile, @NotNull CloudImage image, @NotNull BeforeStartInstanceArguments args)
Description copied from interface:CloudEventListener
Notified before instance is started. Listeners may useBeforeStartInstanceArguments
class to update agent properites and/or to disabled start- Specified by:
beforeInstanceStarted
in interfaceCloudEventListener
- Parameters:
profile
- profileimage
- image of the profileargs
- parameters
-
instanceFailedToStop
public void instanceFailedToStop(@NotNull CloudProfile profile, @NotNull CloudInstance instance, @Nullable Throwable cause)
Description copied from interface:CloudEventListener
Fired if an exception thrown while attempting to stop running instance. This is a very bad thing, since it consumes user's money- Specified by:
instanceFailedToStop
in interfaceCloudEventListener
- Parameters:
profile
- instance profileinstance
- cloud instance
-
beforeCloudClientDisposed
public void beforeCloudClientDisposed(CloudProfile cloudProfile, @NotNull CloudClientEx client)
Description copied from interface:CloudEventListener
Fired before disposing cloud client for extra actions, such as unauthorization of agents (if necessary)- Specified by:
beforeCloudClientDisposed
in interfaceCloudEventListener
-
-