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 Details

    • getHandlerId

      String getHandlerId()
      Returns a unique identifier for the handler.
      Returns:
      A unique identifier for the handler.
    • onProjectCreated

      void onProjectCreated(ProjectCreatedData projectCreatedData) throws CreateException
      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

      void onProjectCreationRolledBack(ProjectCreatedData projectCreatedData)
      This method will only be called if the creation of the project is rolled back.

      That could happen if one of the ProjectCreateHandler returns an error on

      invalid reference
      #onProjectCreated(Project)

      On this method, the handler should undo all of the changes made by it when

      invalid reference
      #onProjectCreated(Project)
      was called. The parameters passed to this method will be exactly the same as the ones when
      invalid reference
      #onProjectCreated(Project)
      was called.
      Parameters:
      projectCreatedData - Object encapsulating the information about the recently created project.