public class

DisconnectedContainerServicesImpl

extends AbstractConfigurableContainerServices
implements DisconnectedContainerServices
java.lang.Object
   ↳ com.microstrategy.web.platform.AbstractConfigurableContainerServices
     ↳ com.microstrategy.web.platform.DisconnectedContainerServicesImpl

Class Overview

This class is an intermediary between the ASP.net and Microstrategy Java application. At the start of each ASP page request data and all other necessary data must be copied into the object of this class. After request processing is finished response data must be copied from this object to the response.

Summary

[Expand]
Inherited Constants
From class com.microstrategy.web.platform.AbstractConfigurableContainerServices
From interface com.microstrategy.web.platform.ContainerServices
[Expand]
Inherited Fields
From class com.microstrategy.web.platform.AbstractConfigurableContainerServices
Public Constructors
DisconnectedContainerServicesImpl()
The default constructor of this class.
Public Methods
void addCookieToRequest(String nativeCookieName, String nativeCookieValue)
Adds request cookie to the internal collection This method is used to add cookies to MicroStrategy Web application.
void addCookieToResponse(GenericCookie cookie)
This method associates a platform-independent Cookie with a response.
void addFormAndQueryString(String name, String value)
Adds a value to the request parameters collection.
void addRequestHeader(String name, String value)
Adds request header to the internal collection
void addServerVariable(String name, String value)
Adds a server variable with a single value.
void addServerVariable(String name, String[] values)
Appends a collection of string values of the specified server variable.
String getAppServerInfo()
Object getApplicationAttribute(int index)
Returns application attribute
Object getApplicationAttribute(String name)
This method returns the value of an Application Attribute.
String getApplicationAttributeName(int index)
Returns application attribute name
int getApplicationAttributesCount()
Returns a number of application attributes.
String getApplicationPath()
This method returns the full application path of the servlet
MarkupOutput getBinaryMarkup()
Returns markup outut stored at the sendBinaryContent method.
int getCodePage()
Returns an integer that represents the character formatting codepage.
String getContentType()
Returns response content type
String getContextPath()
Returns the context path.
ContainerStringCollection getCookieStrings()
This method returns the contents of all Cookies as a collection of sub strings (as name/value pairs).
ContainerStringCollection getCookieStrings(ContainerServicesNamespace namespace)
This method returns the contents of all Cookies as a collection of sub strings (as name/value pairs) in the given namespace.
boolean getCreateNewSessionValue()
Gets a boolean value indicating whether create a new http session
int getErrorCode()
Returns the error status code for response.
String getErrorMessage()
Returns the error message for response.
ContainerStringCollection getFormAndQueryStrings()
This method returns the contents of the Form Data and Query String as a collection of sub strings (as name/value pairs).
AppGlobalContext getGlobalContext()
Returns the global context held by this services.
String getHeaderValue(String headerName)
This method returns the value of the requested header
String getMethod()
Returns request method, post/get is expected.
OutputStream getOutputStream()
PostedFile getPostedFile(String name)
Provides a way to access individual files that have been uploaded by a client.
String getQueryString()
This method returns the entire Query String.
String getRealPath(String relPath)
This method returns the full real path to a server-side file resource.
String getRemoteAddress()
This method returns the client IP address
Object getRequestAttribute(String name)
This method returns the value of a Request Attribute.
Object getRequestAttribute(int index)
Returns requst attribute
String getRequestAttributeName(int index)
Returns requst attribute name
int getRequestAttributesCount()
Returns a number of request attributes.
String getRequestServerName()
This method returns the Web Server Name from the request object
URL getResource(String relPath)
Returns the URL associated with the given resource path.
InputStream getResourceAsStream(String relPath)
This method returns the contents of a file resource relative to the web application as an input stream.
Set<String> getResourcePaths(String relPath)
Returns a directory path strings of all the paths to resources within the application whose longest sub-path matches the supplied path.
GenericCookie getResponseCookie(int index)
Returns a cookie that must be added to the response
int getResponseCookiesCount()
Returns number of cookeis that must be added to the response
String getResponseHeaderName(int index)
Returns response header name
String getResponseHeaderValue(int index)
Returns response header value
int getResponseHeadersCount()
Returns number of response headers
ContainerStringCollection getServerVariables()
Returns a collection of server variables.
Object getSessionAttribute(int i)
Returns session attribute
Object getSessionAttribute(String name, ContainerServicesNamespace namespace)
This method returns the value of a Session Attribute in the given namespace.
Object getSessionAttribute(String name)
This method returns the value of a Session Attribute.
String getSessionAttributeName(int i)
Returns session attribute name
int getSessionAttributesCount()
Returns a number of session attributes.
String getSessionID()
Returns HTTP session ID
int getSessionMaxIdleTime()
Returns the maximum time interval, in seconds, that the container will keep this session open between client accesses.
ContainerStringCollection getSessionStrings()
This method returns the contents of the Session Variables as a collection of sub strings (as name/value pairs).
ContainerStringCollection getSessionStrings(ContainerServicesNamespace namespace)
This method returns the contents of the Session Variables as a collection of sub strings (as name/value pairs) in the given namespace.
int getStatusCode()
Returns the HTTP Status code specified for this response.
void handleMultipartRequest(byte[] request)
This method shall be called if the request type is multipart/form-data
boolean hasOutputStream()
void invalidateHttpSession()
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
boolean isJavaURLSessionSupported()
Indicates if the instance of this container services supports cookieless environments
boolean isRequestSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS
boolean isSessionlessRequest()
Does the request has a pre-established session id.
void sendBinaryContent(MarkupOutput mo)
Outputs binary content of the MarkupOutput
boolean sendError(int sc)
Sends an error response to the client using the specified status code.
boolean sendError(int sc, String msg)
Sends an error response to the client using the specified status code.
void setApplicationAttribute(String name, Object value)
This method sets the value of a Application Attribute.
void setCodePage(int code)
Sets the code page, an integer representing the character formatting.
void setContentType(String value)
Stes HTTP response content type
void setControllerName(String name)
void setCreateNewSessionValue(boolean value)
Sets a boolean indicating whether create a new http session
void setGlobalContext(AppGlobalContext globalContext)
Sets current application global context.
void setHeaderValue(String headerName, String headerValue)
Sets HTTP response header
void setJavaURLSessionSupported(boolean value)
Sets if the instance of this container services supports cookieless environments
void setMethod(String method)
Sets the request method
void setNativeSessionAttribute(String name, Object value)
This method sets the value of a Session Attribute without using namespace in Session variable.
void setQueryString(String queryString)
Sets HTTP request query string
void setRemoteAddress(String remoteAddress)
Set the remote (IP) address for this request
void setRequestAttribute(String name, Object value)
This method sets the value of a Request Attribute.
void setRequestSecure(boolean value)
Sets a boolean indicating whether this request was made using a secure channel, such as HTTPS
void setSessionAttribute(String name, Object value)
This method sets the value of a Session Attribute.
void setSessionAttribute(String name, Object value, ContainerServicesNamespace namespace)
This method sets the value of a Session Attribute in the given namespace.
void setSessionID(String sessionID)
Sets the HTTP session ID
void setStatusCode(int statusCode)
Sets the HTTP Status code specified for this response.
Protected Methods
String getControllerName()
HashList getCookies(ContainerServicesNamespace namespace)
Return the a collection of GenericCookie objects from the request cookies.
[Expand]
Inherited Methods
From class com.microstrategy.web.platform.AbstractConfigurableContainerServices
From class java.lang.Object
From interface com.microstrategy.web.platform.ContainerServices
From interface com.microstrategy.web.platform.ContainerServicesContext
From interface com.microstrategy.web.platform.DisconnectedContainerServices

Public Constructors

public DisconnectedContainerServicesImpl ()

The default constructor of this class.

Public Methods

public void addCookieToRequest (String nativeCookieName, String nativeCookieValue)

Adds request cookie to the internal collection This method is used to add cookies to MicroStrategy Web application.

Parameters
nativeCookieName The native cookie name used in browser
nativeCookieValue The native cookie value stored in browser

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.

Parameters
cookie The GenericCookie to be added to the Response.

public void addFormAndQueryString (String name, String value)

Adds a value to the request parameters collection. There can be several values assosiated with the same name in this collection.

Parameters
name parameter name.
value parameter value.

public void addRequestHeader (String name, String value)

Adds request header to the internal collection

Parameters
name header name
value header value

public void addServerVariable (String name, String value)

Adds a server variable with a single value. If the server variable already exists, appends the new value

Parameters
name the name of the server variable.
value the value of the server variable.

public void addServerVariable (String name, String[] values)

Appends a collection of string values of the specified server variable. If the server variable already exists, appends the new values.

Parameters
name the name of the server variable.
values an array of string values of the server variable.

public String getAppServerInfo ()

public Object getApplicationAttribute (int index)

Returns application attribute

Parameters
index an index in the attribute collection
Returns
  • application attribute

public Object getApplicationAttribute (String name)

