com.arsdigita.util.servlet
Class HttpHost

java.lang.Object
  extended bycom.arsdigita.util.servlet.HttpHost

public class HttpHost
extends Object

Represents a host computer. The host may in fact be a "virtual" host, one of several on the same physical machine.

Version:
$Id: //core-platform/dev/src/com/arsdigita/util/servlet/HttpHost.java#4 $
Author:
Dan Berrange, Justin Ross <jross@redhat.com>

Field Summary
static String versionId
           
 
Constructor Summary
HttpHost(javax.servlet.http.HttpServletRequest sreq)
          Constructs a host representing the host-specific part of sreq.
HttpHost(String name, int port)
          Constructs a new host named name and on port port.
 
Method Summary
 String getName()
          Gets the host name.
 int getPort()
          Gets the port of this host.
 String toString()
          Returns a String representation of this host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

HttpHost

public HttpHost(String name,
                int port)
Constructs a new host named name and on port port.

Parameters:
name - A String host name, for example "ccm.redhat.com"; see ServletRequest.getServerName(); it cannot be null
port - An int port number; 8080, for instance; see ServletRequest.getServerPort(); it must be greater than 0

HttpHost

public HttpHost(javax.servlet.http.HttpServletRequest sreq)
Constructs a host representing the host-specific part of sreq.

Parameters:
sreq - An HttpServletRequest representation of a request; it cannot be null
Method Detail

getName

public final String getName()
Gets the host name.

Returns:
A String naming the host; it cannot be null

getPort

public final int getPort()
Gets the port of this host.

Returns:
A int port number

toString

public String toString()
Returns a String representation of this host.

Returns:
getName() + ":" + getPort() or simply getName() if the port is 80


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC