Interface ProductService

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      Product addProductToCategory​(java.lang.String categoryId, java.lang.String productId)
      This method does a relationship between entities.
      Product addProductToCategory​(java.lang.String categoryId, java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
      This method does a relationship between entities.
      java.util.Optional<Product> createProduct​(Product product)
      This method creates a database entity.
      java.util.Optional<Product> createProduct​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
      This method creates a database entity.
      java.util.HashSet<EmbeddedBean> getFallIntoProducts​(java.lang.String[] productIds)
      This method returns data as set.
      java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getPaginationFilter​(java.lang.String requestJson)
      This method does calculation for a pages based on the request.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getProductsByCategoryAndFirstLetter​(java.lang.String categoryId, java.lang.String firstLetter)
      This method retrieves a map, which can be processed in a templates.
      ProductRepository getRepository()  
      java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getSortedProductsByCategory​(java.lang.String categoryId)
      This method retrieves a map, which can be processed in a templates.
      ProductDTO mapProductToDto​(Product product, boolean optimal)
      This method does map product entity to dto object
      void removeProductAndClean​(java.lang.String productId)
      This method removes a database entity and clean all relationships from another entities.
      void removeProductFromAttribute​(java.lang.String productId, java.lang.String attrId)
      This method removes relationship between database entities.
      void removeProductFromAttributes​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductFromCategories​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductFromCategory​(java.lang.String productId, java.lang.String categoryId)
      This method removes relationship between database entities.
      void removeProductFromSKU​(java.lang.String productId, java.lang.String skuId)
      This method removes relationship between database entities.
      void removeProductFromSKUs​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductFromTranslation​(java.lang.String productId, java.lang.String tranId)
      This method removes relationship between database entities.
      void removeProductFromTranslations​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductsByIds​(java.util.ArrayList<java.lang.String> productsIds)
      This method removes a list of database entities.
      Product saveProduct​(Product product)
      This method saves a database entity.
      Product saveProduct​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
      This method save an updates of database entity.
      java.util.LinkedHashSet<ProductDTO> searchProducts​(java.lang.String requestJson)
      This method does search requests and returns data as list.
      java.util.List<Product> searchProducts​(java.lang.String query, java.lang.String offset, java.lang.String limit)
      Deprecated.
      org.springframework.data.domain.Page<Product> searchProductsPaged​(java.lang.String requestJson)
      This method does search requests and returns data as pages.
    • Method Detail

      • getPaginationFilter

        java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getPaginationFilter​(java.lang.String requestJson)
        This method does calculation for a pages based on the request.
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        map-representation of data
      • searchProducts

        java.util.LinkedHashSet<ProductDTO> searchProducts​(java.lang.String requestJson)
        This method does search requests and returns data as list.
        Parameters:
        requestJson - search request
        Returns:
        data transport entities as list
      • searchProductsPaged

        org.springframework.data.domain.Page<Product> searchProductsPaged​(java.lang.String requestJson)
        This method does search requests and returns data as pages.
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities separated to pages
      • searchProducts

        @Deprecated
        java.util.List<Product> searchProducts​(java.lang.String query,
                                               java.lang.String offset,
                                               java.lang.String limit)
        Deprecated.
        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
      • createProduct

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

        java.util.Optional<Product> createProduct​(Product product)
        This method creates a database entity.
        Parameters:
        product - database entity
        Returns:
        optional value to externally interaction
      • addProductToCategory

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

        Product addProductToCategory​(java.lang.String categoryId,
                                     java.lang.String productId)
        This method does a relationship between entities.
        Parameters:
        categoryId - identification for database entity which will be updated
        productId - identification for database entity which will be updated
        Returns:
        database entity
      • saveProduct

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

        Product saveProduct​(Product product)
        This method saves a database entity.
        Parameters:
        product - database entity
        Returns:
        saved instance of database entity
      • removeProductFromCategory

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

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

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

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

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

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

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

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

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

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

        java.util.HashSet<EmbeddedBean> getFallIntoProducts​(java.lang.String[] productIds)
        This method returns data as set.
        Parameters:
        productIds - the list of database entities which will be retrieved
        Returns:
        database entities as list
      • getSortedProductsByCategory

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

        java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getProductsByCategoryAndFirstLetter​(java.lang.String categoryId,
                                                                                                                   java.lang.String firstLetter)
        This method retrieves a map, which can be processed in a templates.
        Parameters:
        categoryId - identification for database entity which will be retrieved
        firstLetter - first letter of the name for the product
        Returns:
        map-representation of data
      • mapProductToDto

        ProductDTO mapProductToDto​(Product product,
                                   boolean optimal)
        This method does map product entity to dto object
        Parameters:
        product - database entity which be used to map to dto
        optimal - this pointer optimises the data transfer object
        Returns:
        data transport object