org.opensha.commons.util
Enum ServerPrefs

java.lang.Object
  extended by java.lang.Enum<ServerPrefs>
      extended by org.opensha.commons.util.ServerPrefs
All Implemented Interfaces:
Serializable, Comparable<ServerPrefs>

public enum ServerPrefs
extends Enum<ServerPrefs>

This enum stores preferences for servers that OpenSHA connects to. This includes hostnames for servers such as apache tomcat, port numbers for RMI, and the current build type. To get the server prefs instance in use by this build, use ServerPrefUtils.SERVER_PREFS.

Author:
kevin
See Also:
ServerPrefUtils

Enum Constant Summary
DEV_PREFS
          Preferences for development (trunk)
PRODUCTION_PREFS
          Preferences for stable production releases
 
Method Summary
static ServerPrefs fromBuildType(String buildType)
          Returns the server type with the given build type string
 DevStatus getBuildType()
          String designating the build type, such as "nightly" or "dist".
 String getHostName()
          The host name of the server being used, such as "opensha.usc.edu"
 String getServletBaseURL()
          The the base URL for servlets, for example: http://opensha.usc.edu:8080/OpenSHA/
 String getTomcatDir()
           
static ServerPrefs valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ServerPrefs[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEV_PREFS

public static final ServerPrefs DEV_PREFS
Preferences for development (trunk)


PRODUCTION_PREFS

public static final ServerPrefs PRODUCTION_PREFS
Preferences for stable production releases

Method Detail

values

public static ServerPrefs[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ServerPrefs c : ServerPrefs.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ServerPrefs valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getServletBaseURL

public String getServletBaseURL()
The the base URL for servlets, for example: http://opensha.usc.edu:8080/OpenSHA/

Returns:
servlet base URL

getTomcatDir

public String getTomcatDir()
Returns:
path to the WEB-INF dir for this tomcat configuration

getBuildType

public DevStatus getBuildType()
String designating the build type, such as "nightly" or "dist".

Returns:
build type string

getHostName

public String getHostName()
The host name of the server being used, such as "opensha.usc.edu"

Returns:
server host hame

fromBuildType

public static ServerPrefs fromBuildType(String buildType)
Returns the server type with the given build type string

Parameters:
buildType -
Returns: