Package org.bonitasoft.engine.resources
Class TenantResourcesServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.resources.TenantResourcesServiceImpl
-
- All Implemented Interfaces:
TenantResourcesService
public class TenantResourcesServiceImpl extends java.lang.Object implements TenantResourcesService
- Author:
- Baptiste Mesta
-
-
Field Summary
-
Fields inherited from interface org.bonitasoft.engine.resources.TenantResourcesService
TENANT_RESOURCE
-
-
Constructor Summary
Constructors Constructor Description TenantResourcesServiceImpl(Recorder recorder, ReadPersistenceService persistenceService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String name, TenantResourceType type, byte[] content, long userId)longcount(TenantResourceType type)longcount(TenantResourceType type, java.lang.String name)java.util.List<STenantResource>get(TenantResourceType type, int from, int numberOfElements)STenantResourceget(TenantResourceType type, java.lang.String name)java.util.List<STenantResourceLight>getLight(TenantResourceType type, int from, int numberOfElements)STenantResourceLightgetSingleLightResource(TenantResourceType type)Returns a single STenantResourceLight of the given type.voidremove(AbstractSTenantResource resource)voidremoveAll(TenantResourceType type)
-
-
-
Constructor Detail
-
TenantResourcesServiceImpl
public TenantResourcesServiceImpl(Recorder recorder, ReadPersistenceService persistenceService)
-
-
Method Detail
-
add
public void add(java.lang.String name, TenantResourceType type, byte[] content, long userId) throws SRecorderException- Specified by:
addin interfaceTenantResourcesService- Throws:
SRecorderException
-
removeAll
public void removeAll(TenantResourceType type) throws SBonitaReadException, SRecorderException
- Specified by:
removeAllin interfaceTenantResourcesService- Throws:
SBonitaReadExceptionSRecorderException
-
getLight
public java.util.List<STenantResourceLight> getLight(TenantResourceType type, int from, int numberOfElements) throws SBonitaReadException
- Throws:
SBonitaReadException
-
get
public java.util.List<STenantResource> get(TenantResourceType type, int from, int numberOfElements) throws SBonitaReadException
- Specified by:
getin interfaceTenantResourcesService- Throws:
SBonitaReadException
-
count
public long count(TenantResourceType type) throws SBonitaReadException
- Specified by:
countin interfaceTenantResourcesService- Throws:
SBonitaReadException
-
count
public long count(TenantResourceType type, java.lang.String name) throws SBonitaReadException
- Specified by:
countin interfaceTenantResourcesService- Throws:
SBonitaReadException
-
get
public STenantResource get(TenantResourceType type, java.lang.String name) throws SBonitaReadException
- Specified by:
getin interfaceTenantResourcesService- Throws:
SBonitaReadException
-
getSingleLightResource
public STenantResourceLight getSingleLightResource(TenantResourceType type) throws SBonitaReadException
Description copied from interface:TenantResourcesServiceReturns a single STenantResourceLight of the given type. This is the responsibility of the caller to only call this method when he / she is sure that there are not more than one result of the query. If the result is non unique, a SBonitaReadException is thrown.- Specified by:
getSingleLightResourcein interfaceTenantResourcesService- Parameters:
type- the type of the resource to filter- Returns:
- the found resource if unique, null if none found
- Throws:
SBonitaReadException- if non unique result, or other Hibernate exception is issued
-
remove
public void remove(AbstractSTenantResource resource) throws SRecorderException
- Specified by:
removein interfaceTenantResourcesService- Throws:
SRecorderException
-
-