if (getPlacement() != null) sb.append("Placement: ").append(getPlacement()).append(","); if (getPlatform() != null) sb.append("Platform: ").append(getPlatform()).append(","); if (getPrivateDnsName() != null) sb.append("PrivateDnsName: ").append(getPrivateDnsName()).append(",");
hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode()); hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName().hashCode()); hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode());
if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false) return false; if (other.getPlatform() == null ^ this.getPlatform() == null) return false; if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false) return false; if (other.getPrivateDnsName() == null ^ this.getPrivateDnsName() == null)
if (getKernelId() != null) sb.append("KernelId: " + getKernelId() + ","); if (getRamdiskId() != null) sb.append("RamdiskId: " + getRamdiskId() + ","); if (getPlatform() != null) sb.append("Platform: " + getPlatform() + ","); if (getMonitoring() != null) sb.append("Monitoring: " + getMonitoring() + ","); if (getSubnetId() != null) sb.append("SubnetId: " + getSubnetId() + ",");
hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode()); hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
if (other.getRamdiskId() == null ^ this.getRamdiskId() == null) return false; if (other.getRamdiskId() != null && other.getRamdiskId().equals(this.getRamdiskId()) == false) return false; if (other.getPlatform() == null ^ this.getPlatform() == null) return false; if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false) return false; if (other.getMonitoring() == null ^ this.getMonitoring() == null) return false; if (other.getMonitoring() != null && other.getMonitoring().equals(this.getMonitoring()) == false) return false;
/** * Generates a ssh login command for *nix to access the given ec2 instance. * * @param instance the ec2 instance * @return ssh login command. */ private String getLoginCommand(Instance instance) { final String privateIpAddress = instance.getPrivateIpAddress(); String publicAddress = instance.getPublicDnsName(); publicAddress = publicAddress == null ? instance.getPublicIpAddress() : publicAddress; final String keyName = instance.getKeyName(); String instanceName = instance.getTags().stream() .filter(t -> t.getKey().equals("Name")) .map(com.amazonaws.services.ec2.model.Tag::getValue) .findAny().orElse(""); instanceName = instanceName.isEmpty() ? "" : "# name: " + instanceName; String platform = instance.getPlatform(); platform = platform == null || platform.isEmpty() ? "" : "# platform: " + platform; String ip; if (publicAddress != null && !publicAddress.isEmpty()) { ip = publicAddress; } else { ip = privateIpAddress; } //root user is assumed. EC2 instances print the actual user name when tried to log-in as the root user. return "ssh -i " + keyName + " root@" + ip + "; " + instanceName + platform; }
if (getPlacement() != null) sb.append("Placement: ").append(getPlacement()).append(","); if (getPlatform() != null) sb.append("Platform: ").append(getPlatform()).append(","); if (getPrivateDnsName() != null) sb.append("PrivateDnsName: ").append(getPrivateDnsName()).append(",");
hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode()); hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName().hashCode()); hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode());
this.tenancy = instance.getPlacement().getTenancy(); this.vpc = instance.getVpcId(); this.platform = instance.getPlatform(); this.kernel = instance.getKernelId(); this.key = instance.getKeyName();
if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false) return false; if (other.getPlatform() == null ^ this.getPlatform() == null) return false; if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false) return false; if (other.getPrivateDnsName() == null ^ this.getPrivateDnsName() == null)