@Override
  public String execute() throws Exception {
    /* Initialize the backend service */
    StorageService backendStorageService = new StorageService();

    Strategies[] validStrategies = backendStorageService.getStrategies();

    boolean isValidStrategy = false;

    for (Strategies strategy : validStrategies) {
      System.out.printf("strategy = %s\n", strategy.name());

      if (strategy.name().equals(this.strategy)) {
        isValidStrategy = true;
        break;
      }
    }

    if (isValidStrategy == false) {
      return setErrorMessage("Invalid strategy: " + this.strategy);
    }

    int numReplicas = NumberUtils.toInt(this.replicationFactor);

    if (numReplicas < 1) {
      return setErrorMessage("Replication factor must be an integer > 0");
    }

    /* Initialize the backend storage */
    backendStorageService.initialize(Strategies.valueOf(strategy), numReplicas);

    /* Send a success full result back */
    return setDataMessage(new JSONObject());
  }
  @Override
  public String execute() throws Exception {
    /* Checks that a script name was given */
    if (scriptName == null) {
      return setErrorMessage("Must specify a name for the script");
    }

    /* Checkes that script was given */
    if (scriptFile == null) {
      return setErrorMessage("Must specify a script");
    }

    System.out.printf("ScriptName = %s\n", scriptName);
    System.out.printf("Script = %s\n", scriptFile);

    /* Creates the script from the description */
    Script script = ScriptService.parseScript(scriptFile);

    /* Creates the storage service */
    StorageService storageService = new StorageService();

    /* Checks that it is initialized */
    if (storageService.isInitialized() == false) {
      return setErrorMessage("Storage service has not been initialized");
    }

    /* Stores the script */
    storageService.storeNamedScript(scriptName, script);

    /* Success */
    return setDataMessage(new JSONObject());
  }