public class

ResourceFeedController

extends AppControllerImpl
java.lang.Object
   ↳ com.microstrategy.web.controller.AppControllerImpl
     ↳ com.microstrategy.web.controller.ResourceFeedController

Class Overview

Controller for the ResourceFeed servlet

Summary

Constants
String INIT_PARAM_CONFIG_FILE The path the the configuration file
String INIT_PARAM_DEFAULT_USER_AGENT This is the name of the init parameter that will use the value of this parameter to set the User-Agent header if the caller is not a browser
String INIT_PARAM_PROXY_PORT This is the name of the init parameter that refers to the HTTP proxy port
String INIT_PARAM_PROXY_URL This is the name of the init parameter that refers to the HTTP proxy URL
String PARAM_TRANSFER_AUTH_HEADER This is the name of the init parameter that indicates if the Authorization header is transferred.
String SET_STATUS_CODE_FROM_RESPONSE This is to set the status code from the requested URL if the parameter value is set to true.
Public Constructors
ResourceFeedController()
Public Methods
void errorAfterRedirect(RequestState reqState, Exception e)
What to do if there is an error after we have redirected to the target page.
String extractDomainName(String url)
Extracts the domain part of a URL
String getBaseURL(ContainerServices cs)
The Base URL for this application.
String getPage(RequestState reqState)
Get the relative path to the Page that should be displayed.
void initializeApp(ContainerServices cs)
Initialize the application.
ExternalSecurity newExternalSecurity()
Creates a new ExternalSecurity object.
RequestState newRequestState()
Get a new RequestState object to handle the incoming request.
boolean processRequest(RequestState reqState)
Process the incoming request.
void terminateApp()
Terminate the application.
Protected Methods
boolean contentTypeMatch(String contentType, String contentTypeExpression)
Whether a content type is allowed

A content type is allowed if

      the expression equals '*'; or
      the content type contains the expression
boolean domainMatch(String host, String domainExpression)
Performs domain-match.
boolean isValidContentType(String contentType)
Determines whether a content type is valid based on the allowed content types on the security policy file
boolean isValidProtocol(String protocol)
Determines whether a protocol is valid.
boolean isValidUrl(String url)
Determines whether a URL is valid based on the domains on the security policy file
void setProxySettings()
Set the proxy settings based on the config parameters INIT_PARAM_PROXY_URL and INIT_PARAM_PROXY_PORT
boolean skipHeader(String key)
[Expand]
Inherited Methods
From class com.microstrategy.web.controller.AppControllerImpl
From class java.lang.Object
From interface com.microstrategy.web.controller.AppController

Constants

public static final String INIT_PARAM_CONFIG_FILE

The path the the configuration file

Constant Value: "configFile"

public static final String INIT_PARAM_DEFAULT_USER_AGENT

This is the name of the init parameter that will use the value of this parameter to set the User-Agent header if the caller is not a browser

Constant Value: "Default-User-Agent"

public static final String INIT_PARAM_PROXY_PORT

This is the name of the init parameter that refers to the HTTP proxy port

Constant Value: "ProxyPort"

public static final String INIT_PARAM_PROXY_URL

This is the name of the init parameter that refers to the HTTP proxy URL

Constant Value: "ProxyURL"

public static final String PARAM_TRANSFER_AUTH_HEADER

This is the name of the init parameter that indicates if the Authorization header is transferred.

Constant Value: "transferAuthHeader"

public static final String SET_STATUS_CODE_FROM_RESPONSE

This is to set the status code from the requested URL if the parameter value is set to true.

Constant Value: "set-status-code-from-response"

Public Constructors

public ResourceFeedController ()

Public Methods

public void errorAfterRedirect (RequestState reqState, Exception e)

What to do if there is an error after we have redirected to the target page.

Parameters
reqState The RequestState object that holds per-request data.
e The Exception was raised.

public String extractDomainName (String url)

Extracts the domain part of a URL

Parameters
url the URL
Returns
  • the domain part of a URL

public String getBaseURL (ContainerServices cs)

The Base URL for this application.

Parameters
cs The ContainerServices object that exposes a variety of services.
Returns
  • The base URL for this application.

public String getPage (RequestState reqState)

Get the relative path to the Page that should be displayed.

Parameters
reqState The RequestState object that contains per-request data structures.
Returns
  • The path to the Page to internally redirect to.

public void initializeApp (ContainerServices cs)

Initialize the application.

Parameters
cs The ContainerServices object to use to complete the initialization.

public ExternalSecurity newExternalSecurity ()

Creates a new ExternalSecurity object.

Returns

public RequestState newRequestState ()

Get a new RequestState object to handle the incoming request.

Returns

public boolean processRequest (RequestState reqState)

Process the incoming request.

Parameters
reqState The RequestState object that holds per-request data.
Returns
  • True, if the request was handled; otherwise, false.

public void terminateApp ()

Terminate the application.

Protected Methods

protected boolean contentTypeMatch (String contentType, String contentTypeExpression)

Whether a content type is allowed

A content type is allowed if

      the expression equals '*'; or
      the content type contains the expression

Parameters
contentType the content typre returned by the request
contentTypeExpression the expression read form the security policy file
Returns
  • Whether a content type is allowed

protected boolean domainMatch (String host, String domainExpression)

Performs domain-match.

Host A's name domain-matches host B's if their host name strings string-compare equal

Parameters
host host name where request is being sent to.
domainExpression The domain expression read for the policy file
Returns
  • true if the specified host matches the given domainExpression.

protected boolean isValidContentType (String contentType)

Determines whether a content type is valid based on the allowed content types on the security policy file

Parameters
contentType the content type to evaluate
Returns
  • whether a contentType is valid

protected boolean isValidProtocol (String protocol)

Determines whether a protocol is valid. Default implementation only allows http and https requests.

Parameters
protocol the protocol to evaluate
Returns
  • whether a URL is valid

protected boolean isValidUrl (String url)

Determines whether a URL is valid based on the domains on the security policy file

Parameters
url the URL to evaluate
Returns
  • whether a URL is valid

protected void setProxySettings ()

Set the proxy settings based on the config parameters INIT_PARAM_PROXY_URL and INIT_PARAM_PROXY_PORT

protected boolean skipHeader (String key)