Examples of AddWatchManagementResponse


Examples of org.syncany.operations.daemon.messages.AddWatchManagementResponse

  @Subscribe
  public void onAddWatchRequestReceived(AddWatchManagementRequest request) {
    File rootFolder = request.getWatch();
   
    if (watchOperations.containsKey(rootFolder)) {
      eventBus.post(new AddWatchManagementResponse(AddWatchManagementResponse.ERR_ALREADY_EXISTS, request.getId(), "Watch already exists."));
    }
    else {     
      try {
        boolean folderAdded = DaemonConfigHelper.addToDaemonConfig(rootFolder);
       
        if (folderAdded) {
          eventBus.post(new AddWatchManagementResponse(AddWatchManagementResponse.OKAY, request.getId(), "Successfully added."));       
        }
        else {
          eventBus.post(new AddWatchManagementResponse(AddWatchManagementResponse.ERR_ALREADY_EXISTS, request.getId(), "Watch already exists (inactive/disabled)."));
        }
      }
      catch (ConfigException e) {
        logger.log(Level.WARNING, "Error adding watch to daemon config.", e);
        eventBus.post(new AddWatchManagementResponse(AddWatchManagementResponse.ERR_OTHER, request.getId(), "Error adding to config: " + e.getMessage()));
      }
    }       
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.