Class MemoryWorkQueuing

    • Method Detail

      • workRunning

        public void workRunning​(String queueId,
                                Work work)
        Description copied from interface: WorkQueuing
        Put the work instance into the running set.
        Specified by:
        workRunning in interface WorkQueuing
        Parameters:
        queueId - the queue id
        work - the work instance
      • workCompleted

        public void workCompleted​(String queueId,
                                  Work work)
        Description copied from interface: WorkQueuing
        Moves a work instance from the running set to the completed set.
        Specified by:
        workCompleted in interface WorkQueuing
        Parameters:
        queueId - the queue id
        work - the work instance
      • workReschedule

        public void workReschedule​(String queueId,
                                   Work work)
        Description copied from interface: WorkQueuing
        Moves back a work instance from running set to the scheduled set.
        Specified by:
        workReschedule in interface WorkQueuing
      • find

        public Work find​(String workId,
                         Work.State state)
        Description copied from interface: WorkQueuing
        Finds a work instance in the scheduled or running or completed sets.
        Specified by:
        find in interface WorkQueuing
        Parameters:
        workId - the id of the work to find
        state - the state defining the state to look into, SCHEDULED, RUNNING, or null for SCHEDULED or RUNNING
        Returns:
        the found work instance, or null if not found
      • isWorkInState

        public boolean isWorkInState​(String workId,
                                     Work.State state)
        Description copied from interface: WorkQueuing
        Checks if a work instance with the given id is in the given state.
        Specified by:
        isWorkInState in interface WorkQueuing
        Parameters:
        workId - the work id
        state - the state, SCHEDULED, RUNNING, or null for non-completed
        Returns:
        true if a work instance with the given id is in the given state
      • listWork

        public List<Work> listWork​(String queueId,
                                   Work.State state)
        Description copied from interface: WorkQueuing
        Lists the work instances in a given queue in a defined state.

        Note that an instance requested as RUNNING could be found SUSPENDING or SUSPENDED, and an instance requested as COMPLETED could be found FAILED.

        Specified by:
        listWork in interface WorkQueuing
        Parameters:
        queueId - the queue id
        state - the state defining the state to look into, SCHEDULED, RUNNING, or null for non-completed
        Returns:
        the list of work instances in the given state
      • listWorkIds

        public List<String> listWorkIds​(String queueId,
                                        Work.State state)
        Description copied from interface: WorkQueuing
        Lists the work ids in a given queue in a defined state.
        Specified by:
        listWorkIds in interface WorkQueuing
        Parameters:
        queueId - the queue id
        state - the state defining the state to look into, SCHEDULED, RUNNING, or null for non-completed
        Returns:
        the list of work ids in the given state
      • count

        public long count​(String queueId,
                          Work.State state)
        Description copied from interface: WorkQueuing
        Gets the number of work instances in the given state in a given queue.
        Specified by:
        count in interface WorkQueuing
        Parameters:
        queueId - the queue id
        state - the state, SCHEDULED or RUNNING
        Returns:
        the number of scheduled work instances in the queue
      • removeScheduled

        public void removeScheduled​(String queueId,
                                    String workId)
        Description copied from interface: WorkQueuing
        Finds a scheduled work instance and removes it from the scheduled queue.
        Specified by:
        removeScheduled in interface WorkQueuing
        Parameters:
        queueId - the queue id
        workId - the id of the work to find
      • setActive

        public void setActive​(String queueId,
                              boolean value)
        Description copied from interface: WorkQueuing
        Enable/disable this queueId processing
        Specified by:
        setActive in interface WorkQueuing
      • workHasState

        protected static boolean workHasState​(Work work,
                                              Work.State state)
        Returns true if the given state is not null and matches the state of the given work or if the state is null and the work's state is either Work.State.SCHEDULED or Work.State.RUNNING, false otherwise.
        Since:
        9.3
      • supportsProcessingDisabling

        public boolean supportsProcessingDisabling()
        Specified by:
        supportsProcessingDisabling in interface WorkQueuing
        Returns:
        true if the implementation supports processing disabling