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 void
add(java.lang.String name, TenantResourceType type, byte[] content, long userId)
long
count(TenantResourceType type)
long
count(TenantResourceType type, java.lang.String name)
java.util.List<STenantResource>
get(TenantResourceType type, int from, int numberOfElements)
STenantResource
get(TenantResourceType type, java.lang.String name)
java.util.List<STenantResourceLight>
getLight(TenantResourceType type, int from, int numberOfElements)
STenantResourceLight
getSingleLightResource(TenantResourceType type)
Returns a single STenantResourceLight of the given type.void
remove(AbstractSTenantResource resource)
void
removeAll(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:
add
in interfaceTenantResourcesService
- Throws:
SRecorderException
-
removeAll
public void removeAll(TenantResourceType type) throws SBonitaReadException, SRecorderException
- Specified by:
removeAll
in interfaceTenantResourcesService
- Throws:
SBonitaReadException
SRecorderException
-
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:
get
in interfaceTenantResourcesService
- Throws:
SBonitaReadException
-
count
public long count(TenantResourceType type) throws SBonitaReadException
- Specified by:
count
in interfaceTenantResourcesService
- Throws:
SBonitaReadException
-
count
public long count(TenantResourceType type, java.lang.String name) throws SBonitaReadException
- Specified by:
count
in interfaceTenantResourcesService
- Throws:
SBonitaReadException
-
get
public STenantResource get(TenantResourceType type, java.lang.String name) throws SBonitaReadException
- Specified by:
get
in interfaceTenantResourcesService
- Throws:
SBonitaReadException
-
getSingleLightResource
public STenantResourceLight getSingleLightResource(TenantResourceType type) throws SBonitaReadException
Description copied from interface:TenantResourcesService
Returns 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:
getSingleLightResource
in 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:
remove
in interfaceTenantResourcesService
- Throws:
SRecorderException
-
-