Java 类com.vmware.vim25.CustomizationIdentification 实例源码

项目:cs-actions    文件:GuestConfigSpecs.java   
private CustomizationSysprep getPopulatedCustomizationSysprep(GuestInputs guestInputs) {
    CustomizationSysprep customizationSysprep = new CustomizationSysprep();

    CustomizationGuiUnattended guiUnattended = getGuiUnattended(guestInputs);
    customizationSysprep.setGuiUnattended(guiUnattended);

    CustomizationIdentification identification = getCustomizationIdentification(guestInputs);
    customizationSysprep.setIdentification(identification);

    if (StringUtils.isNotBlank(guestInputs.getLicenseDataMode())) {
        CustomizationLicenseFilePrintData licenseFilePrintData = getCustomizationLicenseFilePrintData(guestInputs);
        customizationSysprep.setLicenseFilePrintData(licenseFilePrintData);
    }

    return customizationSysprep;
}
项目:cs-actions    文件:GuestConfigSpecs.java   
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;
}