Class CollectionDependencies

java.lang.Object
com.skava.inventory.service.impl.CommonDependencies
com.skava.inventory.service.impl.CollectionDependencies

@Component public class CollectionDependencies extends CommonDependencies
Author:
Infosys Equinox
  • Constructor Details

    • CollectionDependencies

      public CollectionDependencies(CommonServices commonServices)
  • 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 collection
      propertyName - name of the property
      defaultValue - default value
      Returns:
      List<ValidatorComponent>
    • getCollectionProperty

      public String getCollectionProperty(Long collectionId, String propertyName, String defaultValue)
      Get collection property of the collection.
      Parameters:
      collectionId - id of the collection
      propertyName - name of the property
      defaultValue - default value
      Returns:
      String
    • checkBinTypeAvailablity

      public boolean checkBinTypeAvailablity(Long collectionId, String binType)
      Check the given bin type is exist in the collection property
      Parameters:
      collectionId - Id of the collection
      binType - Type of the bin
      Returns:
      Return availability of the given bin type
    • getCollectionById

      public Collection getCollectionById(Long collectionId)
      This method validates the collection existence and its ACTIVE state.
      Parameters:
      collectionId - A unique identifier of the collection
      Returns:
      Collection object
    • getCollectionByBusinessIdAndId

      public Collection getCollectionByBusinessIdAndId(long businessId, long collectionId)
      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

      public boolean checkCollectionIsActive(Collection collection)
      Check the given collection is active or not.
      Parameters:
      collection - object of Collection 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 properties
      collectionAttributes - - 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 checked
      collectionAttributes - - contains the collection attribute repository for mongo operations