@PublicSpi public interface

ProjectTypeUpdatedHandler

com.atlassian.jira.project.type.ProjectTypeUpdatedHandler

@PublicSpi

This interface is designed for plugins to implement.

Clients of @PublicSpi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicSpi as per each product's API policy (clients should refer to each product's API policy for the exact guarantee -- usually binary compatibility is guaranteed at least across minor versions).

Note: @PublicSpi interfaces and classes are specifically designed to be implemented/extended by clients. Hence, the guarantee of binary compatibility is different to that of @PublicApi elements (if an element is both @PublicApi and @PublicSpi, both guarantees apply).

Class Overview

Interface to be implemented by clients who wish to be notified once the project type of a project has been updated.

Implementations of this class need to be registered through register(ProjectTypeUpdatedHandler) for the notifications to be triggered.

Summary

Public Methods
String getHandlerId()
Returns a unique identifier for the handler.
void onProjectTypeUpdateRolledBack(ApplicationUser user, Project project, ProjectTypeKey oldProjectTypeKey, ProjectTypeKey newProjectTypeKey, ProjectTypeUpdatedOutcome outcome)
This method will only be called if the update to the project type is rolled back.
ProjectTypeUpdatedOutcome onProjectTypeUpdated(ApplicationUser user, Project project, ProjectTypeKey oldProjectTypeKey, ProjectTypeKey newProjectTypeKey)
Method called every time the type of a project is updated.

Public Methods

public String getHandlerId ()

Returns a unique identifier for the handler.

Returns
  • A unique identifier for the handler.

public void onProjectTypeUpdateRolledBack (ApplicationUser user, Project project, ProjectTypeKey oldProjectTypeKey, ProjectTypeKey newProjectTypeKey, ProjectTypeUpdatedOutcome outcome)

This method will only be called if the update to the project type is rolled back.

That could happen if one of the ProjectTypeUpdatedHandler returns an error on #projectTypeUpdated(Project, ProjectType, ProjectType).

On this method, the handler should undo all of the changes made by it when #projectTypeUpdated(Project, ProjectType, ProjectType) was called. The parameters passed to this method will be exactly the same as the ones when #projectTypeUpdated(Project, ProjectType, ProjectType) was called, with the addition of the ProjectTypeUpdatedOutcome returned from that call.

Parameters
user The user performing the update.
project The project type for which the project type was updated.
oldProjectTypeKey The old project type key.
newProjectTypeKey The new project type key.
outcome the ProjectTypeUpdatedOutcome returned from the update operation.

public ProjectTypeUpdatedOutcome onProjectTypeUpdated (ApplicationUser user, Project project, ProjectTypeKey oldProjectTypeKey, ProjectTypeKey newProjectTypeKey)

Method called every time the type of a project is updated. This gives the opportunity for plugins to execute some logic once the project type has been updated. If this method returns failure, then the update will be vetoed. All other handlers that have already been called will now have their onProjectTypeUpdateRolledBack() methods called.

Parameters
user The user performing the update.
project The project for which the type has been updated.
oldProjectTypeKey The old project type key.
newProjectTypeKey The new project type key.
Returns