Class QueueIdStrategy

  • All Implemented Interfaces:
    ExtensionPoint
    Direct Known Subclasses:
    QueueIdStrategy.DefaultStrategy

    @Restricted(org.kohsuke.accmod.restrictions.Beta.class)
    public abstract class QueueIdStrategy
    extends Object
    implements ExtensionPoint
    Pluggable strategy to generate queue item IDs as well as persist an optional opaque state whenever the queue is persisted.
    • Constructor Detail

      • QueueIdStrategy

        public QueueIdStrategy()
    • Method Detail

      • persist

        public void persist​(@NonNull
                            Queue.State queueState)
        Persist the state of this strategy.
      • load

        public void load​(@NonNull
                         Queue.State queueState)
        Loads the state of this strategy from a persisted queue state.
      • generateIdFor

        public abstract long generateIdFor​(@NonNull
                                           Queue.Task project,
                                           @NonNull
                                           List<Action> actions)
        Generates a new ID for the given project and actions.
        Parameters:
        project - The task to be queued.
        actions - The actions linked the task.
        Returns:
        a new queue ID.