Package com.atlassian.plugins.whitelist
Interface WhitelistService
@PublicApi
public interface WhitelistService
Handles all whitelist rules related data queries and modification. This includes permission checking.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionadd(WhitelistRule whitelistRule) Add a new whitelist rule.voidDisable the whitelist in general.voidEnable the whitelist in general.get(int id) getAll()booleanvoidremove(int id) Remove a whitelist rule referenced by id.update(WhitelistRule whitelistRule) Update a given whitelist rule.
-
Method Details
-
isWhitelistEnabled
boolean isWhitelistEnabled()- Returns:
trueif the whitelist is enabled,falseotherwise
-
enableWhitelist
void enableWhitelist()Enable the whitelist in general. PublishesWhitelistEnabledEventafter the modification has been finished.- Throws:
NotAuthorizedException- if the current user has not the required permission
-
disableWhitelist
void disableWhitelist()Disable the whitelist in general. PublishesWhitelistDisabledEventafter the modification has been finished.- Throws:
NotAuthorizedException- if the current user has not the required permission
-
add
Add a new whitelist rule. PublishesWhitelistRuleAddedEventafter 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
Update a given whitelist rule. PublishesWhitelistRuleChangedEventafter 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. PublishesWhitelistRuleRemovedEventafter 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
Collection<WhitelistRule> getAll()- Returns:
- all known whitelist rules
-
get
- Parameters:
id- the id of the whitelist rule- Returns:
- the whitelist rule with the given id or
nullif not found
-