package com.s24.redjob.channel.command;

import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.s24.redjob.queue.QueueWorker;

/**
 * Command to shutdown queue workers.
 */
@JsonTypeName
public class PauseQueueWorker {
   /**
    * Pause (true) or unpause (false) workers?.
    */
   private boolean pause;

   /**
    * Workers of which queues should be paused?.
    * If empty, all workers will be paused.
    */
   private Set<String> queues = new HashSet<>();

   /**
    * Hidden default constructor for Jackson.
    */
   @JsonCreator
   PauseQueueWorker() {
   }

   /**
    * Constructor to pause/unpause all workers.
    */
   public PauseQueueWorker(boolean pause) {
      this.pause = pause;
   }

   /**
    * Pause (true) or unpause (false) workers?.
    */
   public boolean isPause() {
      return pause;
   }

   /**
    * Workers of which queues should be paused?.
    * If empty, all workers will be paused.
    */
   public Set<String> getQueues() {
      return queues;
   }

   /**
    * Does the worker match the selectors of the job?.
    */
   protected boolean matches(QueueWorker worker) {
      return queues.isEmpty() || worker.getQueues().stream().filter(queues::contains).findAny().isPresent();
   }
}

@@ -34,16 +34,118 @@
 mmand;%0A%0A
+import static java.util.Collections.emptyList;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0A
 import j
@@ -162,16 +162,16 @@
 ashSet;%0A
-
 import j
@@ -898,22 +898,779 @@
 this
-.pause = pause
+(pause, emptyList());%0A   %7D%0A%0A   /**%0A    * Constructor to pause/unpause workers processing the given queues.%0A    *%0A    * @param pause%0A    *           Pause (true) or unpause (false)?%0A    * @param queues%0A    *           Queues to select workers. If empty, select all workers.%0A    */%0A   public PauseQueueWorker(boolean pause, String... queues) %7B%0A      this(pause, Arrays.asList(queues));%0A   %7D%0A%0A   /**%0A    * Constructor to pause/unpause workers processing the given queues.%0A    *%0A    * @param pause%0A    *           Pause (true) or unpause (false)?%0A    * @param queues%0A    *           Queues to select workers. If empty, select all workers.%0A    */%0A   public PauseQueueWorker(boolean pause, Collection%3CString%3E queues) %7B%0A      this.pause = pause;%0A      this.queues.addAll(queues)
 ;%0A  

Add missing convenience constructor