org.hd.d.pg2k.webSvr.virtualHosts
Class VirtualHosts

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.virtualHosts.VirtualHosts

public final class VirtualHosts
extends java.lang.Object

Contains details of the virtual hosts supported. This also contains the current canonical list of skin names.


Nested Class Summary
static class VirtualHosts.VirtualHost
          Details of one virtual host.
 
Field Summary
static java.util.List<VirtualHosts.VirtualHost> canonicalVirtualHosts
          Public (immutable) List of canonical "main" VirtualHost descriptions.
static java.util.Map<java.lang.String,VirtualHosts.VirtualHost> hostDetails
          Public (immutable) Map from String normalised host name to VirtualHost.
static java.lang.String SKIN_BLACK_MINIMAL
          Skin name for black background, minimalist page style.
static java.lang.String SKIN_MOBI_BASIC
          Skin name for basic .mobi compliant site.
static VirtualHosts.VirtualHost VIRTUAL_HOST_127p0p0p1
          Virtual host description and main name for localhost as literal IPv4 address; primarily for testing.
static VirtualHosts.VirtualHost VIRTUAL_HOST_ALOHAEARTH
          Virtual host description and main name for Aloha Earth.
static VirtualHosts.VirtualHost VIRTUAL_HOST_cc1
          Virtual host description and main name for localhost as literal IPv6 address; primarily for testing.
static VirtualHosts.VirtualHost VIRTUAL_HOST_DEFAULT
          Default virtual host description (ie keyed from main site name) for default livery, etc.
static VirtualHosts.VirtualHost VIRTUAL_HOST_LOCALHOST
          Virtual host description and main name for localhost; primarily for testing.
static VirtualHosts.VirtualHost VIRTUAL_HOST_LONDONPIX
          Virtual host description and main name for LondonPix.
static VirtualHosts.VirtualHost VIRTUAL_HOST_ZAPIX
          Virtual host description and main name for ZAPix.
 
Constructor Summary
VirtualHosts()
           
 
Method Summary
static VirtualHosts.VirtualHost getVirtualHostDetails(java.lang.String serverHostname, java.lang.String requestURI)
          Lookup VirtualHost details by hostname and request URL; null if no match found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKIN_BLACK_MINIMAL

public static final java.lang.String SKIN_BLACK_MINIMAL
Skin name for black background, minimalist page style.

See Also:
Constant Field Values

SKIN_MOBI_BASIC

public static final java.lang.String SKIN_MOBI_BASIC
Skin name for basic .mobi compliant site.

See Also:
Constant Field Values

VIRTUAL_HOST_DEFAULT

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_DEFAULT
Default virtual host description (ie keyed from main site name) for default livery, etc. Default livery has normal navigation, advertising, layout, etc.


VIRTUAL_HOST_ALOHAEARTH

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_ALOHAEARTH
Virtual host description and main name for Aloha Earth. Aloha Earth has a black background and minimalist furniture.


VIRTUAL_HOST_LONDONPIX

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_LONDONPIX
Virtual host description and main name for LondonPix. LondonPix has a black background and minimalist furniture.


VIRTUAL_HOST_ZAPIX

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_ZAPIX
Virtual host description and main name for ZAPix. ZAPix has a black background and minimalist furniture.


VIRTUAL_HOST_LOCALHOST

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_LOCALHOST
Virtual host description and main name for localhost; primarily for testing. Usually standard livery, but need not be so.


VIRTUAL_HOST_127p0p0p1

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_127p0p0p1
Virtual host description and main name for localhost as literal IPv4 address; primarily for testing. Usually standard livery, but need not be so.


VIRTUAL_HOST_cc1

public static final VirtualHosts.VirtualHost VIRTUAL_HOST_cc1
Virtual host description and main name for localhost as literal IPv6 address; primarily for testing. Usually standard livery, but need not be so.


canonicalVirtualHosts

public static final java.util.List<VirtualHosts.VirtualHost> canonicalVirtualHosts
Public (immutable) List of canonical "main" VirtualHost descriptions. In principle all host names or site URIs should map to one of these, and we may even force redirects and so on so that search engines and users learn and use these canonical versions.

This is not intended for fast lookup, and nothing is implied by the order of entries.

This should help:


hostDetails

public static final java.util.Map<java.lang.String,VirtualHosts.VirtualHost> hostDetails
Public (immutable) Map from String normalised host name to VirtualHost. This is built from the main and alias host names.

For the moment this is hard-wired in; it may become loadable in GenProps in future.

Constructor Detail

VirtualHosts

public VirtualHosts()
Method Detail

getVirtualHostDetails

public static VirtualHosts.VirtualHost getVirtualHostDetails(java.lang.String serverHostname,
                                                             java.lang.String requestURI)
Lookup VirtualHost details by hostname and request URL; null if no match found. The hostname supplied is normalised before lookup.

Before a lookup by hostname is attempted, a match is attempted on the request URI iff the URI starts with the normal prefix for virtual sites. If a virtual host root is a prefix of the request URI then we force usage of the the virtual host livery.

Parameters:
serverHostname - the host name with which the page was fetched, as from request.getServerName()
requestURI - the within-host URI as from request.getRequestURI(), or null for a faster lookup just by normalised name

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.