Package com.microstrategy.web.platform
Class DisconnectedContainerServicesImpl
- java.lang.Object
-
- com.microstrategy.web.platform.AbstractConfigurableContainerServices
-
- com.microstrategy.web.platform.DisconnectedContainerServicesImpl
-
- All Implemented Interfaces:
ContainerServices
,ContainerServicesContext
,DisconnectedContainerServices
public class DisconnectedContainerServicesImpl extends AbstractConfigurableContainerServices implements DisconnectedContainerServices
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.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microstrategy.web.platform.AbstractConfigurableContainerServices
AbstractConfigurableContainerServices.AbstractContainerStringCollection, AbstractConfigurableContainerServices.CookieWrapper
-
-
Field Summary
-
Fields inherited from class com.microstrategy.web.platform.AbstractConfigurableContainerServices
_prependSlashToResource, APPLICATION_PARAMETERS_XML_PATH, WEB_XML_PATH
-
Fields inherited from interface com.microstrategy.web.platform.ContainerServices
SPNEGO_CREDENTIAL
-
-
Constructor Summary
Constructors Constructor Description DisconnectedContainerServicesImpl()
The default constructor of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
addCookieToResponse(GenericCookie cookie)
This method associates a platform-independent Cookie with a response.void
addFormAndQueryString(java.lang.String name, java.lang.String value)
Adds a value to the request parameters collection.void
addRequestHeader(java.lang.String name, java.lang.String value)
Adds request header to the internal collectionvoid
addServerVariable(java.lang.String name, java.lang.String value)
Adds a server variable with a single value.void
addServerVariable(java.lang.String name, java.lang.String[] values)
Appends a collection of string values of the specified server variable.java.lang.Object
getApplicationAttribute(int index)
Returns application attributejava.lang.Object
getApplicationAttribute(java.lang.String name)
This method returns the value of an Application Attribute.java.lang.String
getApplicationAttributeName(int index)
Returns application attribute nameint
getApplicationAttributesCount()
Returns a number of application attributes.java.lang.String
getApplicationPath()
This method returns the full application path of the servletjava.lang.String
getAppServerInfo()
MarkupOutput
getBinaryMarkup()
Returns markup outut stored at the sendBinaryContent method.int
getCodePage()
Returns an integer that represents the character formatting codepage.java.lang.String
getContentType()
Returns response content typejava.lang.String
getContextPath()
Returns the context path.protected java.lang.String
getControllerName()
protected HashList
getCookies(ContainerServicesNamespace namespace)
Return the a collection of GenericCookie objects from the request cookies.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 sessionint
getErrorCode()
Returns the error status code for response.java.lang.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.java.lang.String
getHeaderValue(java.lang.String headerName)
This method returns the value of the requested headerjava.lang.String
getMethod()
Returns request method, post/get is expected.java.io.OutputStream
getOutputStream()
PostedFile
getPostedFile(java.lang.String name)
Provides a way to access individual files that have been uploaded by a client.java.lang.String
getQueryString()
This method returns the entire Query String.java.lang.String
getRealPath(java.lang.String relPath)
This method returns the full real path to a server-side file resource.java.lang.String
getRemoteAddress()
This method returns the client IP addressjava.lang.Object
getRequestAttribute(int index)
Returns requst attributejava.lang.Object
getRequestAttribute(java.lang.String name)
This method returns the value of a Request Attribute.java.lang.String
getRequestAttributeName(int index)
Returns requst attribute nameint
getRequestAttributesCount()
Returns a number of request attributes.java.lang.String
getRequestServerName()
This method returns the Web Server Name from the request objectjava.net.URL
getResource(java.lang.String relPath)
Returns theURL
associated with the given resource path.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.java.util.Set<java.lang.String>
getResourcePaths(java.lang.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 responseint
getResponseCookiesCount()
Returns number of cookeis that must be added to the responsejava.lang.String
getResponseHeaderName(int index)
Returns response header nameint
getResponseHeadersCount()
Returns number of response headersjava.lang.String
getResponseHeaderValue(int index)
Returns response header valueContainerStringCollection
getServerVariables()
Returns a collection of server variables.java.lang.Object
getSessionAttribute(int i)
Returns session attributejava.lang.Object
getSessionAttribute(java.lang.String name)
This method returns the value of a Session Attribute.java.lang.Object
getSessionAttribute(java.lang.String name, ContainerServicesNamespace namespace)
This method returns the value of a Session Attribute in the given namespace.java.lang.String
getSessionAttributeName(int i)
Returns session attribute nameint
getSessionAttributesCount()
Returns a number of session attributes.java.lang.String
getSessionID()
Returns HTTP session IDint
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-databoolean
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 partboolean
isJavaURLSessionSupported()
Indicates if the instance of this container services supports cookieless environmentsboolean
isRequestSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPSboolean
isSessionlessRequest()
Does the request has a pre-established session id.void
sendBinaryContent(MarkupOutput mo)
Outputs binary content of the MarkupOutputboolean
sendError(int sc)
Sends an error response to the client using the specified status code.boolean
sendError(int sc, java.lang.String msg)
Sends an error response to the client using the specified status code.void
setApplicationAttribute(java.lang.String name, java.lang.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(java.lang.String value)
Stes HTTP response content typevoid
setControllerName(java.lang.String name)
void
setCreateNewSessionValue(boolean value)
Sets a boolean indicating whether create a new http sessionvoid
setGlobalContext(AppGlobalContext globalContext)
Sets current application global context.void
setHeaderValue(java.lang.String headerName, java.lang.String headerValue)
Sets HTTP response headervoid
setJavaURLSessionSupported(boolean value)
Sets if the instance of this container services supports cookieless environmentsvoid
setMethod(java.lang.String method)
Sets the request methodvoid
setNativeSessionAttribute(java.lang.String name, java.lang.Object value)
This method sets the value of a Session Attribute without using namespace in Session variable.void
setQueryString(java.lang.String queryString)
Sets HTTP request query stringvoid
setRemoteAddress(java.lang.String remoteAddress)
Set the remote (IP) address for this requestvoid
setRequestAttribute(java.lang.String name, java.lang.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 HTTPSvoid
setSessionAttribute(java.lang.String name, java.lang.Object value)
This method sets the value of a Session Attribute.void
setSessionAttribute(java.lang.String name, java.lang.Object value, ContainerServicesNamespace namespace)
This method sets the value of a Session Attribute in the given namespace.void
setSessionID(java.lang.String sessionID)
Sets the HTTP session IDvoid
setStatusCode(int statusCode)
Sets the HTTP Status code specified for this response.-
Methods inherited from class com.microstrategy.web.platform.AbstractConfigurableContainerServices
decrypt, encrypt, getApplicationParameters, getControllerParameter, getCookie, getCookie, getCookieNamespace, getCookieNamespaceCapacity, getInitParameter, getInitParameterNames, getNamespacePrefix, getNamespaceValue, getRealName, getSessionNamespace, getSessionNamespaceCapacity, initFromPropertiesFile, initGlobalObjects, isEncryptedByRedirect, isEncryptedParameter, isNamespacedName, isQueryParam, newCookie, newCookie, newHiddenInputParameterBuilder, newNamespaceEncoder, newURIParameterBuilder, useNamespace, useNamespaceInCookie
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.platform.ContainerServices
getCookie, getCookie, isQueryParam, newCookie, newCookie, newHiddenInputParameterBuilder, newNamespaceEncoder, newURIParameterBuilder
-
Methods inherited from interface com.microstrategy.web.platform.ContainerServicesContext
getApplicationParameters, getControllerParameter, getInitParameter, getInitParameterNames, initGlobalObjects
-
-
-
-
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 interfaceContainerServicesContext
- Parameters:
relPath
- AString
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 interfaceContainerServicesContext
- Parameters:
relPath
- AString
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 interfaceContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- Parameters:
headerName
- AString
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.
-
getFormAndQueryStrings
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).- Specified by:
getFormAndQueryStrings
in interfaceContainerServices
- Returns:
- A
ContainerStringCollection
object.
-
getCookieStrings
public ContainerStringCollection getCookieStrings()
This method returns the contents of all Cookies as a collection of sub strings (as name/value pairs).- Specified by:
getCookieStrings
in interfaceContainerServices
- Returns:
- A
ContainerStringCollection
object.
-
getCookieStrings
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.- Specified by:
getCookieStrings
in interfaceContainerServices
- Parameters:
namespace
-- Returns:
- A
ContainerStringCollection
object. - Since:
- MicroStrategy Web 8.0.2
-
getSessionStrings
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.- Specified by:
getSessionStrings
in interfaceContainerServices
- Returns:
- A
ContainerStringCollection
object.
-
getSessionStrings
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.- Specified by:
getSessionStrings
in interfaceContainerServices
- Parameters:
namespace
- type ofContainerServicesNamespace
The specified namespace.- Returns:
- A
ContainerStringCollection
object. - Since:
- MicroStrategy Web 8.0.2
-
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 interfaceDisconnectedContainerServices
- Parameters:
name
- AString
which identifies the name of the attribute.value
- AnObject
representing the value of a named attribute. If used in namespaced mode, the native value should containes the namespace encoding, that can be loaded byLRUHashList.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 interfaceContainerServices
- 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 interfaceContainerServices
- Parameters:
name
- AString
which identifies the name of the attribute.value
- AnObject
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 interfaceContainerServices
- Parameters:
name
- AString
which identifies the name of the attribute.value
- AnObject
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 interfaceContainerServices
- Parameters:
name
- AString
which identifies the name of the attribute.value
- AnObject
representing the value of a named attribute.namespace
- AContainerServicesNamespace
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 interfaceContainerServices
- Parameters:
cookie
- TheGenericCookie
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 interfaceContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- Returns:
- HTTP session ID
-
getMethod
public java.lang.String getMethod()
Returns request method, post/get is expected.- Specified by:
getMethod
in interfaceContainerServices
- Returns:
- request method
- Since:
- MicroStrategy Web 9.2.2
-
getControllerName
protected java.lang.String getControllerName()
- Specified by:
getControllerName
in classAbstractConfigurableContainerServices
- Since:
- MicroStrategy Web 9.0.0
-
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 interfaceContainerServices
- Parameters:
mo
- markup outpu containing binary image
-
setContentType
public void setContentType(java.lang.String value)
Stes HTTP response content type- Specified by:
setContentType
in interfaceContainerServices
- Parameters:
value
- content type
-
setHeaderValue
public void setHeaderValue(java.lang.String headerName, java.lang.String headerValue)
Sets HTTP response header- Specified by:
setHeaderValue
in interfaceContainerServices
- Parameters:
headerName
- header nameheaderValue
- 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 interfaceDisconnectedContainerServices
- Parameters:
name
- parameter name.value
- parameter value.
-
setQueryString
public void setQueryString(java.lang.String queryString)
Sets HTTP request query string- Specified by:
setQueryString
in interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- Parameters:
remoteAddress
- IP address
-
setSessionID
public void setSessionID(java.lang.String sessionID)
Sets the HTTP session ID- Specified by:
setSessionID
in interfaceDisconnectedContainerServices
- Parameters:
sessionID
- HTTP session ID
-
setMethod
public void setMethod(java.lang.String method)
Sets the request method- Specified by:
setMethod
in interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- Returns:
- number of request attributes.
-
getRequestAttributeName
public java.lang.String getRequestAttributeName(int index)
Returns requst attribute name- Specified by:
getRequestAttributeName
in interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- Returns:
- number of session attributes.
-
getSessionAttributeName
public java.lang.String getSessionAttributeName(int i)
Returns session attribute name- Specified by:
getSessionAttributeName
in interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- Parameters:
name
- header namevalue
- 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 interfaceDisconnectedContainerServices
- Parameters:
nativeCookieName
- The native cookie name used in browsernativeCookieValue
- The native cookie value stored in browser
-
getContentType
public java.lang.String getContentType()
Returns response content type- Specified by:
getContentType
in interfaceDisconnectedContainerServices
- Returns:
- response content type
-
getResponseHeadersCount
public int getResponseHeadersCount()
Returns number of response headers- Specified by:
getResponseHeadersCount
in interfaceDisconnectedContainerServices
- Returns:
- number of response headers
-
getResponseHeaderName
public java.lang.String getResponseHeaderName(int index)
Returns response header name- Specified by:
getResponseHeaderName
in interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- Parameters:
request
- a byte array containing entire HTTP request- Throws:
java.io.IOException
-
getGlobalContext
public AppGlobalContext getGlobalContext()
Returns the global context held by this services.- Specified by:
getGlobalContext
in interfaceDisconnectedContainerServices
- Returns:
- an AppGlobalContext. If there has no AppGlobalContext been set to
this object,
nulll
will be returned.
-
setGlobalContext
public void setGlobalContext(AppGlobalContext globalContext)
Sets current application global context.- Specified by:
setGlobalContext
in interfaceDisconnectedContainerServices
- Parameters:
globalContext
- is anAppGlobalContext
object.
-
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 interfaceContainerServices
- 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 interfaceContainerServices
- Parameters:
name
- the name of an attribute.namespace
- AContainerServicesNamespace
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 interfaceDisconnectedContainerServices
- Returns:
- number of Application attributes.
-
getApplicationAttributeName
public java.lang.String getApplicationAttributeName(int index)
Returns application attribute name- Specified by:
getApplicationAttributeName
in interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- Parameters:
name
- AString
which identifies the name of the attribute.value
- AnObject
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 interfaceContainerServices
- 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 interfaceContainerServices
- 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.
-
getErrorCode
public int getErrorCode()
Returns the error status code for response.- Specified by:
getErrorCode
in interfaceDisconnectedContainerServices
- Returns:
- The error status code. We reuse HTTP status code "OK" (200) to mean no error.
- See Also:
sendError(int)
,sendError(int, String)
-
getErrorMessage
public java.lang.String getErrorMessage()
Returns the error message for response.- Specified by:
getErrorMessage
in interfaceDisconnectedContainerServices
- Returns:
- The error message. If no error message, empty string will be returned.
- See Also:
sendError(int)
,sendError(int, String)
-
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 interfaceContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- Parameters:
value
-true
if cookieless environment is supported- Since:
- MicroStrategy Web 7.5.0
-
getServerVariables
public ContainerStringCollection getServerVariables()
Returns a collection of server variables.- Specified by:
getServerVariables
in interfaceContainerServices
- Returns:
- a collection of server variables.
- Since:
- MicroStrategy Web 7.5.4
-
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 interfaceDisconnectedContainerServices
- 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 interfaceDisconnectedContainerServices
- 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 interfaceContainerServices
- 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 interfaceContainerServices
- Parameters:
statusCode
- the HTTP Status code specified for this response.- Since:
- MicroStrategy Web 9.0.0
-
getCookies
protected HashList getCookies(ContainerServicesNamespace namespace)
Return the a collection of GenericCookie objects from the request cookies.- Specified by:
getCookies
in classAbstractConfigurableContainerServices
- Since:
- MicroStrategy Web 8.0.2
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Specified by:
getOutputStream
in interfaceContainerServices
- Since:
- MicroStrategy Web 9.0.0
-
hasOutputStream
public boolean hasOutputStream()
- Specified by:
hasOutputStream
in interfaceContainerServices
- 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 interfaceContainerServices
- 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 interfaceDisconnectedContainerServices
- Since:
- MicroStrategy Web 9.0.0
-
getResource
public java.net.URL getResource(java.lang.String relPath)
Description copied from interface:ContainerServicesContext
Returns theURL
associated with the given resource path. If the resource does not exist, null is returned (i.e. it cannot return a path to a newFile
). Note that manyURL
implementations are read-only.- Specified by:
getResource
in interfaceContainerServicesContext
- 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 interfaceContainerServicesContext
- 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 interfaceContainerServicesContext
- Returns:
- the context path.
- Since:
- MicroStrategy Web 9.0.1
-
isSessionlessRequest
public boolean isSessionlessRequest()
Description copied from interface:ContainerServices
Does the request has a pre-established session id.- Specified by:
isSessionlessRequest
in interfaceContainerServices
-
getCreateNewSessionValue
public boolean getCreateNewSessionValue()
Description copied from interface:DisconnectedContainerServices
Gets a boolean value indicating whether create a new http session- Specified by:
getCreateNewSessionValue
in interfaceDisconnectedContainerServices
-
setCreateNewSessionValue
public void setCreateNewSessionValue(boolean value)
Description copied from interface:DisconnectedContainerServices
Sets a boolean indicating whether create a new http session- Specified by:
setCreateNewSessionValue
in interfaceDisconnectedContainerServices
-
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 interfaceContainerServices
-
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 interfaceContainerServices
-
-