Awake SQL v1.2.1

org.awakefw.commons.api.server.util
Class ServerInfo

java.lang.Object
  extended by org.awakefw.commons.api.server.util.ServerInfo

public class ServerInfo
extends Object

Gets some server info, including info extracted from HttpServletRequest at server startup. Includes:


Method Summary
static String getHostname()
          Returns the computer name (Hostname).
static String getIpAddress()
          Returns the computer IP address in 192.168.1.146 format.
static String getMacAddress()
          Returns the computer MAC address in 5C-26-0A-88-4E-DA format.
static String getScheme()
          Returns the name of the scheme used to make this request, for example, http, https, or ftp.
static String getServerName()
          Returns the host name of the server to which the request was sent.
static int getServerPort()
          Returns the port number to which the request was sent.
static String getServerUrl()
          Server URL (without the port) in http(s)://www.acme.org format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHostname

public static String getHostname()
Returns the computer name (Hostname).

Returns:
the name or unknown_hostname if the name cannot be found

getIpAddress

public static String getIpAddress()
Returns the computer IP address in 192.168.1.146 format.

Returns:
the name or unknown_ip_address if the MAC address cannot be found

getMacAddress

public static String getMacAddress()
Returns the computer MAC address in 5C-26-0A-88-4E-DA format.

Returns:
the name or unknown_mac_address if the MAC address cannot be found

getScheme

public static String getScheme()
Returns the name of the scheme used to make this request, for example, http, https, or ftp. Different schemes have different rules for constructing URLs, as noted in RFC 1738.

Info extracted from HttpServletRequest at server startup.

Returns:
a String containing the name of the scheme used to make this request

getServerName

public static String getServerName()
Returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.

Info extracted from HttpServletRequest at server startup.

Returns:
a String containing the name of the server

getServerPort

public static int getServerPort()
Returns the port number to which the request was sent. It is the value of the part after ":" in the Host header value, if any, or the server port where the client connection was accepted on.

Info extracted from HttpServletRequest at server startup.

Returns:
an integer specifying the port number

getServerUrl

public static String getServerUrl()
Server URL (without the port) in http(s)://www.acme.org format.

Info extracted from HttpServletRequest at server startup.

Returns:
Server URL (without the port)

Awake SQL v1.2.1

Awake SQL - Virtual JDBC Driver over HTTP for Android, Swing and JavaFX
Android & Desktop Edition allow easy access to majors remote SQL databases with regular JDBC calls:
DB2 - H2 - HSQLDB (HyperSQL) - Informix - Ingres - MySQL - Oracle - PostgreSQL - SQL Server - Sybase - Teradata
Copyright © 2012 Kawan Softwares SAS