Class CollectionProcess
java.lang.Object
com.skava.ratingandreviews.collection.process.CollectionProcess
The Class CollectionProcess.
This class defines all the process that are executed for the completion of the service requests on Collection.
- Since:
- 10.10.2018
- Version:
- 8.0
- Author:
- Infosys Equinox
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectionProcess(CollectionFactory collectionFactory, CollectionRepository collectionRepository, CacheImpl cacheImpl, CollectionPropertyRepository collectionPropertyRepository) -
Method Summary
Modifier and TypeMethodDescriptioncreate(CollectionDomain collectionDO) findAll(CollectionDomain collectionDO) This function is used to find all collection from the given request.findById(CollectionDomain collectionDO) FindByIdfindByIdorg.springframework.data.domain.Page<CollectionEntity>This function is used to search the collection and find all collection based on filtering, pagination and sorting.update(CollectionDomain collectionDO) This function is used to update the collection.
-
Field Details
-
PAGE_CONSTANT
public static final int PAGE_CONSTANT- See Also:
-
-
Constructor Details
-
CollectionProcess
@Autowired public CollectionProcess(CollectionFactory collectionFactory, CollectionRepository collectionRepository, CacheImpl cacheImpl, CollectionPropertyRepository collectionPropertyRepository)
-
-
Method Details
-
findById
findById
Find Collection Domain by Collection Identifier This method is used for authorization and all service APIs to determine if such a collection exists.
- Parameters:
collectionId- The collection identifier- Returns:
- The collection Domain model
-
findById
FindById
Find Collection Domain by collection identifier and business identifier This method is invoked to find a collection by its identifier and business identifier. This will load both the collection and its properties and returns the
CollectionDomainmodel.- Parameters:
collectionDO- The Collection domain model- Returns:
- An instance of
CollectionDomain
-
create
- Parameters:
collectionDO- An instance ofCollectionDomain. This object contains the collection and collection property request data to create it in database.- Returns:
- An instance of
CollectionDomain.
-
findAll
This function is used to find all collection from the given request. This function calls the ratingandreviews function internally.- Parameters:
collectionDO- collectionDO An instance ofCollectionDomain. This object contains the collection , collection property request data and filters/sort to find all the matched data.- Returns:
PageableDO<CollectionDomain>
-
search
public org.springframework.data.domain.Page<CollectionEntity> 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 solr which satisfies the filter condition . The fields presented in the filters should be same as it is in the solr 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<CollectionEntity>
-
update
This function is used to update the collection.- Parameters:
collectionDO- collectionDO An instance ofCollectionDomain. This object contains the collection and collection property request data to update it in the data base.- Returns:
- An instance of
CollectionDomain
-