This method returns the value of an Application Attribute.

Parameters
name the name of an attribute.
Returns
  • An Object representing the value of a named application attribute.

public String getApplicationAttributeName (int index)

Returns application attribute name

Parameters
index an index in the attribute collection
Returns
  • application attribute name

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.

Returns
  • number of Application attributes.

public String getApplicationPath ()

This method returns the full application path of the servlet

Returns
  • A String that indicates the full application path of the servlet. (i.e. http://localhost:8080/MicroStrategy/servlet)

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.

Returns
  • binary markup output

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.

Returns
  • an integer that represents the character formatting codepage.

public String getContentType ()

Returns response content type

Returns
  • response content type

public String getContextPath ()

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.

Returns
  • the context path.

public ContainerStringCollection getCookieStrings ()

This method returns the contents of all Cookies as a collection of sub strings (as name/value pairs).

Returns

public ContainerStringCollection getCookieStrings (ContainerServicesNamespace namespace)

This method returns the contents of all Cookies as a collection of sub strings (as name/value pairs) in the given namespace.

Parameters
namespace A ContainerServicesNamespace object representing the namespace requirement. If null, no namespace is used.
Returns

public boolean getCreateNewSessionValue ()

Gets a boolean value indicating whether create a new http session

public int getErrorCode ()

Returns the error status code for response.

Returns
  • The error status code. We reuse HTTP status code "OK" (200) to mean no error.

public String getErrorMessage ()

Returns the error message for response.

Returns
  • The error message. If no error message, empty string will be returned.

public ContainerStringCollection getFormAndQueryStrings ()

This method returns the contents of the Form Data and Query String as a collection of sub strings (as name/value pairs).

Returns

public AppGlobalContext getGlobalContext ()

Returns the global context held by this services.

Returns
  • an AppGlobalContext. If there has no AppGlobalContext been set to this object, nulll will be returned.

public String getHeaderValue (String headerName)

This method returns the value of the requested header

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.

public String getMethod ()

Returns request method, post/get is expected.

Returns
  • request method

public OutputStream getOutputStream ()

public PostedFile getPostedFile (String name)

Provides a way to access individual files that have been uploaded by a client.

Parameters
name a name of posted file
Returns
  • a posted file

public String getQueryString ()

This method returns the entire Query String.

Returns
  • A String that contains the contents of the Query String.

public String getRealPath (String relPath)

This method returns the full real path to a server-side file resource.

Parameters
relPath A String that indicates the relative path of the file.
Returns
  • A String that indicates the full path of the file.

public String getRemoteAddress ()

This method returns the client IP address

Returns
  • A String with the value of the client IP address

public Object getRequestAttribute (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.

Parameters
name the name of an attribute.
Returns
  • An Object representing the value of a named attribute.

public Object getRequestAttribute (int index)

Returns requst attribute

Parameters
index an index in the attribute collection
Returns
  • request attribute

public String getRequestAttributeName (int index)

Returns requst attribute name

Parameters
index an index in the attribute collection
Returns
  • requst attribute name

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.

Returns
  • number of request attributes.

public String getRequestServerName ()

This method returns the Web Server Name from the request object

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.

public URL getResource (String relPath)

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 java.io.File). Note that many URL implementations are read-only.

Parameters
relPath relative path.
Returns
  • URL associated with given path.

public InputStream getResourceAsStream (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.

Parameters
relPath A String that indicates the relative path of the file.
Returns
  • A InputStream that contains the contents of the specified file.

public Set<String> getResourcePaths (String relPath)

Returns a directory path strings of all the paths to resources within the application whose longest sub-path matches the supplied path.

Parameters
relPath sub-path to match
Returns
  • Set of directory paths

public GenericCookie getResponseCookie (int index)

Returns a cookie that must be added to the response

Parameters
index an index in the cookies collection
Returns
  • a cookie that must be added to the response

public int getResponseCookiesCount ()

Returns number of cookeis that must be added to the response

Returns
  • number of cookeis that must be added to the response

public String getResponseHeaderName (int index)

Returns response header name

Parameters
index an index in the collection
Returns
  • response header name

public String getResponseHeaderValue (int index)

Returns response header value

Parameters
index an index in the collection
Returns
  • response header value

public int getResponseHeadersCount ()

Returns number of response headers

Returns
  • number of response headers

public ContainerStringCollection getServerVariables ()

Returns a collection of server variables.

Returns
  • a collection of server variables.

public Object getSessionAttribute (int i)

Returns session attribute

Parameters
i an index in the attribute collection
Returns
  • session attribute

public Object getSessionAttribute (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.

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.

public Object getSessionAttribute (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.

Parameters
name the name of an attribute.
Returns
  • An Object representing the value of a named session attribute.

public String getSessionAttributeName (int i)

Returns session attribute name

Parameters
i an index in the attribute collection
Returns
  • session attribute name

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.

Returns
  • number of session attributes.

public String getSessionID ()

Returns HTTP session ID

Returns
  • HTTP session ID

public int getSessionMaxIdleTime ()

Returns the maximum time interval, in seconds, that the container will keep this session open between client accesses.

public ContainerStringCollection getSessionStrings ()

This method returns the contents of the Session Variables as a collection of sub strings (as name/value pairs). Only those session variables that return values of type String are considered.

Returns

public ContainerStringCollection getSessionStrings (ContainerServicesNamespace namespace)

This method returns the contents of the Session Variables as a collection of sub strings (as name/value pairs) in the given namespace. Only those session variables that return values of type String are considered.

Parameters
namespace type of ContainerServicesNamespace The specified namespace.
Returns

public int getStatusCode ()

Returns the HTTP Status code specified for this response.

Returns
  • The HTTP Status code specified for this response.

public void handleMultipartRequest (byte[] request)

This method shall be called if the request type is multipart/form-data

Parameters
request a byte array containing entire HTTP request
Throws
IOException

public boolean hasOutputStream ()

public void invalidateHttpSession ()

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

public boolean isJavaURLSessionSupported ()

Indicates if the instance of this container services supports cookieless environments

public boolean isRequestSecure ()

Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS

public boolean isSessionlessRequest ()

Does the request has a pre-established session id.

public void sendBinaryContent (MarkupOutput mo)

Outputs binary content of the MarkupOutput

Parameters
mo markup outpu containing binary image

public boolean sendError (int sc)

Sends an error response to the client using the specified status code.

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.

public boolean sendError (int sc, String msg)

Sends an error response to the client using the specified status code.

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.

public void setApplicationAttribute (String name, Object value)

This method sets the value of a Application Attribute.

Parameters
name A String which identifies the name of the attribute.
value An Object representing the value of a named attribute.

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.

Parameters
code an integer that represents the character formatting codepage.

public void setContentType (String value)

Stes HTTP response content type

Parameters
value content type

public void setControllerName (String name)

public void setCreateNewSessionValue (boolean value)

Sets a boolean indicating whether create a new http session

public void setGlobalContext (AppGlobalContext globalContext)

Sets current application global context.

Parameters
globalContext is an AppGlobalContext object.

public void setHeaderValue (String headerName, String headerValue)

Sets HTTP response header

Parameters
headerName header name
headerValue header value

public void setJavaURLSessionSupported (boolean value)

Sets if the instance of this container services supports cookieless environments

Parameters
value true if cookieless environment is supported

public void setMethod (String method)

Sets the request method

public void setNativeSessionAttribute (String name, Object value)

This method sets the value of a Session Attribute without using namespace in Session variable.

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 load(String)

public void setQueryString (String queryString)

Sets HTTP request query string

Parameters
queryString request query string

public void setRemoteAddress (String remoteAddress)

Set the remote (IP) address for this request

Parameters
remoteAddress IP address

public void setRequestAttribute (String name, 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.

Parameters
name A String which identifies the name of the attribute.
value An Object representing the value of a named attribute.

public void setRequestSecure (boolean value)

Sets a boolean indicating whether this request was made using a secure channel, such as HTTPS

public void setSessionAttribute (String name, Object value)

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.

Parameters
name A String which identifies the name of the attribute.
value An Object representing the value of a named attribute.

public void setSessionAttribute (String name, Object value, ContainerServicesNamespace namespace)

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.

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.

public void setSessionID (String sessionID)

Sets the HTTP session ID

Parameters
sessionID HTTP session ID

public void setStatusCode (int statusCode)

Sets the HTTP Status code specified for this response.

Parameters
statusCode the HTTP Status code specified for this response.

Protected Methods

protected String getControllerName ()

protected HashList getCookies (ContainerServicesNamespace namespace)

Return the a collection of GenericCookie objects from the request cookies.