public class AristaFlowHTTPService extends javax.servlet.http.HttpServlet implements HTTPService
| Modifier and Type | Field and Description |
|---|---|
protected java.util.logging.Logger |
logger
My logger.
|
protected java.util.Map<java.lang.String,HTTPReplyHandler> |
replyHandlers
The reply handlers to which HTTP-requests are forwarded after the decoding.
|
protected java.lang.String |
servletName
The name of the servlet if dynamically deployed,
null
otherwise. |
protected java.util.Map<java.util.UUID,java.lang.String> |
sessions
Own session IDs.
|
| Constructor and Description |
|---|
AristaFlowHTTPService()
Constructor for initialisation via Extension Point (must not have any
parameters).
|
AristaFlowHTTPService(java.lang.String servletName)
Constructor providing a servlet name for dynamic servlet deployment.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deregisterReplyHandler(SessionToken session,
java.lang.String sessionID)
Deregisters a reply handler for the activity with the designated
sessionID. |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response) |
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response) |
protected java.util.List<java.lang.String> |
getListValue(java.lang.Object o)
Returns the string list value for the given object, or null if the object
is not a representation of a list-valued string value.
|
java.net.URI[] |
getLocalUris() |
protected void |
getParameterAttachments(java.util.List<FileItem> items,
java.util.Map<java.lang.String,HTMLContext.Attachment> attachments,
java.util.Map<java.lang.String,java.util.List<HTMLContext.Attachment>> attachmentLists)
Fills
attachments and attachmentLists with
the attachment parameters and the list-valued attachment parameters. |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getParameterLists(HttpServletRequest request)
Retrieves all list-valued parameters from the request and returns them as
map.
|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getParameterLists(java.util.List<FileItem> items)
Returns all list valued string parameters.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getParameters(HttpServletRequest request)
Retrieves all non-list-valued and non-attachment parameters from the
request and returns them as map.
|
protected java.util.Map<java.lang.String,java.lang.String> |
getParameters(java.util.List<FileItem> items)
Returns all non-list-valued string parameters.
|
<any> |
getRelease()
This service is started outside of the platform and therefore does not support the methods of
ADEPT2Service. |
java.lang.String[] |
getRuntimeRequiredServices() |
<any> |
getServiceInstanceName()
This service is started outside of the platform and therefore does not support the methods of
ADEPT2Service. |
java.lang.String |
getServletName() |
java.lang.String[] |
getStartupRequiredServices() |
protected java.lang.String |
getStringValue(java.lang.Object o)
Returns the string value for the given object, or null if the object
is not a representation of a (non-list-valued) string value.
|
java.net.URI[] |
getURIs() |
void |
init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
Not forwarded since no client component should control the service.
|
long |
ping() |
void |
preShutdown(boolean emergency)
Not forwarded since no client component should control the service.
|
void |
registerReplyHandler(SessionToken session,
java.lang.String sessionID,
HTTPReplyHandler replyHandler)
Registers a reply handler for the activity with the designated
sessionID. |
void |
servletDeployed(ServletContext context,
java.lang.String urlPattern) |
void |
servletUndeployed(ServletContext context) |
void |
setURL(java.net.URL myURL)
Set the URL to be used for the HTML contexts.
|
void |
shutdown(boolean emergency)
Not forwarded since no client component should control the service.
|
void |
start()
Not forwarded since no client component should control the service.
|
protected final transient java.util.logging.Logger logger
protected final java.util.Map<java.lang.String,HTTPReplyHandler> replyHandlers
protected final java.util.Map<java.util.UUID,java.lang.String> sessions
protected java.lang.String servletName
null
otherwise.public AristaFlowHTTPService()
public AristaFlowHTTPService(java.lang.String servletName)
servletName - The name of the servlet if dynamically deployed,
null otherwise.public void setURL(java.net.URL myURL)
myURL - protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
java.io.IOException
ServletExceptionjava.io.IOExceptionprotected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
java.io.IOException
ServletExceptionjava.io.IOExceptionpublic void deregisterReplyHandler(SessionToken session,
java.lang.String sessionID)
HTTPServicesessionID. A reply handler may be deregistered any time. In
case a reply handling is currently running, it will be allowed to finish.deregisterReplyHandler in interface HTTPServicesession - The session which is used to check for access rights on this
method.sessionID - The session ID identifying the executed activity and
therefore also the handler for the reply sent via HTTP.public void registerReplyHandler(SessionToken session,
java.lang.String sessionID,
HTTPReplyHandler replyHandler)
throws java.net.MalformedURLException
HTTPServicesessionID. This creates an own URL for the reply handler.
It will be called as soon as a HTTP-request (the reply for the activity) is
received by this HTTP-service.registerReplyHandler in interface HTTPServicesession - The session which is used to check for access rights on this
method.sessionID - The session ID for the executed activity. It is used to
create an appropriate URL.replyHandler - The handler for the HTTP-replies sent to this service.java.net.MalformedURLException - If the designated sessionID does not allow to
create a valid URL, a MalformedURLException will
be thrown.protected java.util.Map<java.lang.String,java.lang.String> getParameters(HttpServletRequest request)
request - protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterLists(HttpServletRequest request)
request - protected java.util.Map<java.lang.String,java.lang.String> getParameters(java.util.List<FileItem> items)
items - protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameterLists(java.util.List<FileItem> items)
items - protected void getParameterAttachments(java.util.List<FileItem> items,
java.util.Map<java.lang.String,HTMLContext.Attachment> attachments,
java.util.Map<java.lang.String,java.util.List<HTMLContext.Attachment>> attachmentLists)
attachments and attachmentLists with
the attachment parameters and the list-valued attachment parameters.items - attachments - attachmentLists - protected java.lang.String getStringValue(java.lang.Object o)
o - protected java.util.List<java.lang.String> getListValue(java.lang.Object o)
o - public long ping()
public <any> getRelease()
ADEPT2Service.<unknown> for all elements of the triple.public <any> getServiceInstanceName()
ADEPT2Service.null for the cluster name, <unknown> for the other
elements of the triple.public java.lang.String[] getStartupRequiredServices()
public java.lang.String[] getRuntimeRequiredServices()
public java.net.URI[] getLocalUris()
public java.net.URI[] getURIs()
public void init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
throws AbortServiceException
AbortServiceExceptionpublic void start()
public void preShutdown(boolean emergency)
public void shutdown(boolean emergency)
public java.lang.String getServletName()
public void servletDeployed(ServletContext context,
java.lang.String urlPattern)
public void servletUndeployed(ServletContext context)