Class PluginServletActionParams
- java.lang.Object
-
- de.xima.fc.plugin.models.params.servlet.PluginServletActionParams
-
- All Implemented Interfaces:
IPluginParameters
,IPluginServletActionParams
,Serializable
public class PluginServletActionParams extends Object implements IPluginServletActionParams
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PluginServletActionParams.Builder
-
Constructor Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PluginServletActionParams.Builder
builder()
EServletAction
getAction()
String
getBaseUrl()
Returns the HTTP request base URL.Benutzer
getBenutzer()
Deprecated.UsegetUser()
instead.String
getContextPath()
Returns the portion of the request URI that indicates the context of the request.FrontendServer
getFrontendServer()
Map<Serializable,Serializable>
getFrqSessionAttributes()
Gets the values stored in the currentFRQSession
.String
getFrqSessionId()
Gets the ID of the current form request session, if such a session exists.Map<String,String>
getHeaderMap()
Locale
getLocale()
Mandant
getPluginClient()
String
getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request.Map<String,List<String>>
getRequestParameters()
The parameters from the HTTP request.String
getRequestUri()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.String
getRequestUrl()
Reconstructs the URL the client used to make the request.Map<String,Serializable>
getSessionAttributeMap()
Deprecated.SessionAttributes
getSessionAttributes()
Deprecated.String
getSessionID()
Map<String,List<FileData>>
getUploadFiles()
IUser
getUser()
ValueParameters
getValueParameters()
Deprecated.
-
-
-
Constructor Detail
-
PluginServletActionParams
@Deprecated public PluginServletActionParams(Map<String,Serializable> httpSessionAttributes, Map<Serializable,Serializable> frqSessionAttributes, Map<String,List<String>> valueParameter, Map<String,List<FileData>> uploadFiles, IUser user, Locale locale, EServletAction action, Map<String,String> headerMap, FrontendServer fs, Mandant client, String sessionId)
Deprecated.Usebuilder()
.Constructor for creating a parameters object with all necessary request data- Parameters:
httpSessionAttributes
- attributes from the current HTTP sessionfrqSessionAttributes
- Attributes from the current form request session, if any.valueParameter
- request parameteruploadFiles
- Files that were sent with the request.user
- the current logged in user that sent the formlocale
- the currently set localaction
- an enumeration representing the HTTP method of the requestheaderMap
- request header fieldsfs
- theFrontendServer
that sent the requestclient
- The client context, may benull
for a system plugin.sessionId
- ID of the current session, may benull
or empty when no session exists.
-
PluginServletActionParams
@Deprecated public PluginServletActionParams(Map<String,Serializable> httpSessionAttributes, Map<Serializable,Serializable> frqSessionAttributes, Map<String,List<String>> valueParameter, Map<String,List<FileData>> uploadFiles, Benutzer user, Locale locale, EServletAction action, Map<String,String> headerMap, FrontendServer fs, Mandant client, String sessionId)
Deprecated.Constructor for creating a parameters object with all necessary request data- Parameters:
httpSessionAttributes
- attributes from the current HTTP sessionfrqSessionAttributes
- Attributes from the current form request session, if any.valueParameter
- request parameteruploadFiles
- Files that were sent with the request.user
- the current logged in user that sent the formlocale
- the currently set localaction
- an enumeration representing the HTTP method of the requestheaderMap
- request header fieldsfs
- theFrontendServer
that sent the requestclient
- The client context, may benull
for a system plugin.sessionId
- ID of the current session, may benull
or empty when no session exists.
-
PluginServletActionParams
@Deprecated public PluginServletActionParams(SessionAttributes sessionAttributes, HashMap<String,List<String>> valueParameter, HashMap<String,List<FileData>> uploadFiles, Locale locale, EServletAction action, Map<String,String> headerMap, FrontendServer fs)
Deprecated.Constructor for creating a parameters object with all necessary request data- Parameters:
sessionAttributes
- attributes from the current sessionvalueParameter
- request parameteruploadFiles
- Files that were sent with the request.locale
- the currently set localaction
- an enumeration representing the HTTP method of the requestheaderMap
- request header fieldsfs
- theFrontendServer
that sent the request
-
PluginServletActionParams
@Deprecated public PluginServletActionParams(Map<String,Serializable> sessionAttributes, Map<String,List<String>> valueParameter, Map<String,List<FileData>> uploadFiles, Benutzer benutzer, Locale locale, EServletAction action, Map<String,String> headerMap, FrontendServer fs, Mandant client, String sessionId)
Deprecated.Constructor for creating a parameters object with all necessary request data- Parameters:
sessionAttributes
- attributes from the current sessionvalueParameter
- request parameteruploadFiles
- Files that were sent with the request.benutzer
- the current logged in user that sent the formlocale
- the currently set localaction
- an enumeration representing the HTTP method of the requestheaderMap
- request header fieldsfs
- theFrontendServer
that sent the requestclient
- The client context, may benull
for a system plugin.sessionId
- ID of the current session, may benull
or empty when no session exists.
-
PluginServletActionParams
@Deprecated public PluginServletActionParams(Map<String,Serializable> sessionAttributes, Map<String,List<String>> valueParameter, Map<String,List<FileData>> uploadFiles, Benutzer benutzer, Locale locale, EServletAction action, Map<String,String> headerMap, FrontendServer fs)
Deprecated.- Parameters:
sessionAttributes
- attributes from the current sessionvalueParameter
- request parameteruploadFiles
- files that are overhanded by the requestbenutzer
- the current logged in user that sent the formlocale
- the currently set localaction
- an enumeration representing the HTTP method of the requestheaderMap
- request header fieldsfs
- theFrontendServer
that sent the request
-
-
Method Detail
-
getRequestParameters
public Map<String,List<String>> getRequestParameters()
Description copied from interface:IPluginServletActionParams
The parameters from the HTTP request. This includes both URL parameters as well as POST parameters, but excluded uploaded files. Please note that multiple values may have been given for a URL or POST parameter, eg.http://example.com?foo=bar&foo=baz
. Also, for some HTTP methods such asEServletAction.DELETE
, you may have to parse the HTTP request body yourself.- Specified by:
getRequestParameters
in interfaceIPluginServletActionParams
- Returns:
- A
Map
with the parameters from theHttpServletRequest
. - See Also:
IPluginServletActionParams.getUploadFiles()
-
getUploadFiles
public Map<String,List<FileData>> getUploadFiles()
- Specified by:
getUploadFiles
in interfaceIPluginServletActionParams
- Returns:
- A
Map
between the name of an upload form element and the file(s) that were uploaded for that upload element.
-
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interfaceIPluginServletActionParams
- Returns:
- The current
Locale
of the request; or the default locale in case no locale could be determined.
-
getUser
public IUser getUser()
- Specified by:
getUser
in interfaceIPluginServletActionParams
- Returns:
- the user who called the servlet action plugin.
-
getAction
public EServletAction getAction()
- Specified by:
getAction
in interfaceIPluginServletActionParams
- Returns:
- The HTTP method of the servlet request.
-
getHeaderMap
public Map<String,String> getHeaderMap()
- Specified by:
getHeaderMap
in interfaceIPluginServletActionParams
- Returns:
- A
Map
that contains the HTTP header parameters. The map is case-insensitive, i.e. you can access a header with the key"Content-Type"
as well as"content-type"
etc.
-
getFrontendServer
public FrontendServer getFrontendServer()
- Specified by:
getFrontendServer
in interfaceIPluginServletActionParams
- Returns:
- The current
FrontendServer
to which the servlet request was made, ornull
if the request was made directly to the master server.
-
getSessionID
public String getSessionID()
- Specified by:
getSessionID
in interfaceIPluginServletActionParams
- Returns:
- The session ID for the user who is currently logged in; or
null
in case no session ID is available (which may happen, for example, when the user is not logged in).
-
getRemoteAddr
public String getRemoteAddr()
Description copied from interface:IPluginServletActionParams
Returns the Internet Protocol (IP) address of the client that sent the request. This will first check theForwarded
andX-Forwarded-For
request headers and if any is present, then return its first IP address, else just returnServletRequest.getRemoteAddr()
unmodified.- Specified by:
getRemoteAddr
in interfaceIPluginServletActionParams
- Returns:
- The IP address of the client.
- See Also:
ServletRequest.getRemoteAddr()
-
getPluginClient
public Mandant getPluginClient()
- Specified by:
getPluginClient
in interfaceIPluginServletActionParams
- Returns:
- The
Mandant
to which the servlet action plugin belongs to; ornull
in case the plugin was installed as a system plugin and no client was provided in the servlet action URL.
-
getFrqSessionAttributes
public Map<Serializable,Serializable> getFrqSessionAttributes()
Description copied from interface:IPluginServletActionParams
Gets the values stored in the currentFRQSession
. The servlet plugin may be executed on a different server that does not have direct access to the HTTP request: Please note that changes to this map are NOT reflected or saved in theFRQSession
. To modify the FRQ session attributes, use theIPluginServletActionRetVal.getFrqSessionAttributeMap()
return value.- Specified by:
getFrqSessionAttributes
in interfaceIPluginServletActionParams
- Returns:
- Attributes from the form request session of the current request. If no such session exists, this is an empty map.
- See Also:
IPluginServletActionParams.getFrqSessionId()
-
getFrqSessionId
public String getFrqSessionId()
Description copied from interface:IPluginServletActionParams
Gets the ID of the current form request session, if such a session exists.- Specified by:
getFrqSessionId
in interfaceIPluginServletActionParams
- Returns:
- The ID of the current FRQ (form request) session, if such a session exists.
- See Also:
IPluginServletActionParams.getFrqSessionAttributes()
-
getContextPath
public String getContextPath()
Description copied from interface:IPluginServletActionParams
Returns the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "". The container does not decode this string.It is possible that a servlet container may match a context by more than one context path. In such cases this method will return the actual context path used by the request and it may differ from the path returned by the
ServletContext.getContextPath()
method. The context path returned byServletContext.getContextPath()
should be considered as the prime or preferred context path of the application.- Specified by:
getContextPath
in interfaceIPluginServletActionParams
- Returns:
- a
String
specifying the portion of the request URI that indicates the context of the request - See Also:
HttpServletRequest.getContextPath()
-
getRequestUri
public String getRequestUri()
Description copied from interface:IPluginServletActionParams
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. The web container does not decode this String. For example:First line of HTTP request Returned Value POST /some/path.html HTTP/1.1 /some/path.html GET http://foo.bar/a.html HTTP/1.0 /a.html HEAD /xyz?a=b HTTP/1.1 /xyz To reconstruct an URL with a scheme and host, use
HttpUtils.getRequestURL(javax.servlet.http.HttpServletRequest)
.- Specified by:
getRequestUri
in interfaceIPluginServletActionParams
- Returns:
- a
String
containing the part of the URL from the protocol name up to the query string - See Also:
HttpServletRequest.getRequestURI()
-
getRequestUrl
public String getRequestUrl()
Description copied from interface:IPluginServletActionParams
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.If this request has been forwarded using
RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
, the server path in the reconstructed URL must reflect the path used to obtain the RequestDispatcher, and not the server path specified by the client.- Specified by:
getRequestUrl
in interfaceIPluginServletActionParams
- Returns:
- a
StringBuffer
object containing the reconstructed URL - See Also:
HttpServletRequest.getRequestURL()
-
getBaseUrl
public String getBaseUrl()
Description copied from interface:IPluginServletActionParams
Returns the HTTP request base URL. This is the URL from the scheme, domain until with context path, including the trailing slash. This is the value you could use in HTML<base>
tag in an XHTML view.- Specified by:
getBaseUrl
in interfaceIPluginServletActionParams
- Returns:
- The HTTP request base URL.
- See Also:
HttpServletRequest.getRequestURI()
,HttpServletRequest.getRequestURL()
,HttpServletRequest.getContextPath()
-
getBenutzer
@Deprecated public Benutzer getBenutzer()
Deprecated.UsegetUser()
instead.- Specified by:
getBenutzer
in interfaceIPluginServletActionParams
- Returns:
- The
Benutzer
from the currentXfcSession
who called the servlet action plugin.
-
getSessionAttributeMap
@Deprecated public Map<String,Serializable> getSessionAttributeMap()
Deprecated.Description copied from interface:IPluginServletActionParams
Gets the values from the currentHttpSession
. The servlet plugin may be executed on a different server that does not have direct access to the HTTP request: Please note that changes to this map are NOT reflected or saved in theHttpSession
. To modify the session attributes, use theIPluginServletActionRetVal.getSessionAttributeMap()
return value.- Specified by:
getSessionAttributeMap
in interfaceIPluginServletActionParams
- Returns:
- A map
Map
with all attributes of the currentHttpSession
.
-
getSessionAttributes
@Deprecated public SessionAttributes getSessionAttributes()
Deprecated.- Specified by:
getSessionAttributes
in interfaceIPluginServletActionParams
- Returns:
- All serializable session attributes.
-
getValueParameters
@Deprecated public ValueParameters getValueParameters()
Deprecated.- Specified by:
getValueParameters
in interfaceIPluginServletActionParams
- Returns:
- All serializable session attributes.
-
builder
public static PluginServletActionParams.Builder builder()
-
-