Source:
protected boolean validate() { StorageServerConnections newConnectionDetails = getConnection(); StorageType storageType = newConnectionDetails.getStorageType(); if (!storageType.isFileDomain() && !storageType.equals(StorageType.ISCSI)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE_TYPE); } if (!isValidConnection(newConnectionDetails)) { return false; } String connectionId = newConnectionDetails.getId(); StorageServerConnections oldConnection = storageServerConnectionDao.get(connectionId); if (oldConnection == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST); } if (!newConnectionDetails.getStorageType().equals(oldConnection.getStorageType())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE); } Guid storagePoolId = getStoragePoolIdByFileConnectionId(oldConnection.getId()); String duplicateConnectionId = isConnWithSameDetailsExists(newConnectionDetails, storagePoolId); String currentConnectionId = newConnectionDetails.getId(); if (!duplicateConnectionId.equalsIgnoreCase(currentConnectionId)) { String storageDomainName = getStorageNameByConnectionId(duplicateConnectionId); addValidationMessageVariable("connectionId", duplicateConnectionId); addValidationMessageVariable("storageDomainName", storageDomainName); return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS); } if (doDomainsUseConnection(newConnectionDetails) || doLunsUseConnection()) { if (storageType.isFileDomain() && domains.size() > 1) { String domainNames = createDomainNamesList(domains); addValidationMessageVariable("domainNames", domainNames); return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS); } if (!isConnectionEditable(newConnectionDetails)) { return false; } } return super.validate(); }

Target:
protected boolean validate() { StorageServerConnections newConnectionDetails = getConnection(); StorageType storageType = newConnectionDetails.getStorageType(); if (!storageType.isFileDomain() && !storageType.equals(StorageType.ISCSI)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE_TYPE); } if (!isValidConnection(newConnectionDetails)) { return false; } String connectionId = newConnectionDetails.getId(); StorageServerConnections oldConnection = storageServerConnectionDao.get(connectionId); if (oldConnection == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST); } if (!newConnectionDetails.getStorageType().equals(oldConnection.getStorageType())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE); } Guid storagePoolId = getStoragePoolIdByFileConnectionId(oldConnection.getId()); String duplicateConnectionId = isConnWithSameDetailsExists(newConnectionDetails, storagePoolId); if (!duplicateConnectionId.equalsIgnoreCase(newConnectionDetails.getId())) { String storageDomainName = getStorageNameByConnectionId(duplicateConnectionId); addValidationMessageVariable("connectionId", duplicateConnectionId); addValidationMessageVariable("storageDomainName", storageDomainName); return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS); } if (doDomainsUseConnection(newConnectionDetails) || doLunsUseConnection()) { if (storageType.isFileDomain() && domains.size() > 1) { String domainNames = createDomainNamesList(domains); addValidationMessageVariable("domainNames", domainNames); return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS); } if (!isConnectionEditable(newConnectionDetails)) { return false; } } return super.validate(); }