Class ResourceFeedController

  • All Implemented Interfaces:
    AppController

    public class ResourceFeedController
    extends AppControllerImpl
    Controller for the ResourceFeed servlet
    Since:
    MicroStrategy Web 9.0.0
    • Field Detail

      • INIT_PARAM_PROXY_URL

        public static final java.lang.String INIT_PARAM_PROXY_URL
        This is the name of the init parameter that refers to the HTTP proxy URL
        See Also:
        Constant Field Values
      • INIT_PARAM_PROXY_PORT

        public static final java.lang.String INIT_PARAM_PROXY_PORT
        This is the name of the init parameter that refers to the HTTP proxy port
        See Also:
        Constant Field Values
      • INIT_PARAM_DEFAULT_USER_AGENT

        public static final java.lang.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
        See Also:
        Constant Field Values
      • SET_STATUS_CODE_FROM_RESPONSE

        public static final java.lang.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.
        See Also:
        Constant Field Values
      • INIT_PARAM_CONFIG_FILE

        public static final java.lang.String INIT_PARAM_CONFIG_FILE
        The path the the configuration file
        See Also:
        Constant Field Values
      • PARAM_TRANSFER_AUTH_HEADER

        public static final java.lang.String PARAM_TRANSFER_AUTH_HEADER
        This is the name of the init parameter that indicates if the Authorization header is transferred.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceFeedController

        public ResourceFeedController()
    • Method Detail

      • initializeApp

        public void initializeApp​(ContainerServices cs)
        Initialize the application.
        Parameters:
        cs - The ContainerServices object to use to complete the initialization.
      • newRequestState

        public RequestState newRequestState()
        Get a new RequestState object to handle the incoming request.
        Returns:
        A new RequestState object to handle the incoming request.
      • processRequest

        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.
      • skipHeader

        protected boolean skipHeader​(java.lang.String key)
      • isValidProtocol

        protected boolean isValidProtocol​(java.lang.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
      • isValidUrl

        protected boolean isValidUrl​(java.lang.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
      • isValidContentType

        protected boolean isValidContentType​(java.lang.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
      • domainMatch

        protected boolean domainMatch​(java.lang.String host,
                                      java.lang.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.
      • contentTypeMatch

        protected boolean contentTypeMatch​(java.lang.String contentType,
                                           java.lang.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
      • getPage

        public java.lang.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.
      • errorAfterRedirect

        public void errorAfterRedirect​(RequestState reqState,
                                       java.lang.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.
      • getBaseURL

        public java.lang.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.
      • extractDomainName

        public java.lang.String extractDomainName​(java.lang.String url)
        Extracts the domain part of a URL
        Parameters:
        url - the URL
        Returns:
        the domain part of a URL