com.ibm.wbi.protocol.http.beans
Class PageMovedGenerator

com.ibm.wbi.Meg
  |
  +--com.ibm.wbi.Generator
        |
        +--com.ibm.wbi.protocol.http.HttpGenerator
              |
              +--com.ibm.wbi.protocol.http.beans.FourStepHttpGenerator
                    |
                    +--com.ibm.wbi.protocol.http.beans.PageMovedGenerator

public class PageMovedGenerator
extends FourStepHttpGenerator

A Generator that produces an HTTP response directing the browser to load the document at a different URL. The new URL will appear in the user interface as well.

There are two properties that can be set: DestinationURL and Type. The DestinationURL indicates the URL that the browser should be directed to. The Type indicates whether the redirection should be considered temporary or permanent.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information
static int PERMANENT
          Permanent page type.
static int TEMPORARY
          Temporary page type.
 
Fields inherited from class com.ibm.wbi.protocol.http.HttpGenerator
http
 
Fields inherited from class com.ibm.wbi.Meg
EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED
 
Constructor Summary
PageMovedGenerator()
          The default constructor.
PageMovedGenerator(java.lang.String url)
          Construct an instance with the given DestinationURL and of TEMPORARY type.
PageMovedGenerator(java.lang.String url, int t)
          Construct an instance with the given DestinationURL and Type.
 
Method Summary
 java.lang.String getDestinationUrl()
          Access the DestinationUrl property.
protected  java.lang.String getHeader(RequestEvent e)
          Get the header.
 int getRedirectType()
          Access the Type property.
 void setDestinationUrl(java.lang.String url)
          Set the DestinationUrl property.
 void setRedirectType(int t)
          Set the Type property.
 
Methods inherited from class com.ibm.wbi.protocol.http.beans.FourStepHttpGenerator
handleRequest, initialize, verify, writeContent
 
Methods inherited from class com.ibm.wbi.protocol.http.HttpGenerator
add, addCookie, getContentType, getHttpResponse, getHttpResponseString, getResponseCode, getResponseText, isCache, produceHeader, set, setCache, setContentLength, setContentType, setResponseCode, setResponseText, setServer, writeHeader
 
Methods inherited from class com.ibm.wbi.Generator
getType
 
Methods inherited from class com.ibm.wbi.Meg
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information

TEMPORARY

public static final int TEMPORARY
Temporary page type.

PERMANENT

public static final int PERMANENT
Permanent page type.
Constructor Detail

PageMovedGenerator

public PageMovedGenerator()
The default constructor. The DestinationURL defaults to null and the Type defaults to TEMPORARY.

PageMovedGenerator

public PageMovedGenerator(java.lang.String url)
Construct an instance with the given DestinationURL and of TEMPORARY type.
Parameters:
url - The URL to which the browser should be redirected.

PageMovedGenerator

public PageMovedGenerator(java.lang.String url,
                          int t)
Construct an instance with the given DestinationURL and Type.
Parameters:
url - The URL to which the browser should be redirected
t - The type of redirection, either TEMPORARY or PERMANENT.
Method Detail

setDestinationUrl

public void setDestinationUrl(java.lang.String url)
Set the DestinationUrl property.
Parameters:
url - The URL to which the browser should be redirected.

setRedirectType

public void setRedirectType(int t)
Set the Type property.
Parameters:
t - The type of redirection, either TEMPORARY or PERMANENT.

getDestinationUrl

public java.lang.String getDestinationUrl()
Access the DestinationUrl property.
Returns:
The DestinationURL.

getRedirectType

public int getRedirectType()
Access the Type property.
Returns:
Either TEMPORARY or PERMANENT.

getHeader

protected java.lang.String getHeader(RequestEvent e)
Get the header.
Overrides:
getHeader in class FourStepHttpGenerator
Parameters:
e - The request event.
Returns:
The header.