mirror of https://github.com/apache/nifi.git
NIFI-1900: Verify that connection's destination is not running when trying to change destination
This closes #550
This commit is contained in:
parent
f47be77b6a
commit
36ab8474dd
|
@ -409,6 +409,13 @@ public class StandardConnectionDAO extends ComponentDAO implements ConnectionDAO
|
|||
throw new ValidationException(validationErrors);
|
||||
}
|
||||
|
||||
// If destination is changing, ensure that current destination is not running. This check is done here, rather than
|
||||
// in the Connection object itself because the Connection object itself does not know which updates are to occur and
|
||||
// we don't want to prevent updating things like the connection name or backpressure just because the destination is running
|
||||
if (connectionDTO.getDestination() != null && connection.getDestination().isRunning()) {
|
||||
throw new IllegalStateException("Cannot change the destination of connection because the current destination is running");
|
||||
}
|
||||
|
||||
// verify that this connection supports modification
|
||||
connection.verifyCanUpdate();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue