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, LOG
-
-
Constructor Summary
Constructors Modifier Constructor Description PluginService()Default constructor, which calls the type-constructorprotectedPluginService(java.lang.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.java.lang.StringgetPluginNamespace()java.lang.StringgetPluginSource(java.lang.String simpleClassName)java.util.List<java.lang.String>preCheckDelete(java.lang.Integer pluginId)voidsetApplicationService(ApplicationService<Application,ApplicationDao<Application>> applicationService)Sets the applicationService.voidsetDao(D dao)We have to useQualifierto define the correct dao here.voidsetPluginNamespace(java.lang.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
-
-
-
-
Constructor Detail
-
PluginService
public PluginService()
Default constructor, which calls the type-constructor
-
PluginService
protected PluginService(java.lang.Class<E> entityClass)
Constructor that sets the concrete entity class for the service. Subclasses MUST call this constructor.
-
-
Method Detail
-
getPluginNamespace
public java.lang.String getPluginNamespace()
- Returns:
- the pluginNamespace
-
setPluginNamespace
public void setPluginNamespace(java.lang.String pluginNamespace)
- Parameters:
pluginNamespace- the pluginNamespace to set
-
getPluginSource
@Transactional(readOnly=true) public java.lang.String getPluginSource(java.lang.String simpleClassName) throws java.lang.Exception- Parameters:
simpleClassName-- Returns:
- Throws:
java.lang.Exception
-
preCheckDelete
@PreAuthorize("hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#pluginId, \'de.terrestris.shoguncore.model.Plugin\', \'DELETE\')") @Transactional(readOnly=true) public java.util.List<java.lang.String> preCheckDelete(java.lang.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-
-
-