Package org.eblocker.server.http.service
Class AppModuleService
java.lang.Object
java.util.Observable
org.eblocker.server.http.service.AppModuleService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAppModuleService(DataSource dataSource, com.fasterxml.jackson.databind.ObjectMapper objectMapper, AppModuleRemovalMessageProvider appModuleRemovalMessageProvider, String appModulesFilePath, int tempAppModuleId, int standardAppModuleId, int userAppModuleId, int autoTrustAppModuleId) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateEnabledState(List<AppWhitelistModule> modules) voidvoidaddDomainsToModule(List<SSLWhitelistUrl> domainsToAdd, int id) voidaddDomainToModule(String domain, String name, int id) voiddelete(int id) voidget(int id) getAll()Load all app modules from database.Get all IPs from all enabled AppWhitelistModulesGet all URLs from all enabled AppWhitelistModulesintintintvoidinit()booleanisUniqueCustomerCreatedName(Integer id, String name) Checks if module name is unique among customer created modules.voidremoveDomainFromModule(String domain, int id) voidremoveDomainsFromModule(List<SSLWhitelistUrl> domainsToRemove, int id) voidrestoreModified(List<AppWhitelistModule> modules, Map<Integer, Boolean> enabledStates) Restore all modules that the user has modified or created, for example from a backup.save(AppWhitelistModule module) Save a new user-defined module.voidstoreAndActivateEnabledState(int id, boolean enabled) update(AppWhitelistModule module, int id) Update an existing module.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
AUTO_TRUST_APP_NAME
- See Also:
-
AUTO_TRUST_APP_DESCR_DE
- See Also:
-
AUTO_TRUST_APP_DESCR_EN
- See Also:
-
-
Constructor Details
-
AppModuleService
@Inject public AppModuleService(DataSource dataSource, com.fasterxml.jackson.databind.ObjectMapper objectMapper, AppModuleRemovalMessageProvider appModuleRemovalMessageProvider, String appModulesFilePath, int tempAppModuleId, int standardAppModuleId, int userAppModuleId, int autoTrustAppModuleId)
-
-
Method Details
-
init
public void init() -
getUpdater
-
getTempAppModuleId
public int getTempAppModuleId() -
getStandardAppModuleId
public int getStandardAppModuleId() -
getUserAppModuleId
public int getUserAppModuleId() -
getAutoSslAppModule
-
getAll
Load all app modules from database. -
get
-
save
Save a new user-defined module. The module's ID must be null.- Parameters:
module- to save. Note: the module is enabled automatically- Returns:
-
update
Update an existing module.- Parameters:
module- the module to update. Note: the enabled state is not updated.id- the module's ID- Returns:
-
restoreModified
Restore all modules that the user has modified or created, for example from a backup. Also restore the enabled states given in the map.- Parameters:
modules- the modules that the user has modified or createdenabledStates- the enabled states of all modules
-
isUniqueCustomerCreatedName
Checks if module name is unique among customer created modules.Please note that customer created modules may have the same name as builtin ones.
- Parameters:
id- id of module if it is a already persistent (may be null)name- name of module- Returns:
- if module name is unique among customer created modules.
-
delete
public void delete(int id) -
storeAndActivateEnabledState
public void storeAndActivateEnabledState(int id, boolean enabled) -
activateEnabledState
-
activateEnabledState
-
getAllUrlsFromEnabledModules
Get all URLs from all enabled AppWhitelistModules -
getBlacklistedDomains
-
getAllIPsFromEnabledModules
Get all IPs from all enabled AppWhitelistModules -
deleteBuiltinModule
-
addDomainToModule
-
removeDomainFromModule
-
addDomainsToModule
-
removeDomainsFromModule
-