@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); String metricStoreType = getMetricStoreType().getId(); // Disable validation here, since we don't want an illegal config to prevent us from fixing it. MetricStore metricStore = new OperationHandler<MetricStore>() .setOperation(Daemon.getMetricStore(currentDeployment, metricStoreType, false)) .setFailureMesssage("Failed to get " + metricStoreType + " method.") .get(); int originalHash = metricStore.hashCode(); metricStore = editMetricStore((T) metricStore); if (originalHash == metricStore.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setMetricStore(currentDeployment, metricStoreType, !noValidate, metricStore)) .setFailureMesssage("Failed to edit " + metricStoreType + " method.") .setSuccessMessage("Successfully edited " + metricStoreType + " method.") .get(); } }
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); String metricStoreType = getMetricStoreType().getId(); // Disable validation here, since we don't want an illegal config to prevent us from fixing it. MetricStore metricStore = new OperationHandler<MetricStore>() .setOperation(Daemon.getMetricStore(currentDeployment, metricStoreType, false)) .setFailureMesssage("Failed to get " + metricStoreType + " method.") .get(); int originalHash = metricStore.hashCode(); metricStore = editMetricStore((T) metricStore); if (originalHash == metricStore.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setMetricStore(currentDeployment, metricStoreType, !noValidate, metricStore)) .setFailureMesssage("Failed to edit " + metricStoreType + " method.") .setSuccessMessage("Successfully edited " + metricStoreType + " method.") .get(); } }