Class CategoryServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.core.category.impl.CategoryServiceImpl
-
- All Implemented Interfaces:
CategoryService
public class CategoryServiceImpl extends java.lang.Object implements CategoryService
- Author:
- Yanyan Liu, Matthieu Chaffotte, Celine Souchet
-
-
Field Summary
-
Fields inherited from interface org.bonitasoft.engine.core.category.CategoryService
CATEGORY
-
-
Constructor Summary
Constructors Constructor Description CategoryServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, SessionService sessionService, ReadSessionAccessor sessionAccessor, QueriableLoggerService queriableLoggerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProcessDefinitionsToCategory(long categoryId, java.util.List<java.lang.Long> processDefinitionIds)Add process definitions to a categoryvoidaddProcessDefinitionToCategory(long categoryId, long processDefinitionId)Add a process definition to a categorySCategorycreateCategory(java.lang.String name, java.lang.String description)Create a category by give name and descriptionvoiddeleteCategory(long categoryId)Delete a category by its idlongdeleteProcessCategoryMappings(java.util.List<SProcessCategoryMapping> mappings)java.util.List<SCategory>getCategories(int fromIndex, int numberOfCategories, java.lang.String field, OrderByType order)Retrieves a list of categories, The returned list is paginatedjava.util.List<SCategory>getCategoriesOfProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order)Get categories for specific process definition, the result list is paginatedjava.util.List<SCategory>getCategoriesUnrelatedToProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order)Get categories not attached for specific process definition, the result list is paginatedSCategorygetCategory(long id)Get category by its idSCategorygetCategoryByName(java.lang.String name)Get category by its namelonggetNumberOfCategories()Get the total number of categorieslonggetNumberOfCategoriesOfProcess(long processDefinitionId)Get number of categories of the specific process definitionlonggetNumberOfCategoriesUnrelatedToProcess(long processDefinitionId)Get number of categories not attached of the specific process definitionlonggetNumberOfCategorizedProcessIds(java.util.List<java.lang.Long> processIds)Get number of categorized processeslonggetNumberOfProcessDeploymentInfosOfCategory(long categoryId)Get the number of process definition for specific categoryvoidremoveCategoriesFromProcessDefinition(long processDefinitionId, java.util.List<java.lang.Long> categoryIds)Remove specific categories for specific process definitionjava.util.List<SProcessCategoryMapping>searchProcessCategoryMappings(QueryOptions queryOptions)Search process category mappings corresponding to criteriavoidupdateCategory(long categoryId, EntityUpdateDescriptor descriptor)Update a category by its id
-
-
-
Constructor Detail
-
CategoryServiceImpl
public CategoryServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, SessionService sessionService, ReadSessionAccessor sessionAccessor, QueriableLoggerService queriableLoggerService)
-
-
Method Detail
-
createCategory
public SCategory createCategory(java.lang.String name, java.lang.String description) throws SCategoryAlreadyExistsException, SCategoryCreationException
Description copied from interface:CategoryServiceCreate a category by give name and description- Specified by:
createCategoryin interfaceCategoryService- Parameters:
name- The name of categorydescription- The description of category- Returns:
- the category object with id
- Throws:
SCategoryAlreadyExistsException- Error thrown if category is already existSCategoryCreationException- Error thrown if has exceptions during the category creation.
-
getCategory
public SCategory getCategory(long id) throws SCategoryNotFoundException
Description copied from interface:CategoryServiceGet category by its id- Specified by:
getCategoryin interfaceCategoryService- Parameters:
id- Identifier of the category- Returns:
- a category object
- Throws:
SCategoryNotFoundException- Error thrown if no category have an id corresponding to the parameter.
-
getCategoryByName
public SCategory getCategoryByName(java.lang.String name) throws SCategoryNotFoundException
Description copied from interface:CategoryServiceGet category by its name- Specified by:
getCategoryByNamein interfaceCategoryService- Parameters:
name- Name of the category- Returns:
- a category object
- Throws:
SCategoryNotFoundException- Error thrown if no category have a name corresponding to the parameter.
-
updateCategory
public void updateCategory(long categoryId, EntityUpdateDescriptor descriptor) throws SCategoryExceptionDescription copied from interface:CategoryServiceUpdate a category by its id- Specified by:
updateCategoryin interfaceCategoryService- Parameters:
categoryId- Identifier of the category- Throws:
SCategoryNotFoundException- Error thrown if no category have an id corresponding to the parameter.SCategoryException- Error thrown if has exception during the category update
-
deleteCategory
public void deleteCategory(long categoryId) throws SCategoryNotFoundException, SCategoryDeletionExceptionDescription copied from interface:CategoryServiceDelete a category by its id- Specified by:
deleteCategoryin interfaceCategoryService- Parameters:
categoryId- Identifier of the category- Throws:
SCategoryNotFoundException- Error thrown if no category have an id corresponding to the parameter.SCategoryDeletionException- Error thrown if has exception during the category deletion
-
getNumberOfCategories
public long getNumberOfCategories() throws SCategoryExceptionDescription copied from interface:CategoryServiceGet the total number of categories- Specified by:
getNumberOfCategoriesin interfaceCategoryService- Returns:
- The total number of Categories
- Throws:
SCategoryException
-
getCategories
public java.util.List<SCategory> getCategories(int fromIndex, int numberOfCategories, java.lang.String field, OrderByType order) throws SCategoryException
Description copied from interface:CategoryServiceRetrieves a list of categories, The returned list is paginated- Specified by:
getCategoriesin interfaceCategoryService- Parameters:
fromIndex- Index of the record to be returned. First record has index 0.numberOfCategories- Number of categories per page. Maximum number of categories returned.field- The field used by the list orderorder- ASC or DESC- Returns:
- The list of category objects
- Throws:
SPageOutOfRangeException- Error thrown if page is out of the range.SCategoryException- Error thrown if has exception during the category retrieve
-
addProcessDefinitionToCategory
public void addProcessDefinitionToCategory(long categoryId, long processDefinitionId) throws SCategoryExceptionDescription copied from interface:CategoryServiceAdd a process definition to a category- Specified by:
addProcessDefinitionToCategoryin interfaceCategoryService- Parameters:
categoryId- Identifier of the categoryprocessDefinitionId- Identifier of the process definition- Throws:
SCategoryNotFoundException- Error thrown if no category have an id corresponding to the parameter.SCategoryException- Error thrown if has exception during the adding action
-
addProcessDefinitionsToCategory
public void addProcessDefinitionsToCategory(long categoryId, java.util.List<java.lang.Long> processDefinitionIds) throws SCategoryExceptionDescription copied from interface:CategoryServiceAdd process definitions to a category- Specified by:
addProcessDefinitionsToCategoryin interfaceCategoryService- Parameters:
categoryId- Identifier of the categoryprocessDefinitionIds- Identifier of the process definition- Throws:
SCategoryNotFoundException- Error thrown if no category have an id corresponding to the parameter.SCategoryException- Error thrown if has exception during the adding actionSCategoryInProcessAlreadyExistsException
-
getNumberOfCategoriesOfProcess
public long getNumberOfCategoriesOfProcess(long processDefinitionId) throws SCategoryExceptionDescription copied from interface:CategoryServiceGet number of categories of the specific process definition- Specified by:
getNumberOfCategoriesOfProcessin interfaceCategoryService- Parameters:
processDefinitionId- Identifier of the process definition- Returns:
- number of categories
- Throws:
SCategoryException- Error thrown if has exception during the category number retrieve action
-
getNumberOfCategoriesUnrelatedToProcess
public long getNumberOfCategoriesUnrelatedToProcess(long processDefinitionId) throws SCategoryExceptionDescription copied from interface:CategoryServiceGet number of categories not attached of the specific process definition- Specified by:
getNumberOfCategoriesUnrelatedToProcessin interfaceCategoryService- Returns:
- number of categories
- Throws:
SCategoryException- Error thrown if has exception during the category number retrieve action
-
getCategoriesOfProcessDefinition
public java.util.List<SCategory> getCategoriesOfProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order) throws SCategoryException
Description copied from interface:CategoryServiceGet categories for specific process definition, the result list is paginated- Specified by:
getCategoriesOfProcessDefinitionin interfaceCategoryService- Parameters:
processDefinitionId- Identifier of the process definitionfromIndex- Start index of satisfied recordnumberOfCategories- Number of categories per page. Maximum number of categories returned.order- Criterion for order, default order by name- Returns:
- The matching list of category
- Throws:
SCategoryException- Error thrown if has exception during the category retrieve actionSIndexOutOfRangeException- Error thrown if index is out of the range.
-
getCategoriesUnrelatedToProcessDefinition
public java.util.List<SCategory> getCategoriesUnrelatedToProcessDefinition(long processDefinitionId, int fromIndex, int numberOfCategories, OrderByType order) throws SCategoryException
Description copied from interface:CategoryServiceGet categories not attached for specific process definition, the result list is paginated- Specified by:
getCategoriesUnrelatedToProcessDefinitionin interfaceCategoryService- Returns:
- The matching list of category
- Throws:
SCategoryException
-
removeCategoriesFromProcessDefinition
public void removeCategoriesFromProcessDefinition(long processDefinitionId, java.util.List<java.lang.Long> categoryIds) throws SCategoryExceptionDescription copied from interface:CategoryServiceRemove specific categories for specific process definition- Specified by:
removeCategoriesFromProcessDefinitionin interfaceCategoryService- Parameters:
processDefinitionId- Identifier of the process definitioncategoryIds- Identifiers of the categories- Throws:
SCategoryException
-
searchProcessCategoryMappings
public java.util.List<SProcessCategoryMapping> searchProcessCategoryMappings(QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:CategoryServiceSearch process category mappings corresponding to criteria- Specified by:
searchProcessCategoryMappingsin interfaceCategoryService- Returns:
- List of process category mappings
- Throws:
SBonitaReadException
-
deleteProcessCategoryMappings
public long deleteProcessCategoryMappings(java.util.List<SProcessCategoryMapping> mappings)
- Specified by:
deleteProcessCategoryMappingsin interfaceCategoryService- Returns:
- Number of deleted category mapping
-
getNumberOfCategorizedProcessIds
public long getNumberOfCategorizedProcessIds(java.util.List<java.lang.Long> processIds) throws SCategoryExceptionDescription copied from interface:CategoryServiceGet number of categorized processes- Specified by:
getNumberOfCategorizedProcessIdsin interfaceCategoryService- Parameters:
processIds- Identifier of the process definition- Returns:
- the number of categorized processes
- Throws:
SCategoryException
-
getNumberOfProcessDeploymentInfosOfCategory
public long getNumberOfProcessDeploymentInfosOfCategory(long categoryId) throws SBonitaReadExceptionDescription copied from interface:CategoryServiceGet the number of process definition for specific category- Specified by:
getNumberOfProcessDeploymentInfosOfCategoryin interfaceCategoryService- Parameters:
categoryId- Identifier of the category- Returns:
- The number of process definition for specific category
- Throws:
SBonitaReadException
-
-