Package com.skava.inventory.service.impl
Class CollectionDependencies
java.lang.Object
com.skava.inventory.service.impl.CommonDependencies
com.skava.inventory.service.impl.CollectionDependencies
- Author:
- Infosys Equinox
-
Field Summary
Fields inherited from class com.skava.inventory.service.impl.CommonDependencies
binItemRepository, binRepository, cacheUtil, collectionDependencies, collectionPropertyRepository, collectionRepository, context, createBinItemService, createBinService, inventoryEventService, messageSource, searchCountCache, transactionRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkBinTypeAvailablity
(Long collectionId, String binType) Check the given bin type is exist in the collection propertyboolean
checkCollectionIsActive
(Collection collection) Check the given collection is active or not.checkCollectionProperties
(List<CollectionPropertyDTO> collectionPropertyToUpdate) This method will check the collection properties length and the attribute nullable checkcheckCollectionProperty
(List<CollectionPropertyDTO> collectionProperties, List<CollectionAttribute> collectionAttributes) The method checks for all the collection properties while creating the collection.void
checkPatchCollectionProperty
(CollectionProperty property, List<CollectionAttribute> collectionAttributes) The method checks for all the collection properties while creating the collectiongetCollectionByBusinessIdAndId
(long businessId, long collectionId) This method validates the collection existence and its ACTIVE state.getCollectionById
(Long collectionId) This method validates the collection existence and its ACTIVE state.getCollectionProperty
(Long collectionId, String propertyName, String defaultValue) Get collection property of the collection.List<com.skava.core.validation.ValidatorComponent>
getValidatorsFromProperty
(Long collectionId, String propertyName, String defaultValue) Get list of validators using collection property by given name.Methods inherited from class com.skava.inventory.service.impl.CommonDependencies
checkBinIsActive, checkBinItemIsActive, checkForDuplicateName, clearCollectionCache, clearCollectionPropertyCache
-
Constructor Details
-
CollectionDependencies
-
-
Method Details
-
getValidatorsFromProperty
public List<com.skava.core.validation.ValidatorComponent> getValidatorsFromProperty(Long collectionId, String propertyName, String defaultValue) Get list of validators using collection property by given name.- Parameters:
collectionId
- id of the collectionpropertyName
- name of the propertydefaultValue
- default value- Returns:
List<ValidatorComponent>
-
getCollectionProperty
Get collection property of the collection.- Parameters:
collectionId
- id of the collectionpropertyName
- name of the propertydefaultValue
- default value- Returns:
- String
-
checkBinTypeAvailablity
Check the given bin type is exist in the collection property- Parameters:
collectionId
- Id of the collectionbinType
- Type of the bin- Returns:
- Return availability of the given bin type
-
getCollectionById
This method validates the collection existence and its ACTIVE state.- Parameters:
collectionId
- A unique identifier of the collection- Returns:
Collection
object
-
getCollectionByBusinessIdAndId
This method validates the collection existence and its ACTIVE state.- Parameters:
businessId
- a valid business identifier.collectionId
- a valid collection identifier.- Returns:
- a
Collection
object.
-
checkCollectionIsActive
Check the given collection is active or not.- Parameters:
collection
- object ofCollection
to check- Returns:
- boolean It returns true if the collection is active, if it is false throw an exception
-
checkCollectionProperties
public List<CollectionPropertyDTO> checkCollectionProperties(List<CollectionPropertyDTO> collectionPropertyToUpdate) This method will check the collection properties length and the attribute nullable check- Parameters:
collectionPropertyToUpdate
- - properties to be checked- Returns:
- A List of
CollectionPropertyDTO
object
-
checkCollectionProperty
public List<CollectionPropertyDTO> checkCollectionProperty(List<CollectionPropertyDTO> collectionProperties, List<CollectionAttribute> collectionAttributes) The method checks for all the collection properties while creating the collection. This method validates based on the is nullable flag for each collections.- Parameters:
collectionProperties
- - contains the collection propertiescollectionAttributes
- - contains the collection attribute- Returns:
- - A List of
CollectionPropertyDTO
object
-
checkPatchCollectionProperty
public void checkPatchCollectionProperty(CollectionProperty property, List<CollectionAttribute> collectionAttributes) The method checks for all the collection properties while creating the collection- Parameters:
property
- - property to be checkedcollectionAttributes
- - contains the collection attribute repository for mongo operations
-