Interface SKUService

  • All Known Implementing Classes:
    SKUServiceImpl

    public interface SKUService
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addRelations​(SKU skuUI)
      This method creates all relationships between database entities.
      SKU addSKUToProduct​(java.lang.String productId, java.util.LinkedHashMap<java.lang.String,​java.lang.Object> skuAsMap)
      This method does a relationship between entities.
      java.util.Optional<SKU> createSKU​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> skuAsMap)
      This method creates a database entity.
      java.util.List<SKU> findSKUs()
      This method returns database entities as list.
      java.util.List<Category> getCategoriesBySkuId​(java.lang.String skuId)
      This method retrieves a map, which can be processed in a templates.
      SKURepository getRepository()  
      java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getSortedProductSkus​(java.lang.String productId)
      This method sorted and retrieves a map, which can be processed in a templates.
      boolean isSKUExists​(java.lang.String name)
      This method checks is exists database entity.
      void prepareRelations​(SKU skuUI)
      This method does preparations of relationships between database entities.
      void removeRelations​(SKU skuUI, SKU skuDB)
      This method removes all relationships between database entities.
      void removeSKUAndClean​(java.lang.String skuId)
      This method removes a database entity and clean all relationships from another entities.
      void removeSKUFromAttribute​(java.lang.String skuId, java.lang.String attributeId)
      This method removes relationship between database entities.
      void removeSKUFromAttributes​(java.lang.String skuId)
      This method removes relationship between database entities.
      void removeSKUFromProduct​(java.lang.String skuId, java.lang.String productId)
      This method removes relationship between database entities.
      void removeSKUFromProducts​(java.lang.String skuId)
      This method removes relationship between database entities.
      void removeSKUFromSellerSKU​(java.lang.String skuId, java.lang.String sellerSkuId)
      This method removes relationship between database entities.
      void removeSKUFromSellerSKUs​(java.lang.String skuId)
      This method removes relationship between database entities.
      void removeSKUFromTranslation​(java.lang.String skuId, java.lang.String translationId)
      This method removes relationship between database entities.
      void removeSKUFromTranslations​(java.lang.String skuId)
      This method removes relationship between database entities.
      void removeSkusByIds​(java.util.ArrayList<java.lang.String> skusIds)
      This method removes a list of database entities.
      SKU saveSKU​(SKU sku)
      This method saves a database entity.
      SKU saveSKU​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> skuAsMap)
      This method save an updates of database entity.
      java.util.List<SKU> searchSKUs​(java.lang.String query, java.lang.String offset, java.lang.String limit)
      This method does search requests and returns data as list.
      java.util.List<SKU> searchWithProductFilter​(java.lang.String query, java.lang.String productId, java.lang.String offset, java.lang.String limit)
      This method does search requests and returns data as list.
    • Method Detail

      • searchSKUs

        java.util.List<SKU> searchSKUs​(java.lang.String query,
                                       java.lang.String offset,
                                       java.lang.String limit)
        This method does search requests and returns data as list.
        Parameters:
        query - search query
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        database entities as list
      • searchWithProductFilter

        java.util.List<SKU> searchWithProductFilter​(java.lang.String query,
                                                    java.lang.String productId,
                                                    java.lang.String offset,
                                                    java.lang.String limit)
        This method does search requests and returns data as list.
        Parameters:
        query - search query
        productId - field "_id" for filter and return items
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        database entities as list
      • findSKUs

        java.util.List<SKU> findSKUs()
        This method returns database entities as list.
        Returns:
        database entities as list
      • getCategoriesBySkuId

        java.util.List<Category> getCategoriesBySkuId​(java.lang.String skuId)
        This method retrieves a map, which can be processed in a templates.
        Parameters:
        skuId - identification for database entity which will be retrieved
        Returns:
        map-representation of data
      • createSKU

        java.util.Optional<SKU> createSKU​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> skuAsMap)
        This method creates a database entity.
        Parameters:
        skuAsMap - map-representation of database entity
        Returns:
        database entity
      • addSKUToProduct

        SKU addSKUToProduct​(java.lang.String productId,
                            java.util.LinkedHashMap<java.lang.String,​java.lang.Object> skuAsMap)
        This method does a relationship between entities.
        Parameters:
        productId - identification for database entity which will be updated
        skuAsMap - map-representation of database entity
        Returns:
        database entity
      • saveSKU

        SKU saveSKU​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> skuAsMap)
        This method save an updates of database entity.
        Parameters:
        skuAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • saveSKU

        SKU saveSKU​(SKU sku)
        This method saves a database entity.
        Parameters:
        sku - database entity
        Returns:
        saved instance of database entity
      • prepareRelations

        void prepareRelations​(SKU skuUI)
        This method does preparations of relationships between database entities.
        Parameters:
        skuUI - database entity
      • removeRelations

        void removeRelations​(SKU skuUI,
                             SKU skuDB)
        This method removes all relationships between database entities.
        Parameters:
        skuUI - source database entity
        skuDB - target database entity
      • addRelations

        void addRelations​(SKU skuUI)
        This method creates all relationships between database entities.
        Parameters:
        skuUI - source database entity
      • removeSKUFromAttribute

        void removeSKUFromAttribute​(java.lang.String skuId,
                                    java.lang.String attributeId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
        attributeId - identification for database entity which will be updated
      • removeSKUFromAttributes

        void removeSKUFromAttributes​(java.lang.String skuId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
      • removeSKUFromSellerSKU

        void removeSKUFromSellerSKU​(java.lang.String skuId,
                                    java.lang.String sellerSkuId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
        sellerSkuId - identification for database entity which will be updated
      • removeSKUFromSellerSKUs

        void removeSKUFromSellerSKUs​(java.lang.String skuId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
      • removeSKUFromProduct

        void removeSKUFromProduct​(java.lang.String skuId,
                                  java.lang.String productId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
        productId - identification for database entity which will be updated
      • removeSKUFromProducts

        void removeSKUFromProducts​(java.lang.String skuId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
      • removeSKUFromTranslation

        void removeSKUFromTranslation​(java.lang.String skuId,
                                      java.lang.String translationId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
        translationId - identification for database entity which will be updated
      • removeSKUFromTranslations

        void removeSKUFromTranslations​(java.lang.String skuId)
        This method removes relationship between database entities.
        Parameters:
        skuId - identification for database entity which will be removed
      • removeSKUAndClean

        void removeSKUAndClean​(java.lang.String skuId)
        This method removes a database entity and clean all relationships from another entities.
        Parameters:
        skuId - identification for database entity which will be removed
      • removeSkusByIds

        void removeSkusByIds​(java.util.ArrayList<java.lang.String> skusIds)
        This method removes a list of database entities.
        Parameters:
        skusIds - the list of database entities which will be removed
      • isSKUExists

        boolean isSKUExists​(java.lang.String name)
        This method checks is exists database entity.
        Parameters:
        name - field "name" for database entity which will be checked
        Returns:
        value as boolean
      • getSortedProductSkus

        java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getSortedProductSkus​(java.lang.String productId)
        This method sorted and retrieves a map, which can be processed in a templates.
        Parameters:
        productId - identification for database entity which will be retrieved
        Returns:
        map-representation of data