Interface WhitelistService


@PublicApi public interface WhitelistService
Handles all whitelist rules related data queries and modification. This includes permission checking.
Since:
1.1
  • Method Details

    • isWhitelistEnabled

      boolean isWhitelistEnabled()
      Returns:
      true if the whitelist is enabled, false otherwise
    • enableWhitelist

      void enableWhitelist()
      Enable the whitelist in general. Publishes WhitelistEnabledEvent after the modification has been finished.
      Throws:
      NotAuthorizedException - if the current user has not the required permission
    • disableWhitelist

      void disableWhitelist()
      Disable the whitelist in general. Publishes WhitelistDisabledEvent after the modification has been finished.
      Throws:
      NotAuthorizedException - if the current user has not the required permission
    • add

      WhitelistRule add(WhitelistRule whitelistRule)
      Add a new whitelist rule. Publishes WhitelistRuleAddedEvent after the modification has been finished.
      Parameters:
      whitelistRule - the whitelist rule to be added
      Returns:
      the created whitelist rule
      Throws:
      NotAuthorizedException - if the current user has not the required permission
    • update

      WhitelistRule update(WhitelistRule whitelistRule)
      Update a given whitelist rule. Publishes WhitelistRuleChangedEvent after the modification has been finished.
      Parameters:
      whitelistRule - the updated information to be used with the whitelist rule
      Returns:
      the updated whitelist rule
      Throws:
      NotAuthorizedException - if the current user has not the required permission
    • remove

      void remove(int id)
      Remove a whitelist rule referenced by id. Publishes WhitelistRuleRemovedEvent after the modification has been finished.
      Parameters:
      id - the id of the whitelist rule to be removed
      Throws:
      NotAuthorizedException - if the current user has not the required permission
    • getAll

      Returns:
      all known whitelist rules
    • get

      @Nullable WhitelistRule get(int id)
      Parameters:
      id - the id of the whitelist rule
      Returns:
      the whitelist rule with the given id or null if not found