Interface ScopeManager
public interface ScopeManager
Factory which produces
ServerScopes-
Method Summary
Modifier and TypeMethodDescriptionGets a scope applying to a user defined category.Gets a scope applying to the current server.Gets the current server scope if it is available (seecurrentServerScope().The scope configured as the default with which to punish.Gets the global scope, applying to all servers and categoriesGets all scopes applying to the current server as defined by user configuration.specificScope(String server) Gets a scope applying to a specific server.
-
Method Details
-
specificScope
Gets a scope applying to a specific server.
The server string must not be empty and must be less long than a certain length dependent on the implementation. The current limit is set at 32 characters but this may change.- Parameters:
server- the server- Returns:
- a scope applying to the server
- Throws:
IllegalArgumentException- ifserveris empty or too big
-
category
Gets a scope applying to a user defined category.
The category string must not be empty and must be less long than a certain length dependent on the implementation. The current limit is set at 32 characters but this may change.- Parameters:
category- the category- Returns:
- a scope applying to the category
- Throws:
IllegalArgumentException- ifcategoryis empty or too big
-
globalScope
ServerScope globalScope()Gets the global scope, applying to all servers and categories- Returns:
- the global scope
-
currentServerScope
Optional<ServerScope> currentServerScope()Gets a scope applying to the current server. This will yield a scope which, when used to punish players, will enforce their punishments on the current server only.
This is usually not the appropriate scope with which to select punishments (because only punishments made specifically for the server would be selected). Instead, seescopesApplicableToCurrentServer().
The "current server" is defined with respect to an instance of the API implementation. Thus, using this method will apply to the proxy, backend server, or other application running the current instance.
Please note that, in some circumstances, the current server scope will not be available, depending on user configuration. UsecurrentServerScopeOrFallback()if you want to fallback to the scope specified in the user's configuration for this purpose.- Returns:
- if available, the scope applying to the current server only. On a proxy instance, using this scope will affect the entire proxy. On a backend server it will affect the backend server.
-
currentServerScopeOrFallback
ServerScope currentServerScopeOrFallback()Gets the current server scope if it is available (seecurrentServerScope(). Otherwise, uses the server scope which the user has configured as a fallback for the current server scope when it is unavailable.- Returns:
- the scope applying to the current server only, or the fallback if not available
-
scopesApplicableToCurrentServer
Set<ServerScope> scopesApplicableToCurrentServer()Gets all scopes applying to the current server as defined by user configuration. This will necessarily include both the global scope (globalScope()) and the current server scope (currentServerScope().
The "current server" is defined with respect to an instance of the API implementation. Thus, using this method will yield scopes applying to the proxy, backend server, or other application running this instance.- Returns:
- all scopes applicable to the current server
-
defaultPunishingScope
ServerScope defaultPunishingScope()The scope configured as the default with which to punish. For example, if an operator punishes a victim without specifying a scope explicitly, this scope is used.- Returns:
- the default punishing scope
-