org.niocchi.rc
Class HostRedirectionController

java.lang.Object
  extended by org.niocchi.rc.HostRedirectionController
All Implemented Interfaces:
RedirectionController

public class HostRedirectionController
extends java.lang.Object
implements RedirectionController

A simple controller that implements basic host name filter strategy You can select if you want to consider equals host the url that starts with "www" or not.
Default max redirections per Query = 6.


Field Summary
static Log logRedirections
           
static int MAX_REDIRECTION_DEFAULT
           
 
Constructor Summary
HostRedirectionController()
           
 
Method Summary
 int getMaxRedirections()
           
 boolean isAllowed(Query query, java.net.URL redirection)
           
 boolean isRemoveWWW()
           
static java.lang.String removeWWW(java.lang.String hostName)
           
 void setMaxRedirections(int maxRedirections)
          Sets the maximun redirection allowed.
 void setRemoveWWW(boolean removeWWW)
          By default, 'www' are removed from host names before comparison.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logRedirections

public static Log logRedirections

MAX_REDIRECTION_DEFAULT

public static final int MAX_REDIRECTION_DEFAULT
See Also:
Constant Field Values
Constructor Detail

HostRedirectionController

public HostRedirectionController()
Method Detail

isAllowed

public boolean isAllowed(Query query,
                         java.net.URL redirection)
Specified by:
isAllowed in interface RedirectionController

removeWWW

public static java.lang.String removeWWW(java.lang.String hostName)

setRemoveWWW

public void setRemoveWWW(boolean removeWWW)
By default, 'www' are removed from host names before comparison. So www.example.com redirections to example.com (and vice versa) will be accepted. Set it to false to change this behavior.

Parameters:
removeWWW -

isRemoveWWW

public boolean isRemoveWWW()

setMaxRedirections

public void setMaxRedirections(int maxRedirections)
Sets the maximun redirection allowed. By default this value is MAX_REDIRECTION_DEFAULT

Parameters:
maxRedirections -

getMaxRedirections

public int getMaxRedirections()