com.norbl.cbp.ppe.usermonitor
Class MonitorHostname

java.lang.Object
  extended by com.norbl.cbp.ppe.usermonitor.MonitorHostname

public class MonitorHostname
extends java.lang.Object

Static methods for getting and setting the UserMonitor host name. There should always be one (and only one) instance of the UserMonitor running.


Constructor Summary
MonitorHostname()
           
 
Method Summary
static java.lang.String getHostNameFromS3()
          This method creates its own S3Access object.
static java.lang.String getThisHostsPublicName()
          Gets the public dns of this system, iff it is a ec2 instance.
static void setHostNameOnS3(S3Access s3Access, java.lang.String hostname)
          Sets the public s3 host name object to specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitorHostname

public MonitorHostname()
Method Detail

getThisHostsPublicName

public static java.lang.String getThisHostsPublicName()
                                               throws java.io.IOException
Gets the public dns of this system, iff it is a ec2 instance.

Returns:
public dns or null if the dns cannot be obtained.
Throws:
java.io.IOException

setHostNameOnS3

public static void setHostNameOnS3(S3Access s3Access,
                                   java.lang.String hostname)
Sets the public s3 host name object to specified string.

Parameters:
s3Access -
hostname -

getHostNameFromS3

public static java.lang.String getHostNameFromS3()
This method creates its own S3Access object. The object is publicly readable so no IDs are required.

Returns:
the host name or null if the request fails.