public Command deleteCommand(final String id) throws GenieException {
LOG.debug("Called to delete command config with id " + id);
if (StringUtils.isBlank(id)) {
throw new GeniePreconditionException("No id entered. Unable to delete.");
}
final Command command = this.commandRepo.findOne(id);
if (command == null) {
throw new GenieNotFoundException("No command with id " + id + " exists to delete.");
}
//Remove the command from the associated Application references
final Application app = command.getApplication();
if (app != null) {
final Set<Command> commands = app.getCommands();
if (commands != null) {
commands.remove(command);
}