Interface RevocationOrder

All Superinterfaces:
EnforcementOptionsFactory

public interface RevocationOrder extends EnforcementOptionsFactory
An order to undo a punishment by some specific details. Obtained from PunishmentRevoker.

See space.arim.libertybans.api.punish for a description of active and historical punishments.
Author:
A248
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the ID of the punishment which will be revoked, or none if no ID is known
    Gets the punishment type of the punishment which will be revoked, or none if the type is not known
    Gets the victims, one of whose punishment will be revoked, or none if the list of victims does not exist
    default space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>>
    Revokes the punishment matching this revocation order, "unenforces" it, and gets the punishment revoked.
    space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>>
    Revokes the punishment matching this revocation order, "unenforces" it according to the given options, and gets the punishment revoked.
    default space.arim.omnibus.util.concurrent.ReactionStage<Boolean>
    Revokes the punishment matching this revocation order, and "unenforces" it.
    space.arim.omnibus.util.concurrent.ReactionStage<Boolean>
    undoPunishment(EnforcementOptions enforcementOptions)
    Revokes the punishment matching this revocation order, and "unenforces" it according to the given options.

    Methods inherited from interface EnforcementOptionsFactory

    enforcementOptionsBuilder
  • Method Details

    • getID

      Optional<Long> getID()
      Gets the ID of the punishment which will be revoked, or none if no ID is known
      Returns:
      the ID of the punishment to be revoked if there is one
    • getType

      Gets the punishment type of the punishment which will be revoked, or none if the type is not known
      Returns:
      the type of the punishment to be revoked if there is one
    • getVictims

      Optional<List<Victim>> getVictims()
      Gets the victims, one of whose punishment will be revoked, or none if the list of victims does not exist
      Returns:
      the victims if specified
    • undoPunishment

      default space.arim.omnibus.util.concurrent.ReactionStage<Boolean> undoPunishment()
      Revokes the punishment matching this revocation order, and "unenforces" it.

      If no active punishment in the database matched this revocation order, the future yields false.

      Unenforcement implies purging of this punishment from any local caches.
      Returns:
      a future which yields true if the punishment existed and has been revoked, false otherwise
    • undoPunishment

      space.arim.omnibus.util.concurrent.ReactionStage<Boolean> undoPunishment(EnforcementOptions enforcementOptions)
      Revokes the punishment matching this revocation order, and "unenforces" it according to the given options.

      If no active punishment in the database matched this revocation order, the future yields false.

      Unenforcement implies purging of this punishment from any local caches.
      Parameters:
      enforcementOptions - the enforcement options. Can be used to disable unenforcement entirely
      Returns:
      a future which yields true if the punishment existed and has been revoked, false otherwise
    • undoAndGetPunishment

      default space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> undoAndGetPunishment()
      Revokes the punishment matching this revocation order, "unenforces" it, and gets the punishment revoked.

      If no active punishment in the database matched this revocation order, the future yields an empty optional.

      Unenforcement implies purging of this punishment from any local caches.
      Returns:
      a future which yields the punishment if it existed and was revoked, nothing otherwise
    • undoAndGetPunishment

      space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> undoAndGetPunishment(EnforcementOptions enforcementOptions)
      Revokes the punishment matching this revocation order, "unenforces" it according to the given options, and gets the punishment revoked.

      If no active punishment in the database matched this revocation order, the future yields an empty optional.

      Unenforcement implies purging of this punishment from any local caches.
      Parameters:
      enforcementOptions - the enforcement options. Can be used to disable unenforcement entirely
      Returns:
      a future which yields the punishment if it existed and was revoked, nothing otherwise