Class DefaultOrderHistoryService

    • Constructor Detail

      • DefaultOrderHistoryService

        public DefaultOrderHistoryService()
    • Method Detail

      • getVersionIDGenerator

        public KeyGenerator getVersionIDGenerator()
      • setVersionIDGenerator

        public void setVersionIDGenerator​(KeyGenerator versionIDGenerator)
      • saveHistorySnapshot

        public void saveHistorySnapshot​(OrderModel snapshot)
        Description copied from interface: OrderHistoryService
        Actually persists a previously created order snapshot. Please note that it is necessary to use this method instead just calling ModelService.save(Object) to overcome Jalo layer business logic resetting some attributes. In future this may not be necessary.
        Specified by:
        saveHistorySnapshot in interface OrderHistoryService
        Parameters:
        snapshot - the order snapshot
      • getHistorySnapshots

        public java.util.Collection<OrderModel> getHistorySnapshots​(OrderModel ownerOrder)
        Description copied from interface: OrderHistoryService
        Fetches all snapshots which have been created and assigned to the given order's history entries.
        Specified by:
        getHistorySnapshots in interface OrderHistoryService
        Parameters:
        ownerOrder - the original order
        Returns:
        all history snapshots
      • getHistoryEntries

        protected java.util.Collection getHistoryEntries​(OrderModel ownerOrder,
                                                         java.util.Date dateFrom,
                                                         java.util.Date dateTo,
                                                         boolean descriptionOnly)
        Returns collection of OrderHistoryEntryModel or OrderHistoryEntryModel.DESCRIPTION for a given time range
        Parameters:
        ownerOrder - - required
        dateFrom - - possible null value
        dateTo - - possible null value
        descriptionOnly - - set to true to get descriptions only instead of the whole OrderHistoryEntryModel objects
        Returns:
        Collection
      • isWithingDateRange

        protected boolean isWithingDateRange​(OrderHistoryEntryModel entry,
                                             java.util.Date from,
                                             java.util.Date to)
      • getHistoryEntries

        public java.util.Collection<OrderHistoryEntryModel> getHistoryEntries​(UserModel user,
                                                                              java.util.Date dateFrom,
                                                                              java.util.Date dateTo)
        Description copied from interface: OrderHistoryService
        Fetches history entries of the orders placed by the user in the given time range
        Specified by:
        getHistoryEntries in interface OrderHistoryService
        Parameters:
        user - user that placed the orders
        dateFrom - set dateFrom to null if you want to make the time range only half limited
        dateTo - set dateTo to null if you want to make the time range only half limited
        Returns:
        collection of OrderHistoryEntryModel
      • getEntriesDescriptions

        protected java.util.Collection<java.lang.String> getEntriesDescriptions​(java.util.Collection<OrderHistoryEntryModel> entries)
        Fetches the collection of history entries descriptions
        Parameters:
        entries - history entries that you want to fetch descriptions from
        Returns:
        collection of history entries description
      • getHistoryEntries

        public java.util.Collection<OrderHistoryEntryModel> getHistoryEntries​(OrderModel ownerOrder,
                                                                              java.util.Date dateFrom,
                                                                              java.util.Date dateTo)
        Description copied from interface: OrderHistoryService
        Fetches history entries of the ownerOrder from the given time range
        Specified by:
        getHistoryEntries in interface OrderHistoryService
        Parameters:
        ownerOrder - the owner order
        dateFrom - upper limit of the time range
        dateTo - lower limit of the time range
        Returns:
        Collection of history entries of the given ownerOrder that were captured in the given time range
      • getHistoryEntriesDescriptions

        public java.util.Collection<java.lang.String> getHistoryEntriesDescriptions​(OrderModel ownerOrder,
                                                                                    java.util.Date dateFrom,
                                                                                    java.util.Date dateTo)
        Description copied from interface: OrderHistoryService
        Fetches the descriptions of history entries of the ownerOrder from the given time range
        Specified by:
        getHistoryEntriesDescriptions in interface OrderHistoryService
        Parameters:
        ownerOrder - the owner order
        dateFrom - upper limit of the time range
        dateTo - lower limit of the time range
        Returns:
        Collection of history entries of the given ownerOrder that were captured in the given time range
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)