org.lastbamboo.common.amazon.ec2
Class AmazonEc2Utils

java.lang.Object
  extended by org.lastbamboo.common.amazon.ec2.AmazonEc2Utils

public class AmazonEc2Utils
extends Object

Utility methods for Amazon EC2.


Method Summary
static InetAddress getPublicAddress()
          Accesses the public address for the EC2 instance.
static boolean onEc2()
          Returns whether or not we're running on EC2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPublicAddress

public static InetAddress getPublicAddress()
Accesses the public address for the EC2 instance. This is necessary because InetAddress.getLocalHost() will yield the private, NATted address.

Returns:
The public address for the EC2 instance, or null if there's an error accessing the address.

onEc2

public static boolean onEc2()
Returns whether or not we're running on EC2.

Returns:
true if we're running on EC2, otherwise false.


Copyright © 2013 LittleShoot. All Rights Reserved.