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

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