@Override protected void doValidation() { super.doValidation(); if (dbHost.isEmpty()) { addErrorMessage("arrival.admin.configuration.error.dbhost"); return; } if (dbPort.isEmpty()) { addErrorMessage("arrival.admin.configuration.error.dbport"); return; } else { try { Integer.parseInt(dbPort); } catch (NumberFormatException nex) { addErrorMessage("arrival.admin.configuration.error.dbport"); return; } } if (database.isEmpty()) { addErrorMessage("arrival.admin.configuration.error.dbname"); return; } if (username.isEmpty()) { addErrorMessage("arrival.admin.configuration.error.dbusername"); return; } if (password.isEmpty()) { addErrorMessage("arrival.admin.configuration.error.dbpassword"); return; } if (!RegistratorSQL.isDriverInitialized()) { addErrorMessage("arrival.admin.configuration.error.jdbcdriver"); return; } RegistratorSQL.initDataSource(dbHost, dbPort, database, username, password); }
public void doValidation() { super.doValidation(); // Common validation for both add/remove if (selectedGroupsStr == null || selectedGroupsStr.length == 0) { addErrorMessage(getText("admin.bulkeditgroups.error.no.group.selected")); return; } // Perform the add specific validation if (TextUtils.stringSet(assign)) { if (getUsersToAssign() == null || getUsersToAssign().isEmpty()) { addErrorMessage(getText("admin.bulkeditgroups.error.no.users.to.add")); return; } GroupService.BulkEditGroupValidationResult bulkEditGroupValidationResult = groupService.validateAddUsersToGroup( getJiraServiceContext(), Arrays.asList(selectedGroupsStr), getUsersToAssign()); if (!bulkEditGroupValidationResult.isSuccess()) { Collection<String> validUsers = new HashSet<String>(getUsersToAssign()); validUsers.removeAll(bulkEditGroupValidationResult.getInvalidChildren()); prunedUsersToAssign = validUsers; } } // Perform the remove specific validation else if (TextUtils.stringSet(unassign)) { if (usersToUnassign == null || usersToUnassign.length <= 0) { addErrorMessage(getText("admin.bulkeditgroups.error.no.users.to.remove")); return; } groupService.validateRemoveUsersFromGroups( getJiraServiceContext(), getGroupRemoveUserMapper()); } }