public T fromOperatingSystem(OperatingSystem in) { return this .id(in.getId()) .passwords(in.getPasswords()); } }
public T fromOperatingSystem(OperatingSystem in) { return this .id(in.getId()) .passwords(in.getPasswords()); } }
public Builder fromOperatingSystem(OperatingSystem in) { return this.id(in.getId()).passwords(in.getPasswords()); }
public Builder fromOperatingSystem(OperatingSystem in) { return this.id(in.getId()).passwords(in.getPasswords()); }
public Builder fromOperatingSystem(OperatingSystem in) { return this.id(in.getId()).passwords(in.getPasswords()); }
public Builder fromOperatingSystem(OperatingSystem in) { return this.id(in.getId()).passwords(in.getPasswords()); }
@Override public boolean apply(VirtualGuest guest) { checkNotNull(guest, "virtual guest was null"); VirtualGuest newGuest = client.getVirtualGuestClient().getVirtualGuest(guest.getId()); boolean hasBackendIp = newGuest.getPrimaryBackendIpAddress() != null; boolean hasPrimaryIp = newGuest.getPrimaryIpAddress() != null; boolean hasPasswords = newGuest.getOperatingSystem() != null && newGuest.getOperatingSystem().getPasswords().size() > 0; return hasBackendIp && hasPrimaryIp && hasPasswords; } }
@Override public boolean apply(VirtualGuest guest) { checkNotNull(guest, "virtual guest was null"); VirtualGuest newGuest = client.getVirtualGuestApi().getObject(guest.getId()); boolean hasBackendIp = newGuest.getPrimaryBackendIpAddress() != null; boolean hasPrimaryIp = newGuest.getPrimaryIpAddress() != null; boolean hasPasswords = newGuest.getOperatingSystem() != null && newGuest.getOperatingSystem().getPasswords().size() > 0; return hasBackendIp && hasPrimaryIp && hasPasswords; } }
@Override public boolean apply(VirtualGuest guest) { checkNotNull(guest, "virtual guest was null"); VirtualGuest newGuest = client.getVirtualGuestClient().getVirtualGuest(guest.getId()); boolean hasBackendIp = newGuest.getPrimaryBackendIpAddress() != null; boolean hasPrimaryIp = newGuest.getPrimaryIpAddress() != null; boolean hasPasswords = newGuest.getOperatingSystem() != null && newGuest.getOperatingSystem().getPasswords().size() > 0; return hasBackendIp && hasPrimaryIp && hasPasswords; } }
@Override public boolean apply(VirtualGuest guest) { checkNotNull(guest, "virtual guest was null"); VirtualGuest virtualGuest = client.getVirtualGuestApi().getVirtualGuest(guest.getId()); boolean hasBackendIp = virtualGuest.getPrimaryBackendIpAddress() != null; boolean hasPrimaryIp = virtualGuest.getPrimaryIpAddress() != null; boolean hasPasswords = virtualGuest.getOperatingSystem() != null && !virtualGuest.getOperatingSystem().getPasswords().isEmpty(); return virtualGuest.isPrivateNetworkOnly() ? hasBackendIp && hasPasswords : hasBackendIp && hasPrimaryIp && hasPasswords; } }
@Override public boolean apply(VirtualGuest guest) { checkNotNull(guest, "virtual guest was null"); VirtualGuest virtualGuest = client.getVirtualGuestApi().getVirtualGuest(guest.getId()); boolean hasBackendIp = virtualGuest.getPrimaryBackendIpAddress() != null; boolean hasPrimaryIp = virtualGuest.getPrimaryIpAddress() != null; boolean hasPasswords = virtualGuest.getOperatingSystem() != null && !virtualGuest.getOperatingSystem().getPasswords().isEmpty(); return virtualGuest.isPrivateNetworkOnly() ? hasBackendIp && hasPasswords : hasBackendIp && hasPrimaryIp && hasPasswords; } }
@Override public boolean apply(VirtualGuest guest) { checkNotNull(guest, "virtual guest was null"); VirtualGuest virtualGuest = client.getVirtualGuestApi().getVirtualGuest(guest.getId()); boolean hasBackendIp = virtualGuest.getPrimaryBackendIpAddress() != null; boolean hasPrimaryIp = virtualGuest.getPrimaryIpAddress() != null; boolean hasPasswords = virtualGuest.getOperatingSystem() != null && !virtualGuest.getOperatingSystem().getPasswords().isEmpty(); return virtualGuest.isPrivateNetworkOnly() ? hasBackendIp && hasPasswords : hasBackendIp && hasPrimaryIp && hasPasswords; } }
@Override public NodeAndInitialCredentials<VirtualGuest> createNodeWithGroupEncodedIntoName(String group, String name, Template template) { checkNotNull(template, "template was null"); checkNotNull(template.getOptions(), "template options was null"); checkArgument(template.getOptions().getClass().isAssignableFrom(SoftLayerTemplateOptions.class), "options class %s should have been assignable from SoftLayerTemplateOptions", template.getOptions() .getClass()); String domainName = template.getOptions().as(SoftLayerTemplateOptions.class).getDomainName(); VirtualGuest newGuest = VirtualGuest.builder().domain(domainName).hostname(name).build(); ProductOrder order = ProductOrder.builder().packageId(productPackageSupplier.get().getId()) .location(template.getLocation().getId()).quantity(1).useHourlyPricing(true).prices(getPrices(template)) .virtualGuests(newGuest).build(); logger.debug(">> ordering new virtualGuest domain(%s) hostname(%s)", domainName, name); ProductOrderReceipt productOrderReceipt = client.getVirtualGuestClient().orderVirtualGuest(order); VirtualGuest result = get(productOrderReceipt.getOrderDetails().getVirtualGuests(), 0); logger.trace("<< virtualGuest(%s)", result.getId()); logger.debug(">> awaiting login details for virtualGuest(%s)", result.getId()); boolean orderInSystem = loginDetailsTester.apply(result); logger.trace("<< virtualGuest(%s) complete(%s)", result.getId(), orderInSystem); checkState(orderInSystem, "order for guest %s doesn't have login details within %sms", result, Long.toString(guestLoginDelay)); result = client.getVirtualGuestClient().getVirtualGuest(result.getId()); Password pw = get(result.getOperatingSystem().getPasswords(), 0); return new NodeAndInitialCredentials<VirtualGuest>(result, result.getId() + "", LoginCredentials.builder().user(pw.getUsername()).password( pw.getPassword()).build()); }
@Override public NodeAndInitialCredentials<VirtualGuest> createNodeWithGroupEncodedIntoName(String group, String name, Template template) { checkNotNull(template, "template was null"); checkNotNull(template.getOptions(), "template options was null"); checkArgument(template.getOptions().getClass().isAssignableFrom(SoftLayerTemplateOptions.class), "options class %s should have been assignable from SoftLayerTemplateOptions", template.getOptions() .getClass()); String domainName = template.getOptions().as(SoftLayerTemplateOptions.class).getDomainName(); VirtualGuest newGuest = VirtualGuest.builder().domain(domainName).hostname(name).build(); ProductOrder order = ProductOrder.builder().packageId(productPackageSupplier.get().getId()) .location(template.getLocation().getId()).quantity(1).useHourlyPricing(true).prices(getPrices(template)) .virtualGuests(newGuest).build(); logger.debug(">> ordering new virtualGuest domain(%s) hostname(%s)", domainName, name); ProductOrderReceipt productOrderReceipt = client.getVirtualGuestClient().orderVirtualGuest(order); VirtualGuest result = get(productOrderReceipt.getOrderDetails().getVirtualGuests(), 0); logger.trace("<< virtualGuest(%s)", result.getId()); logger.debug(">> awaiting login details for virtualGuest(%s)", result.getId()); boolean orderInSystem = loginDetailsTester.apply(result); logger.trace("<< virtualGuest(%s) complete(%s)", result.getId(), orderInSystem); checkState(orderInSystem, "order for guest %s doesn't have login details within %sms", result, Long.toString(guestLoginDelay)); result = client.getVirtualGuestClient().getVirtualGuest(result.getId()); Password pw = get(result.getOperatingSystem().getPasswords(), 0); return new NodeAndInitialCredentials<VirtualGuest>(result, result.getId() + "", LoginCredentials.builder().user(pw.getUsername()).password( pw.getPassword()).build()); }
builder.privateAddresses(ImmutableSet.of(from.getPrimaryBackendIpAddress())); if (from.getOperatingSystem() != null && from.getOperatingSystem().getPasswords() != null && !from.getOperatingSystem().getPasswords().isEmpty()) { Password password = getBestPassword(from.getOperatingSystem().getPasswords(), from); builder.credentials(LoginCredentials.builder().identity(password.getUsername()).credential(password.getPassword()).build());
builder.privateAddresses(ImmutableSet.of(from.getPrimaryBackendIpAddress())); if (from.getOperatingSystem() != null && from.getOperatingSystem().getPasswords() != null && !from.getOperatingSystem().getPasswords().isEmpty()) { Password password = getBestPassword(from.getOperatingSystem().getPasswords(), from); builder.credentials(LoginCredentials.builder().identity(password.getUsername()).credential(password.getPassword()).build());
builder.privateAddresses(ImmutableSet.of(from.getPrimaryBackendIpAddress())); if (from.getOperatingSystem() != null && from.getOperatingSystem().getPasswords() != null && !from.getOperatingSystem().getPasswords().isEmpty()) { Password password = getBestPassword(from.getOperatingSystem().getPasswords(), from); builder.credentials(LoginCredentials.builder().identity(password.getUsername()).credential(password.getPassword()).build());
Password pw = get(result.getOperatingSystem().getPasswords(), 0); return new NodeAndInitialCredentials<VirtualGuest>(result, result.getId() + "", LoginCredentials.builder().user(pw.getUsername()).password( pw.getPassword()).build());
Password pwd = get(result.getOperatingSystem().getPasswords(), 0); return new NodeAndInitialCredentials<VirtualGuest>(result, result.getId() + "", LoginCredentials.builder().user(pwd.getUsername()).password(pwd.getPassword()).build());
Password pwd = get(result.getOperatingSystem().getPasswords(), 0); return new NodeAndInitialCredentials<VirtualGuest>(result, result.getId() + "", LoginCredentials.builder().user(pwd.getUsername()).password(pwd.getPassword()).build());