Class DisconnectedContainerServicesImpl

    • Constructor Detail

      • DisconnectedContainerServicesImpl

        public DisconnectedContainerServicesImpl()
        The default constructor of this class.
    • Method Detail

      • getRealPath

        public java.lang.String getRealPath​(java.lang.String relPath)
        This method returns the full real path to a server-side file resource.
        Specified by:
        getRealPath in interface ContainerServicesContext
        Parameters:
        relPath - A String that indicates the relative path of the file.
        Returns:
        A String that indicates the full path of the file.
        See Also:
        FileLoader.getRealPath(String)
      • getResourceAsStream

        public java.io.InputStream getResourceAsStream​(java.lang.String relPath)
        This method returns the contents of a file resource relative to the web application as an input stream.

        This is ONLY required to support the Java environment, and in particular, only those Java environments where the WAR file is not expanded. This should return NULL in an ASP environment.

        Specified by:
        getResourceAsStream in interface ContainerServicesContext
        Parameters:
        relPath - A String that indicates the relative path of the file.
        Returns:
        A InputStream that contains the contents of the specified file.
      • getQueryString

        public java.lang.String getQueryString()
        This method returns the entire Query String.
        Specified by:
        getQueryString in interface ContainerServices
        Returns:
        A String that contains the contents of the Query String.
      • getRemoteAddress

        public java.lang.String getRemoteAddress()
        This method returns the client IP address
        Specified by:
        getRemoteAddress in interface ContainerServices
        Returns:
        A String with the value of the client IP address
      • getHeaderValue

        public java.lang.String getHeaderValue​(java.lang.String headerName)
        This method returns the value of the requested header
        Specified by:
        getHeaderValue in interface ContainerServices
        Parameters:
        headerName - A String with the name of the header to search for
        Returns:
        A String with the value of the header requested. If the header was not found, it shall return a null value.
      • setNativeSessionAttribute

        public void setNativeSessionAttribute​(java.lang.String name,
                                              java.lang.Object value)
        Description copied from interface: DisconnectedContainerServices
        This method sets the value of a Session Attribute without using namespace in Session variable.
        Specified by:
        setNativeSessionAttribute in interface DisconnectedContainerServices
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute. If used in namespaced mode, the native value should containes the namespace encoding, that can be loaded by LRUHashList.load(String)
        Since:
        MicroStrategy Web 8.0.2
      • getRequestAttribute

        public java.lang.Object getRequestAttribute​(java.lang.String name)
        This method returns the value of a Request Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Specified by:
        getRequestAttribute in interface ContainerServices
        Parameters:
        name - the name of an attribute.
        Returns:
        An Object representing the value of a named attribute.
      • setRequestAttribute

        public void setRequestAttribute​(java.lang.String name,
                                        java.lang.Object value)
        This method sets the value of a Request Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Specified by:
        setRequestAttribute in interface ContainerServices
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
      • setSessionAttribute

        public void setSessionAttribute​(java.lang.String name,
                                        java.lang.Object value)
        Description copied from interface: ContainerServices
        This method sets the value of a Session Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Specified by:
        setSessionAttribute in interface ContainerServices
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
      • setSessionAttribute

        public void setSessionAttribute​(java.lang.String name,
                                        java.lang.Object value,
                                        ContainerServicesNamespace namespace)
        Description copied from interface: ContainerServices
        This method sets the value of a Session Attribute in the given namespace. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Specified by:
        setSessionAttribute in interface ContainerServices
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
        namespace - A ContainerServicesNamespace object representing the namespace requirement. If null, no namespace is used.
        Since:
        MicroStrategy Web 8.0.2
      • addCookieToResponse

        public void addCookieToResponse​(GenericCookie cookie)
        This method associates a platform-independent Cookie with a response. When the response is sent back to the client, it will contain this cookie.
        Specified by:
        addCookieToResponse in interface ContainerServices
        Parameters:
        cookie - The GenericCookie to be added to the Response.
      • getApplicationPath

        public java.lang.String getApplicationPath()
        This method returns the full application path of the servlet
        Specified by:
        getApplicationPath in interface ContainerServices
        Returns:
        A String that indicates the full application path of the servlet. (i.e. http://localhost:8080/MicroStrategy/servlet)
      • getPostedFile

        public PostedFile getPostedFile​(java.lang.String name)
        Description copied from interface: ContainerServices
        Provides a way to access individual files that have been uploaded by a client.
        Specified by:
        getPostedFile in interface ContainerServices
        Parameters:
        name - a name of posted file
        Returns:
        a posted file
      • getRequestServerName

        public java.lang.String getRequestServerName()
        This method returns the Web Server Name from the request object
        Specified by:
        getRequestServerName in interface ContainerServices
        Returns:
        A String that indicates the Web Server Name. (i.e. if you access the web server with the URL which reads as http://localhost:8080/MicroStrategy/servlet then this method will return "localhost" as the web server name. If you access the webserver with the URL which reads as http://machine1:8080/MicroStrategy/servlet then this method will return "machine1" as the web server name.
      • getSessionID

        public java.lang.String getSessionID()
        Returns HTTP session ID
        Specified by:
        getSessionID in interface ContainerServices
        Returns:
        HTTP session ID
      • getMethod

        public java.lang.String getMethod()
        Returns request method, post/get is expected.
        Specified by:
        getMethod in interface ContainerServices
        Returns:
        request method
        Since:
        MicroStrategy Web 9.2.2
      • setControllerName

        public void setControllerName​(java.lang.String name)
        Since:
        MicroStrategy Web 9.0.1
      • sendBinaryContent

        public void sendBinaryContent​(MarkupOutput mo)
        Outputs binary content of the MarkupOutput
        Specified by:
        sendBinaryContent in interface ContainerServices
        Parameters:
        mo - markup outpu containing binary image
      • setContentType

        public void setContentType​(java.lang.String value)
        Stes HTTP response content type
        Specified by:
        setContentType in interface ContainerServices
        Parameters:
        value - content type
      • setHeaderValue

        public void setHeaderValue​(java.lang.String headerName,
                                   java.lang.String headerValue)
        Sets HTTP response header
        Specified by:
        setHeaderValue in interface ContainerServices
        Parameters:
        headerName - header name
        headerValue - header value
      • addFormAndQueryString

        public void addFormAndQueryString​(java.lang.String name,
                                          java.lang.String value)
        Adds a value to the request parameters collection. There can be several values assosiated with the same name in this collection.
        Specified by:
        addFormAndQueryString in interface DisconnectedContainerServices
        Parameters:
        name - parameter name.
        value - parameter value.
      • setQueryString

        public void setQueryString​(java.lang.String queryString)
        Sets HTTP request query string
        Specified by:
        setQueryString in interface DisconnectedContainerServices
        Parameters:
        queryString - request query string
      • setRemoteAddress

        public void setRemoteAddress​(java.lang.String remoteAddress)
        Set the remote (IP) address for this request
        Specified by:
        setRemoteAddress in interface DisconnectedContainerServices
        Parameters:
        remoteAddress - IP address
      • setSessionID

        public void setSessionID​(java.lang.String sessionID)
        Sets the HTTP session ID
        Specified by:
        setSessionID in interface DisconnectedContainerServices
        Parameters:
        sessionID - HTTP session ID
      • setMethod

        public void setMethod​(java.lang.String method)
        Sets the request method
        Specified by:
        setMethod in interface DisconnectedContainerServices
        Parameters:
        request - method, post/get is expected.
      • getResponseCookiesCount

        public int getResponseCookiesCount()
        Returns number of cookeis that must be added to the response
        Specified by:
        getResponseCookiesCount in interface DisconnectedContainerServices
        Returns:
        number of cookeis that must be added to the response
      • getResponseCookie

        public GenericCookie getResponseCookie​(int index)
        Returns a cookie that must be added to the response
        Specified by:
        getResponseCookie in interface DisconnectedContainerServices
        Parameters:
        index - an index in the cookies collection
        Returns:
        a cookie that must be added to the response
      • getRequestAttributesCount

        public int getRequestAttributesCount()
        Returns a number of request attributes. The request attributes is a read-writy collection. Attributes can be replaced in it during execution. Therefore entire collection shall be copied in and out of disconnected container services.
        Specified by:
        getRequestAttributesCount in interface DisconnectedContainerServices
        Returns:
        number of request attributes.
      • getRequestAttributeName

        public java.lang.String getRequestAttributeName​(int index)
        Returns requst attribute name
        Specified by:
        getRequestAttributeName in interface DisconnectedContainerServices
        Parameters:
        index - an index in the attribute collection
        Returns:
        requst attribute name
      • getRequestAttribute

        public java.lang.Object getRequestAttribute​(int index)
        Returns requst attribute
        Specified by:
        getRequestAttribute in interface DisconnectedContainerServices
        Parameters:
        index - an index in the attribute collection
        Returns:
        request attribute
      • getSessionAttributesCount

        public int getSessionAttributesCount()
        Returns a number of session attributes. The session attributes is a read-writy collection. Attributes can be replaced in it during execution. Therefore entire collection shall be copied in and out of disconnected container services.
        Specified by:
        getSessionAttributesCount in interface DisconnectedContainerServices
        Returns:
        number of session attributes.
      • getSessionAttributeName

        public java.lang.String getSessionAttributeName​(int i)
        Returns session attribute name
        Specified by:
        getSessionAttributeName in interface DisconnectedContainerServices
        Parameters:
        i - an index in the attribute collection
        Returns:
        session attribute name
      • getSessionAttribute

        public java.lang.Object getSessionAttribute​(int i)
        Returns session attribute
        Specified by:
        getSessionAttribute in interface DisconnectedContainerServices
        Parameters:
        i - an index in the attribute collection
        Returns:
        session attribute
      • getBinaryMarkup

        public MarkupOutput getBinaryMarkup()
        Returns markup outut stored at the sendBinaryContent method. If this method returns not null the content of markup output must be displayed.
        Specified by:
        getBinaryMarkup in interface DisconnectedContainerServices
        Returns:
        binary markup output
      • addRequestHeader

        public void addRequestHeader​(java.lang.String name,
                                     java.lang.String value)
        Adds request header to the internal collection
        Specified by:
        addRequestHeader in interface DisconnectedContainerServices
        Parameters:
        name - header name
        value - header value
      • addCookieToRequest

        public void addCookieToRequest​(java.lang.String nativeCookieName,
                                       java.lang.String nativeCookieValue)
        Adds request cookie to the internal collection This method is used to add cookies to MicroStrategy Web application.
        Specified by:
        addCookieToRequest in interface DisconnectedContainerServices
        Parameters:
        nativeCookieName - The native cookie name used in browser
        nativeCookieValue - The native cookie value stored in browser
      • getResponseHeaderName

        public java.lang.String getResponseHeaderName​(int index)
        Returns response header name
        Specified by:
        getResponseHeaderName in interface DisconnectedContainerServices
        Parameters:
        index - an index in the collection
        Returns:
        response header name
      • getResponseHeaderValue

        public java.lang.String getResponseHeaderValue​(int index)
        Returns response header value
        Specified by:
        getResponseHeaderValue in interface DisconnectedContainerServices
        Parameters:
        index - an index in the collection
        Returns:
        response header value
      • handleMultipartRequest

        public void handleMultipartRequest​(byte[] request)
                                    throws java.io.IOException
        This method shall be called if the request type is multipart/form-data
        Specified by:
        handleMultipartRequest in interface DisconnectedContainerServices
        Parameters:
        request - a byte array containing entire HTTP request
        Throws:
        java.io.IOException
      • getSessionAttribute

        public java.lang.Object getSessionAttribute​(java.lang.String name)
        This method returns the value of a Session Attribute. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Specified by:
        getSessionAttribute in interface ContainerServices
        Parameters:
        name - the name of an attribute.
        Returns:
        An Object representing the value of a named session attribute.
      • getSessionAttribute

        public java.lang.Object getSessionAttribute​(java.lang.String name,
                                                    ContainerServicesNamespace namespace)
        This method returns the value of a Session Attribute in the given namespace. In Java, there is a clear distinction between Request and Session variables. In ASP, the two are combined as there is not a similar concept.
        Specified by:
        getSessionAttribute in interface ContainerServices
        Parameters:
        name - the name of an attribute.
        namespace - A ContainerServicesNamespace object representing the namespace requirement.
        Returns:
        An Object representing the value of a named session attribute.
        Since:
        MicroStrategy Web 8.0.2
      • getApplicationAttributesCount

        public int getApplicationAttributesCount()
        Returns a number of application attributes. The Application attributes is a read-writy collection. Attributes can be replaced in it during execution. Therefore entire collection shall be copied in and out of disconnected container services.
        Specified by:
        getApplicationAttributesCount in interface DisconnectedContainerServices
        Returns:
        number of Application attributes.
      • getApplicationAttributeName

        public java.lang.String getApplicationAttributeName​(int index)
        Returns application attribute name
        Specified by:
        getApplicationAttributeName in interface DisconnectedContainerServices
        Parameters:
        index - an index in the attribute collection
        Returns:
        application attribute name
      • getApplicationAttribute

        public java.lang.Object getApplicationAttribute​(int index)
        Returns application attribute
        Specified by:
        getApplicationAttribute in interface DisconnectedContainerServices
        Parameters:
        index - an index in the attribute collection
        Returns:
        application attribute
      • getApplicationAttribute

        public java.lang.Object getApplicationAttribute​(java.lang.String name)
        This method returns the value of an Application Attribute.
        Specified by:
        getApplicationAttribute in interface ContainerServices
        Parameters:
        name - the name of an attribute.
        Returns:
        An Object representing the value of a named application attribute.
      • setApplicationAttribute

        public void setApplicationAttribute​(java.lang.String name,
                                            java.lang.Object value)
        This method sets the value of a Application Attribute.
        Specified by:
        setApplicationAttribute in interface ContainerServices
        Parameters:
        name - A String which identifies the name of the attribute.
        value - An Object representing the value of a named attribute.
      • sendError

        public boolean sendError​(int sc)
        Sends an error response to the client using the specified status code.
        Specified by:
        sendError in interface ContainerServices
        Parameters:
        sc - The status errror code. We reuse HTTP status code "OK" (200) to mean no error, so please do not use it for any error status.
        Returns:
        true to indicate this action succeeded. false to indicate error in performing this action.
      • sendError

        public boolean sendError​(int sc,
                                 java.lang.String msg)
        Sends an error response to the client using the specified status code.
        Specified by:
        sendError in interface ContainerServices
        Parameters:
        sc - The errror status code.
        msg - The error message.
        Returns:
        true to indicate this action succeeded. false to indicate error in performing this action.
      • getCodePage

        public int getCodePage()
        Returns an integer that represents the character formatting codepage. The CodePage property specifies how literal (static) strings are encoded in a Web page. A codepage is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages have multi-byte characters, while others only need one byte to represent each character.
        Specified by:
        getCodePage in interface ContainerServices
        Returns:
        an integer that represents the character formatting codepage.
        Since:
        MicroStrategy Web 7.5.0
      • setCodePage

        public void setCodePage​(int code)
        Sets the code page, an integer representing the character formatting. The CodePage property specifies how literal (static) strings are encoded in a Web page. A codepage is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages have multi-byte characters, while others only need one byte to represent each character.
        Specified by:
        setCodePage in interface ContainerServices
        Parameters:
        code - an integer that represents the character formatting codepage.
        Since:
        MicroStrategy Web 7.5.0
      • isJavaURLSessionSupported

        public boolean isJavaURLSessionSupported()
        Indicates if the instance of this container services supports cookieless environments
        Specified by:
        isJavaURLSessionSupported in interface ContainerServices
        Since:
        MicroStrategy Web 7.5.0
      • setJavaURLSessionSupported

        public void setJavaURLSessionSupported​(boolean value)
        Sets if the instance of this container services supports cookieless environments
        Specified by:
        setJavaURLSessionSupported in interface ContainerServices
        Parameters:
        value - true if cookieless environment is supported
        Since:
        MicroStrategy Web 7.5.0
      • addServerVariable

        public void addServerVariable​(java.lang.String name,
                                      java.lang.String value)
        Adds a server variable with a single value. If the server variable already exists, appends the new value
        Specified by:
        addServerVariable in interface DisconnectedContainerServices
        Parameters:
        name - the name of the server variable.
        value - the value of the server variable.
        Since:
        MicroStrategy Web 7.5.4
      • addServerVariable

        public void addServerVariable​(java.lang.String name,
                                      java.lang.String[] values)
        Appends a collection of string values of the specified server variable. If the server variable already exists, appends the new values.
        Specified by:
        addServerVariable in interface DisconnectedContainerServices
        Parameters:
        name - the name of the server variable.
        values - an array of string values of the server variable.
        Since:
        MicroStrategy Web 7.5.4
      • getStatusCode

        public int getStatusCode()
        Description copied from interface: ContainerServices
        Returns the HTTP Status code specified for this response.
        Specified by:
        getStatusCode in interface ContainerServices
        Returns:
        The HTTP Status code specified for this response.
        Since:
        MicroStrategy Web 9.0.0
      • setStatusCode

        public void setStatusCode​(int statusCode)
        Description copied from interface: ContainerServices
        Sets the HTTP Status code specified for this response.
        Specified by:
        setStatusCode in interface ContainerServices
        Parameters:
        statusCode - the HTTP Status code specified for this response.
        Since:
        MicroStrategy Web 9.0.0
      • isRequestSecure

        public boolean isRequestSecure()
        Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS
        Specified by:
        isRequestSecure in interface ContainerServices
        Since:
        MicroStrategy Web 9.0.0
      • setRequestSecure

        public void setRequestSecure​(boolean value)
        Sets a boolean indicating whether this request was made using a secure channel, such as HTTPS
        Specified by:
        setRequestSecure in interface DisconnectedContainerServices
        Since:
        MicroStrategy Web 9.0.0
      • getResource

        public java.net.URL getResource​(java.lang.String relPath)
        Description copied from interface: ContainerServicesContext
        Returns the URL associated with the given resource path. If the resource does not exist, null is returned (i.e. it cannot return a path to a new File). Note that many URL implementations are read-only.
        Specified by:
        getResource in interface ContainerServicesContext
        Parameters:
        relPath - relative path.
        Returns:
        URL associated with given path.
        Since:
        MicroStrategy Web 9.0.0
      • getResourcePaths

        public java.util.Set<java.lang.String> getResourcePaths​(java.lang.String relPath)
        Description copied from interface: ContainerServicesContext
        Returns a directory path strings of all the paths to resources within the application whose longest sub-path matches the supplied path.
        Specified by:
        getResourcePaths in interface ContainerServicesContext
        Parameters:
        relPath - sub-path to match
        Returns:
        Set of directory paths
        Since:
        MicroStrategy Web 9.0.0
      • getAppServerInfo

        public java.lang.String getAppServerInfo()
        Since:
        MicroStrategy Web 9.0.0
      • getContextPath

        public java.lang.String getContextPath()
        Description copied from interface: ContainerServicesContext
        Returns the context path. In the out of the box Web application deployment, this is usually "/MicroStrategy". Note that subclasses can override this implementation to return different context paths.
        Specified by:
        getContextPath in interface ContainerServicesContext
        Returns:
        the context path.
        Since:
        MicroStrategy Web 9.0.1
      • invalidateHttpSession

        public void invalidateHttpSession()
        Description copied from interface: ContainerServices
        If the security preference is selected, invalidate and create new http session in jsp part set a flag to show whether a new session need to be created in asp part
        Specified by:
        invalidateHttpSession in interface ContainerServices
      • getSessionMaxIdleTime

        public int getSessionMaxIdleTime()
        Description copied from interface: ContainerServices
        Returns the maximum time interval, in seconds, that the container will keep this session open between client accesses.
        Specified by:
        getSessionMaxIdleTime in interface ContainerServices