private CustomizationIdentification getCustomizationIdentification(GuestInputs guestInputs) { CustomizationIdentification identification = new CustomizationIdentification(); if (StringUtils.isNotBlank(guestInputs.getDomain()) && StringUtils.isNotBlank(guestInputs.getWorkgroup())) { throw new RuntimeException(ErrorMessages.DOMAIN_AND_WORKGROUP_BOTH_PRESENT); } if (StringUtils.isNotBlank(guestInputs.getDomain())) { identification.setDomainAdmin(guestInputs.getDomainUsername()); identification.setJoinDomain(guestInputs.getDomain()); CustomizationPassword customPassword = getCustomizationPassword(guestInputs.getDomainPassword()); identification.setDomainAdminPassword(customPassword); } else { identification.setJoinWorkgroup(guestInputs.getWorkgroup()); } return identification; }
private CustomizationGuiUnattended getGuiUnattended(GuestInputs guestInputs) { CustomizationGuiUnattended guiUnattended = new CustomizationGuiUnattended(); guiUnattended.setAutoLogon(guestInputs.isAutoLogon()); guiUnattended.setAutoLogonCount(guestInputs.getAutoLogonCount()); guiUnattended.setTimeZone(guestInputs.getTimeZone()); CustomizationPassword password = getCustomizationPassword(guestInputs.getComputerPassword()); guiUnattended.setPassword(password); return guiUnattended; }
private CustomizationPassword getCustomizationPassword(String value) { CustomizationPassword password = new CustomizationPassword(); if (StringUtils.isNotBlank(value)) { password.setPlainText(true); password.setValue(value); } else { password.setValue(null); } return password; }