Interface MigrationProcess


public interface MigrationProcess
It's possible to migrate from previous sources. This class represents a process that has been manually run. The process is being done on a seperate thread.

Possibly the user for instance has been using an other Bedwars plugin and is now using this one.

  • Method Details

    • getOrigin

      Returns the previously used system.
      Returns:
      The origin from which we're migrating from
    • run

      boolean run()
      You must manually run this method in order to run this. You might want to add callbacks before that using addCallback(Callback) in order to know when it's done. It's not possible to run a process twice.
      Returns:
      true when it has been started for the first time, and it's now actually running
    • cancel

      boolean cancel()
      Forcefully terminate the running process. It's possible that this doesn't occur immediately and that it is still running for a while beyond that.
      Returns:
      true if the process has been running and now has been cancelled.
    • isRunning

      boolean isRunning()
      Returns whether it is still running
      Returns:
      true if the migration is still being processed
    • addCallback

      void addCallback(MigrationProcess.Callback callback)
      Add a callback to know then the process is done. It's highly recommended doing that before running the process, otherwise you possibly face a race condition.
      Parameters:
      callback - The new callback you want to add
    • removeCallback

      boolean removeCallback(MigrationProcess.Callback callback)
      Remove a previously added callback.
      Parameters:
      callback - The callback you don't want to be called
      Returns:
      true if it has been found and removed
    • getCallbacks

      Returns all callbacks that have been added. This collection is modifiable, meaning that you don't really have to use addCallback(Callback).
      Returns:
      All callbacks that have been added