Package com.atlassian.jira.project
Interface ProjectCreateHandler
public interface ProjectCreateHandler
Interface to be implemented by clients who wish to be notified when a project is created.
Implementations of this class need to be registered through ProjectCreateRegistrar.register(ProjectCreateHandler) for the notifications to be triggered.
- Since:
- 7.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns a unique identifier for the handler.voidonProjectCreated(ProjectCreatedData projectCreatedData) Method called every time a project is created.voidonProjectCreationRolledBack(ProjectCreatedData projectCreatedData) This method will only be called if the creation of the project is rolled back.
-
Method Details
-
getHandlerId
String getHandlerId()Returns a unique identifier for the handler.- Returns:
- A unique identifier for the handler.
-
onProjectCreated
Method called every time a project is created. This gives the opportunity for plugins to execute some logic once the project has been created. If this method throws any exception, then the update will be vetoed. All other handlers that have already been called will now have their onProjectCreationRolledBack() methods called.- Parameters:
projectCreatedData- Object encapsulating the information about the recently created project.- Throws:
CreateException- An exception if something went wrong.
-
onProjectCreationRolledBack
This method will only be called if the creation of the project is rolled back.That could happen if one of the
ProjectCreateHandlerreturns an error oninvalid reference
#onProjectCreated(Project)On this method, the handler should undo all of the changes made by it when
was called. The parameters passed to this method will be exactly the same as the ones wheninvalid reference
#onProjectCreated(Project)was called.invalid reference
#onProjectCreated(Project)- Parameters:
projectCreatedData- Object encapsulating the information about the recently created project.
-