Package com.skava.search.process
Class CollectionProcess
java.lang.Object
com.skava.search.process.ParentProcess
com.skava.search.process.CollectionProcess
This class is the CollectionProcess. Collection process and validations is implemented in this class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionProcess
(CollectionRepository collectionRepository, CollectionPropertyProcess collectionPropertyProcess, com.skava.core.auth.AuthTokenHandler authTokenHandler, com.skava.search.properties.SearchProperties searchProperties, ConfigRepository configRepository, AttributeRepository attributeRepository, ConfigProcess configProcess, AttributeProcess attributeProcess) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(CollectionDO collectionDO) findAll
(CollectionDO collectionDO) This function is used to find all collection from the given request.findById
(CollectionDO collectionDO) This function is used to find collection by its id.boolean
isCollectionAvailable
(long collectionid) org.springframework.data.domain.Page<Collection>
This function is used to search the collection and find all collection based on filtering, pagination and sorting.update
(CollectionDO collectionDO) This function is used to update the collection.
-
Field Details
-
PAGE_CONSTANT
public static final int PAGE_CONSTANT- See Also:
-
DEFAULT_SEARCH_WEIGHTAGE
public static final int DEFAULT_SEARCH_WEIGHTAGE- See Also:
-
-
Constructor Details
-
CollectionProcess
@Autowired public CollectionProcess(CollectionRepository collectionRepository, CollectionPropertyProcess collectionPropertyProcess, com.skava.core.auth.AuthTokenHandler authTokenHandler, com.skava.search.properties.SearchProperties searchProperties, ConfigRepository configRepository, AttributeRepository attributeRepository, ConfigProcess configProcess, AttributeProcess attributeProcess)
-
-
Method Details
-
create
- Parameters:
collectionDO
- An instance ofCollectionDO
. This object contains the collection and collection property request data to create it in database.- Returns:
- An instance of
CollectionDO
.
-
findAll
This function is used to find all collection from the given request. This function calls the search function internally.- Parameters:
collectionDO
- collectionDO An instance ofCollectionDO
. This object contains the collection , collection property request data and filters/sort to find all the matched data.- Returns:
PageableDO
<CollectionDO
>
-
search
public org.springframework.data.domain.Page<Collection> search(String filters, org.springframework.data.domain.Sort sort, int page, int size) This function is used to search the collection and find all collection based on filtering, pagination and sorting.- Parameters:
filters
- This field is used to delete the particular data from SearchEngine which satisfies the filter condition . The fields presented in the filters should be same as it is in the SearchEngine for correct filtering . Sample Filtering Eg : {"filters":[{"field":"id","operation":"EQUALS","value":"1"}]}sort
- It contains the parameters for sorting. Example Format : {"sort":[{"field":"id","direction":"ASC"}]}.page
- This parameter will be available for all the services that supports pagination. It starts from value "1".size
- This parameter will be available for all the services that supports pagination . This holds the max page size.- Returns:
Page
<Collection
>
-
findById
This function is used to find collection by its id.- Parameters:
collectionDO
- collectionDO An instance ofCollectionDO
. This object contains the collection and collection property request data to find the matched data.- Returns:
- An instance of
CollectionDO
-
update
This function is used to update the collection.- Parameters:
collectionDO
- collectionDO An instance ofCollectionDO
. This object contains the collection and collection property request data to update it in the data base.- Returns:
- An instance of
CollectionDO
-
isCollectionAvailable
public boolean isCollectionAvailable(long collectionid)
-