public boolean pause(String taskName) {
   if (!isInitialized()) {
     return false;
   }
   try {
     synchronized (lock) {
       taskManager.pauseTask(taskName);
     }
     return true;
   } catch (Exception e) {
     logger.error("Cannot pause task [" + taskName + "]. Error: " + e.getLocalizedMessage(), e);
   }
   return false;
 }
 public boolean pauseAll() {
   if (!isInitialized()) {
     return false;
   }
   try {
     synchronized (lock) {
       List<TaskInfo> taskList = taskManager.getAllTasks();
       for (TaskInfo taskInfo : taskList) {
         taskManager.pauseTask(taskInfo.getName());
       }
     }
     return true;
   } catch (Exception e) {
     logger.error("Cannot pause all tasks. Error: " + e.getLocalizedMessage(), e);
   }
   return false;
 }