Vered Volansky has posted comments on this change.
Change subject: core: add validation to AddStorageServerConnection
......................................................................
Patch Set 3: (3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddStorageServerConnectionCommand.java
Line 49: getReturnValue().setFault(fault);
Line 50: setSucceeded(false);
Line 51: }
Line 52: }
Line 53:
Consider rearranging the helper methods so that they appear after the method
they're used in.
Line 54: protected StorageServerConnections getConnectionFromDbById(String
connectionId) {
Line 55: return
getDbFacade().getStorageServerConnectionDao().get(connectionId);
Line 56: }
Line 57:
Line 72:
Line 73: @Override
Line 74: protected boolean canDoAction() {
Line 75: boolean returnValue = true;
Line 76: StorageServerConnections paramConnection = getConnection();
This is no longer paramConnection, just connection.
Line 77: // if an id was sent - it's not ok since only the backend
should allocate ids
Line 78: if (StringUtils.isNotEmpty(paramConnection.getid())) {
Line 79: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY);
Line 80: }
Line 87: if (paramConnection.getstorage_type() == StorageType.POSIXFS
Line 88: &&
(StringUtils.isEmpty(paramConnection.getVfsType()))) {
Line 89: return
failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE);
Line 90: }
Line 91: if (isConnWithSameDetailsExists()) {
Isn't isConnExists() enough? This really is a question, BTW.
Line 92: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS);
Line 93: }
Line 94:
Line 95: if (getParameters().getVdsId().equals(Guid.Empty)) {
--
To view, visit http://gerrit.ovirt.org/15388
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If9bcef8a413589654d36db8d878c844550ae6066
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches