Class ScmStatusChangedEvent
java.lang.Object
java.util.EventObject
com.atlassian.bitbucket.scm.event.ScmEvent
com.atlassian.bitbucket.scm.event.ScmStatusChangedEvent
- All Implemented Interfaces:
Serializable
Raised when the
status
of an SCM
changes at runtime.
When an SCM
determines its initial status, it should not raise this event. Instead, this should
only be raised when something causes the plugin's SCM status to change after it has already started. For example, if
an SCM starts out as unavailable
because required SCM files have not been installed
and a system administrator installs those files, the SCM may detect the change and update its status accordingly.
Note: This event is an optimisation. SCMs are not required to support changing their status at runtime.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
ScmStatusChangedEvent
public ScmStatusChangedEvent(@Nonnull Object source, @Nonnull Scm scm, @Nonnull ScmStatus previousStatus) Constructs a newScmStatusChangedEvent
, initialising thesource
and setting theScm
whose status has changed and thestatus
the SCM used to have. ThepreviousStatus
is required, to allow event listeners to determine when the availability of an SCM changes.- Parameters:
source
- the component within the SCM raising the eventscm
- theSCM
whose status has changed, used to retrieve the current statuspreviousStatus
- thestatus
the SCM used to have- Throws:
NullPointerException
- if thesource
,scm
orpreviousStatus
isnull
-
-
Method Details
-
getPreviousStatus
Retrieves the previousstatus
for theSCM
. The current status may be retrieved usingScmEvent.getScm()
.getStatus()
.- Returns:
- the previous status for the SCM
-