Package com.microstrategy.web.platform
Class AbstractConfigurableContainerServices
- java.lang.Object
-
- com.microstrategy.web.platform.AbstractConfigurableContainerServices
-
- All Implemented Interfaces:
ContainerServices
,ContainerServicesContext
- Direct Known Subclasses:
DisconnectedContainerServicesImpl
,HttpServletContainerServices
public abstract class AbstractConfigurableContainerServices extends java.lang.Object implements ContainerServices
This abstract class provides method implementations fornewURIParameterBuilder()
,newHiddenInputParameterBuilder()
andnewNamespaceEncoder()
. It provides these implementations based on a configuration file accessed as the resource called ContainerServices (e.g., ContainerServices.properties). If present, it reads the file and uses its contents to determine which classes are instantiated. It currently searches for entries named:- uriBuilder.class
- hiddenInputBuilder.class
- namespaceEncoder.class
DefaultURIBuilderImpl
,DefaultHiddenInputBuilderImpl
andEmptyNamespaceEncoderImpl
, respectively.- Since:
- MicroStrategy Web 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractConfigurableContainerServices.AbstractContainerStringCollection
Abstract class for string collection classes.protected class
AbstractConfigurableContainerServices.CookieWrapper
A implementation of GenericCookies.
-
Field Summary
Fields Modifier and Type Field Description protected static boolean
_prependSlashToResource
static java.lang.String
APPLICATION_PARAMETERS_XML_PATH
static java.lang.String
WEB_XML_PATH
-
Fields inherited from interface com.microstrategy.web.platform.ContainerServices
SPNEGO_CREDENTIAL
-
-
Constructor Summary
Constructors Constructor Description AbstractConfigurableContainerServices()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
decrypt(java.lang.String encryptedData)
java.lang.String
encrypt(java.lang.String clearData)
ApplicationParameters
getApplicationParameters()
Returns the an ApplicationParameters instance that includes all the parameters defined in the microstrategy.xml or web.xml fileprotected abstract java.lang.String
getControllerName()
java.lang.String
getControllerParameter(java.lang.String paramName, java.lang.String controllerName)
Returns initialization parameter value for the given controller.GenericCookie
getCookie(java.lang.String name)
This method retrieves a platform-independent Cookie with a specific name.GenericCookie
getCookie(java.lang.String name, ContainerServicesNamespace namespace)
This method retrieves a platform-independent Cookie with a specific name.protected static ContainerServicesNamespace
getCookieNamespace()
Returns the namespace object for Cookies.protected int
getCookieNamespaceCapacity()
Returns the namespace capacity for cookies.protected abstract HashList
getCookies(ContainerServicesNamespace namespace)
java.lang.String
getInitParameter(java.lang.String paramName)
Returns initialization parameter value for the controller associated with this ContainerServices.java.util.Enumeration
getInitParameterNames()
Returns enumeration of initialization parameter namesprotected java.lang.String
getNamespacePrefix()
protected java.lang.String
getNamespaceValue(ContainerServicesNamespace namespace)
Get the namespace value.protected static java.lang.String
getRealName(java.lang.String nativeName)
Get the real name from native name.protected ContainerServicesNamespace
getSessionNamespace()
Returns the namespace object for sessions.protected int
getSessionNamespaceCapacity()
return the capacity of namespace of session.protected static void
initFromPropertiesFile()
void
initGlobalObjects()
Initializes global instances, like FileLoader and Plugins, using this ContainerServices instance.boolean
isEncryptedByRedirect(java.lang.String name)
boolean
isEncryptedParameter(java.lang.String name)
protected static boolean
isNamespacedName(java.lang.String nativeName)
Check if the native name is namespaced name.boolean
isQueryParam(java.lang.String pName)
Returns a boolean indicating whether the input parameter is found in the queryGenericCookie
newCookie(java.lang.String cookieName, java.lang.String cookieValue)
This method creates a new platform-independent Cookie.GenericCookie
newCookie(java.lang.String cookieName, java.lang.String cookieValue, ContainerServicesNamespace namespace)
This method creates a new platform-independent Cookie.ParameterBuilder
newHiddenInputParameterBuilder()
Create a new instance of a ParameterBuilder that is suited for building hidden inputs.NamespaceEncoder
newNamespaceEncoder()
Create a new instance of a NamespaceEncoder that can provide global namespace support.ParameterBuilder
newURIParameterBuilder()
Create a new instance of a ParameterBuilder that is suited for building URIs.protected static boolean
useNamespace(ContainerServicesNamespace namespace)
Indicates wheter to use namespacestatic boolean
useNamespaceInCookie()
Returns if there is a namespace used for cookies.-
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
addCookieToResponse, getApplicationAttribute, getApplicationPath, getCodePage, getCookieStrings, getCookieStrings, getFormAndQueryStrings, getHeaderValue, getMethod, getOutputStream, getPostedFile, getQueryString, getRemoteAddress, getRequestAttribute, getRequestServerName, getServerVariables, getSessionAttribute, getSessionAttribute, getSessionID, getSessionMaxIdleTime, getSessionStrings, getSessionStrings, getStatusCode, hasOutputStream, invalidateHttpSession, isJavaURLSessionSupported, isRequestSecure, isSessionlessRequest, sendBinaryContent, sendError, sendError, setApplicationAttribute, setCodePage, setContentType, setHeaderValue, setJavaURLSessionSupported, setRequestAttribute, setSessionAttribute, setSessionAttribute, setStatusCode
-
Methods inherited from interface com.microstrategy.web.platform.ContainerServicesContext
getContextPath, getRealPath, getResource, getResourceAsStream, getResourcePaths
-
-
-
-
Field Detail
-
_prependSlashToResource
protected static boolean _prependSlashToResource
-
WEB_XML_PATH
public static final java.lang.String WEB_XML_PATH
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
APPLICATION_PARAMETERS_XML_PATH
public static final java.lang.String APPLICATION_PARAMETERS_XML_PATH
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
initFromPropertiesFile
protected static void initFromPropertiesFile()
- Since:
- MicroStrategy Web 9.0.0
-
getInitParameterNames
public java.util.Enumeration getInitParameterNames()
Description copied from interface:ContainerServicesContext
Returns enumeration of initialization parameter names- Specified by:
getInitParameterNames
in interfaceContainerServicesContext
- Returns:
- enumeration of initialization parameter names
- Since:
- MicroStrategy Web 9.0.0
-
getInitParameter
public java.lang.String getInitParameter(java.lang.String paramName)
Description copied from interface:ContainerServicesContext
Returns initialization parameter value for the controller associated with this ContainerServices. If no controller has been associated, it returns a global value. This value is typically read from the microstrategy.xml or web.xml file. This value is read from theContainerServicesContext.getApplicationParameters()
- Specified by:
getInitParameter
in interfaceContainerServicesContext
- Parameters:
paramName
- parameter name- Returns:
- parameter value
- Since:
- MicroStrategy Web 9.0.0
-
getControllerParameter
public java.lang.String getControllerParameter(java.lang.String paramName, java.lang.String controllerName)
Description copied from interface:ContainerServicesContext
Returns initialization parameter value for the given controller. This value is typically read from the microstrategy.xml or web.xml file- Specified by:
getControllerParameter
in interfaceContainerServicesContext
- Parameters:
paramName
- parameter namecontrollerName
- Name that identifies the controller (e.g. mstrWeb, mstrWebAdmin).null
for global paramters.- Returns:
- parameter value
- Since:
- MicroStrategy Web 9.0.0
-
getApplicationParameters
public ApplicationParameters getApplicationParameters()
Description copied from interface:ContainerServicesContext
Returns the an ApplicationParameters instance that includes all the parameters defined in the microstrategy.xml or web.xml file- Specified by:
getApplicationParameters
in interfaceContainerServicesContext
- Since:
- MicroStrategy Web 9.0.0
-
getControllerName
protected abstract java.lang.String getControllerName()
- Since:
- MicroStrategy Web 9.0.0
-
initGlobalObjects
public void initGlobalObjects()
Description copied from interface:ContainerServicesContext
Initializes global instances, like FileLoader and Plugins, using this ContainerServices instance.- Specified by:
initGlobalObjects
in interfaceContainerServicesContext
- Since:
- MicroStrategy Web 9.0.0
-
isNamespacedName
protected static boolean isNamespacedName(java.lang.String nativeName)
Check if the native name is namespaced name.- Parameters:
nativeName
- The native name. In namespace mode, it contains a special MicroStrategy prefix.- Returns:
- Ture, if it contains MicorStrategy Namespace prefix. Otherwise return false.
- Since:
- MicroStrategy Web 8.0.2
-
getRealName
protected static java.lang.String getRealName(java.lang.String nativeName)
Get the real name from native name.- Parameters:
nativeName
- The native name. In namespace mode, it contains a special MicroStrategy prefix.- Returns:
- The name without MicroStrategy prefix.
- Since:
- MicroStrategy Web 8.0.2
-
newURIParameterBuilder
public ParameterBuilder newURIParameterBuilder()
Create a new instance of a ParameterBuilder that is suited for building URIs.- Specified by:
newURIParameterBuilder
in interfaceContainerServices
- Returns:
- An instance of a ParameterBuilder that generates URIs.
-
newHiddenInputParameterBuilder
public ParameterBuilder newHiddenInputParameterBuilder()
Create a new instance of a ParameterBuilder that is suited for building hidden inputs.- Specified by:
newHiddenInputParameterBuilder
in interfaceContainerServices
- Returns:
- An instance of a ParameterBuilder that generates a string of hidden inputs.
-
newNamespaceEncoder
public NamespaceEncoder newNamespaceEncoder()
Create a new instance of a NamespaceEncoder that can provide global namespace support.- Specified by:
newNamespaceEncoder
in interfaceContainerServices
- Returns:
- An instance of a NamespaceEncoder that should be used for global namespacing.
-
useNamespace
protected static boolean useNamespace(ContainerServicesNamespace namespace)
Indicates wheter to use namespace- Parameters:
namespace
- AContainerServicesNamespace
object indecates the namespace requirement.- Returns:
- ture if namespace is not null, and namespace.useNamespace() returns ture.
- Since:
- MicroStrategy Web 8.0.2
-
getCookieNamespace
protected static ContainerServicesNamespace getCookieNamespace()
Returns the namespace object for Cookies. The settings are defined in ContainerServices.properties file.- Since:
- MicroStrategy Web 8.0.2
-
useNamespaceInCookie
public static boolean useNamespaceInCookie()
Returns if there is a namespace used for cookies. It is defined in ContainerServices.properties file.
-
getCookieNamespaceCapacity
protected int getCookieNamespaceCapacity()
Returns the namespace capacity for cookies. It is defined in ContainerServices.properties file.- Since:
- MicroStrategy Web 8.0.2
-
getSessionNamespaceCapacity
protected int getSessionNamespaceCapacity()
return the capacity of namespace of session.- Since:
- MicroStrategy Web 8.0.2
-
getSessionNamespace
protected ContainerServicesNamespace getSessionNamespace()
Returns the namespace object for sessions. The settings are defined in ContainerServices.properties file.- Since:
- MicroStrategy Web 8.0.2
-
getNamespaceValue
protected java.lang.String getNamespaceValue(ContainerServicesNamespace namespace)
Get the namespace value.- Since:
- MicroStrategy Web 8.0.2
-
isEncryptedParameter
public boolean isEncryptedParameter(java.lang.String name)
- Since:
- MicroStrategy Web 9.0.0
-
isEncryptedByRedirect
public boolean isEncryptedByRedirect(java.lang.String name)
-
encrypt
public java.lang.String encrypt(java.lang.String clearData)
- Since:
- MicroStrategy Web 9.0.0
-
decrypt
public java.lang.String decrypt(java.lang.String encryptedData)
- Since:
- MicroStrategy Web 9.0.0
-
newCookie
public GenericCookie newCookie(java.lang.String cookieName, java.lang.String cookieValue)
Description copied from interface:ContainerServices
This method creates a new platform-independent Cookie. It is not yet associated with the current Response object.- Specified by:
newCookie
in interfaceContainerServices
- Parameters:
cookieName
- AString
which identifies the name of the cookie.cookieValue
- AString
representing the value of the cookie.- Returns:
- A
GenericCookie
containing the name/value pair supplied - Since:
- MicroStrategy Web 8.0.2
-
newCookie
public GenericCookie newCookie(java.lang.String cookieName, java.lang.String cookieValue, ContainerServicesNamespace namespace)
Description copied from interface:ContainerServices
This method creates a new platform-independent Cookie. It is not yet associated with the current Response object.- Specified by:
newCookie
in interfaceContainerServices
- Parameters:
cookieName
- AString
which identifies the name of the cookie.cookieValue
- AString
representing the value of the cookie.namespace
- AContainerServicesNamespace
object representing the namespace requirement. If null, no namespace is used.- Returns:
- A
GenericCookie
containing the name/value pair supplied - Since:
- MicroStrategy Web 8.0.2
-
getCookie
public GenericCookie getCookie(java.lang.String name)
Description copied from interface:ContainerServices
This method retrieves a platform-independent Cookie with a specific name.- Specified by:
getCookie
in interfaceContainerServices
- Parameters:
name
- AString
which identifies the name of the cookie.- Returns:
- A
GenericCookie
for the name supplied. If no cookie exists with this name, anull
pointer is returned. - Since:
- MicroStrategy Web 8.0.2
-
getCookie
public GenericCookie getCookie(java.lang.String name, ContainerServicesNamespace namespace)
Description copied from interface:ContainerServices
This method retrieves a platform-independent Cookie with a specific name.- Specified by:
getCookie
in interfaceContainerServices
- Parameters:
name
- AString
which identifies the name of the cookie.namespace
- AContainerServicesNamespace
object represention the namespace requirement.- Returns:
- A
GenericCookie
for the name supplied. If no cookie exists with this name, anull
pointer is returned. - Since:
- MicroStrategy Web 8.0.2
-
getCookies
protected abstract HashList getCookies(ContainerServicesNamespace namespace)
- Since:
- MicroStrategy Web 8.0.2
-
getNamespacePrefix
protected java.lang.String getNamespacePrefix()
- Since:
- MicroStrategy Web 8.0.2
-
isQueryParam
public boolean isQueryParam(java.lang.String pName)
Description copied from interface:ContainerServices
Returns a boolean indicating whether the input parameter is found in the query- Specified by:
isQueryParam
in interfaceContainerServices
- Parameters:
pName
- name of the parameter to be searched in query- Returns:
- true if query contains the parameter name (case-insensitive search) passed as input with a non-empty value
-
-