Package de.terrestris.shoguncore.service
Class PluginService<E extends Plugin,D extends PluginDao<E>>
- java.lang.Object
-
- de.terrestris.shoguncore.service.AbstractDaoService<E,D>
-
- de.terrestris.shoguncore.service.AbstractCrudService<E,D>
-
- de.terrestris.shoguncore.service.PermissionAwareCrudService<E,D>
-
- de.terrestris.shoguncore.service.PluginService<E,D>
-
- Direct Known Subclasses:
WpsPluginService
@Service("pluginService") public class PluginService<E extends Plugin,D extends PluginDao<E>> extends PermissionAwareCrudService<E,D>Service class for thePluginmodel.- Author:
- Nils Bühner
- See Also:
AbstractCrudService
-
-
Field Summary
-
Fields inherited from class de.terrestris.shoguncore.service.PermissionAwareCrudService
permissionCollectionService
-
Fields inherited from class de.terrestris.shoguncore.service.AbstractDaoService
dao, logger
-
-
Constructor Summary
Constructors Modifier Constructor Description PluginService()Default constructor, which calls the type-constructorprotectedPluginService(Class<E> entityClass)Constructor that sets the concrete entity class for the service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(E plugin)Removes the passed plugin from all applications and afterwards deletes the plugin itself.StringgetPluginNamespace()StringgetPluginSource(String simpleClassName)List<String>preCheckDelete(Integer pluginId)voidsetApplicationService(ApplicationService<Application,ApplicationDao<Application>> applicationService)Sets the applicationService.voidsetDao(D dao)We have to useQualifierto define the correct dao here.voidsetPluginNamespace(String pluginNamespace)-
Methods inherited from class de.terrestris.shoguncore.service.PermissionAwareCrudService
addAndSaveGroupPermissions, addAndSaveUserPermissions, findAllUserGroupPermissionsOfUserGroup, findAllUserPermissionsOfUser, getPermissionCollectionService, removeAndSaveGroupPermissions, removeAndSaveUserPermissions, setPermissionCollectionService
-
Methods inherited from class de.terrestris.shoguncore.service.AbstractCrudService
findAll, findAllRestricted, findAllWhereFieldEquals, findAllWithCollectionContaining, findById, findBySimpleFilter, loadById, saveOrUpdate, updatePartialWithJsonNode
-
Methods inherited from class de.terrestris.shoguncore.service.AbstractDaoService
getDao, getEntityClass
-
-
-
-
Method Detail
-
getPluginNamespace
public String getPluginNamespace()
- Returns:
- the pluginNamespace
-
setPluginNamespace
public void setPluginNamespace(String pluginNamespace)
- Parameters:
pluginNamespace- the pluginNamespace to set
-
getPluginSource
@Transactional(readOnly=true) public String getPluginSource(String simpleClassName) throws Exception
- Parameters:
simpleClassName-- Returns:
- Throws:
Exception
-
preCheckDelete
@PreAuthorize("hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#pluginId, \'de.terrestris.shoguncore.model.Plugin\', \'DELETE\')") @Transactional(readOnly=true) public List<String> preCheckDelete(Integer pluginId)- Parameters:
pluginId-- Returns:
- List of application names that contain the given plugin
-
delete
@PreAuthorize("hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#plugin, \'DELETE\')") public void delete(E plugin)Removes the passed plugin from all applications and afterwards deletes the plugin itself. This overrides the generic method to deleteAbstractCrudService.delete(de.terrestris.shoguncore.model.PersistentObject).
-
setDao
@Autowired @Qualifier("pluginDao") public void setDao(D dao)We have to useQualifierto define the correct dao here. Otherwise, spring can not decide which dao has to be autowired here as there are multiple candidates.
-
setApplicationService
public void setApplicationService(ApplicationService<Application,ApplicationDao<Application>> applicationService)
Sets the applicationService.- Parameters:
applicationService-
-
-