spring-mobile-device

org.springframework.mobile.device.switcher
Class AbstractSiteUrlFactory

java.lang.Object
  extended by org.springframework.mobile.device.switcher.AbstractSiteUrlFactory
All Implemented Interfaces:
SiteUrlFactory
Direct Known Subclasses:
AbstractSitePathUrlFactory, StandardSiteUrlFactory

public abstract class AbstractSiteUrlFactory
extends java.lang.Object
implements SiteUrlFactory

Abstract implementation of the SiteUrlFactory interface. Doesn't mandate the strategy for constructing different site URLs; simply implements common functionality.

Author:
Keith Donald, Scott Rossillo, Roy Clarkson

Constructor Summary
AbstractSiteUrlFactory()
           
 
Method Summary
protected  java.lang.String createSiteUrlInternal(javax.servlet.http.HttpServletRequest request, java.lang.String serverName, java.lang.String path)
           
protected  java.lang.String optionalPort(javax.servlet.http.HttpServletRequest request)
          Returns the HTTP port specified on the given request if it's a non-standard port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.mobile.device.switcher.SiteUrlFactory
createSiteUrl, isRequestForSite
 

Constructor Detail

AbstractSiteUrlFactory

public AbstractSiteUrlFactory()
Method Detail

optionalPort

protected java.lang.String optionalPort(javax.servlet.http.HttpServletRequest request)
Returns the HTTP port specified on the given request if it's a non-standard port. The port is considered non-standard if it's not port 80 for insecure request and not port 443 of secure requests.

Parameters:
request - the HttpServletRequest to check for a non-standard port.
Returns:
the HTTP port specified on the given request if it's a non-standard port, null otherwise

createSiteUrlInternal

protected java.lang.String createSiteUrlInternal(javax.servlet.http.HttpServletRequest request,
                                                 java.lang.String serverName,
                                                 java.lang.String path)

spring-mobile-device