info.magnolia.cms.beans.config
Class DefaultVirtualURIMapping

java.lang.Object
  extended by info.magnolia.cms.beans.config.DefaultVirtualURIMapping
All Implemented Interfaces:
VirtualURIMapping
Direct Known Subclasses:
HostBasedVirtualURIMapping, RegexpVirtualURIMapping

public class DefaultVirtualURIMapping
extends Object
implements VirtualURIMapping

A simple implementation of VirtualURIMapping based on UrlPattern.


Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.cms.beans.config.VirtualURIMapping
VirtualURIMapping.MappingResult
 
Field Summary
protected  String fromURI
           
protected  UrlPattern pattern
           
protected  String toURI
           
 
Constructor Summary
DefaultVirtualURIMapping()
           
 
Method Summary
 String getFromURI()
           
 String getToURI()
           
 VirtualURIMapping.MappingResult mapURI(String uri)
          Maps an incoming URI to a new target URI.
 void setFromURI(String fromURI)
           
 void setToURI(String toURI)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fromURI

protected String fromURI

toURI

protected String toURI

pattern

protected UrlPattern pattern
Constructor Detail

DefaultVirtualURIMapping

public DefaultVirtualURIMapping()
Method Detail

mapURI

public VirtualURIMapping.MappingResult mapURI(String uri)
Description copied from interface: VirtualURIMapping
Maps an incoming URI to a new target URI. Returns a VirtualURIMapping.MappingResult describing the new URI and the level of match. The new URI can be prefixed with "redirect:", "permanent:" or "forward:" to trigger either a temporary redirect, a permanent redirect or a forward respectively. For redirects the URI can be absolute or relative within the web application (the context path is added automatically). If the mapping does not apply to the input URI this method returns null.

Specified by:
mapURI in interface VirtualURIMapping
Parameters:
uri - the URI of the current request, decoded and without the context path
Returns:
a VirtualURIMapping.MappingResult with the target URI and level or null if the mapping doesn't apply

getFromURI

public String getFromURI()

setFromURI

public void setFromURI(String fromURI)

getToURI

public String getToURI()

setToURI

public void setToURI(String toURI)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.