Class ServerData


  • public class ServerData
    extends Object
    Holds basic server information under which Turbine is running. This class is accessable via the RunData object within the Turbine system. You can also use it as a placeholder for this information if you are only emulating a servlet system.
    Version:
    $Id$
    Author:
    Kevin A. Burton, Jon S. Stevens, Henning P. Schmiedehausen
    • Constructor Detail

      • ServerData

        public ServerData​(String serverName,
                          int serverPort,
                          String serverScheme,
                          String scriptName,
                          String contextPath)
        Constructor.
        Parameters:
        serverName - The server name.
        serverPort - The server port.
        serverScheme - The server scheme.
        scriptName - The script name.
        contextPath - The context Path
      • ServerData

        public ServerData​(ServerData serverData)
        Copy-Constructor
        Parameters:
        serverData - A ServerData Object
      • ServerData

        public ServerData​(HttpServletRequest req)
        A C'tor that takes a HTTP Request object and builds the server data from its contents
        Parameters:
        req - The HTTP Request
    • Method Detail

      • clone

        public Object clone()
        generates a new Object with the same values as this one.
        Overrides:
        clone in class Object
        Returns:
        A cloned object.
      • setServerName

        public void setServerName​(String serverName)
        Sets the cached serverName.
        Parameters:
        serverName - the server name.
      • getServerPort

        public int getServerPort()
        Get the server port.
        Returns:
        the server port.
      • setServerPort

        public void setServerPort​(int serverPort)
        Sets the cached serverPort.
        Parameters:
        serverPort - the server port.
      • setServerScheme

        public void setServerScheme​(String serverScheme)
        Sets the cached serverScheme.
        Parameters:
        serverScheme - the server scheme.
      • setScriptName

        public void setScriptName​(String scriptName)
        Set the script name.
        Parameters:
        scriptName - the script name.
      • setContextPath

        public void setContextPath​(String contextPath)
        Set the context path.
        Parameters:
        contextPath - A String.
      • getHostUrl

        public void getHostUrl​(StringBuilder url)
        Appends the Host URL to the supplied StringBuilder.
        Parameters:
        url - A StringBuilder object
      • toString

        public String toString()
        Returns this object as an URL.
        Overrides:
        toString in class Object
        Returns:
        The contents of this object as a String