|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
info.sswap.api.servlet.AbstractSSWAPServlet
info.sswap.http.SSWAPProxyServlet
public class SSWAPProxyServlet
A default SSWAP HTTP Servlet that will pass servlet calls to a remote URL.
Use of this servlet allows partial support for SSWAP Semantic Web Services
using only the HTTP API (no Java programming necessary). Users of this class
do not need to instantiate it nor call any methods. To use
the class, map it in the servlet container's web.xml file by associating
it with the parameter remoteServiceURI
and a URL which will
execute the service; e.g.:
<servlet>
<servlet-name>MyRDGServlet</servlet-name>
<servlet-class>info.sswap.http.SSWAPProxyServlet</servlet-class>
<init-param>
<param-name>remoteServiceURI</param-name>
<param-value>http://someSite.org/someService</param-value>
</init-param>
<!-- if not defined, defaults to <url-pattern>
<init-param>
<param-name>RDGPath</param-name>
<param-value>/resources/MyRDG/MyRDG</param-value>
</init-param>
-->
</servlet>
<servlet-mapping>
<servlet-name>MyRDGServlet</servlet-name>
<url-pattern>/resources/MyRDG</url-pattern>
</servlet-mapping>
Replace and customize the values for <servlet-name>
, <param-value>
,
and <url-pattern>
per usual web.xml practices. All other values should be
as above. The URL associated with the remoteServiceURI
will be invoked by the
same method as which this servlet is called (HTTP GET or POST on the <url-pattern>
)
with the same query string or content body respectively. This servlet will block
(wait) on the call and must receive a valid RRG (Response Response Graph) as the
HTTP response.
The remoteServiceURI
may satisfy the request in the language and manner of
its choosing. It may use the SSWAP HTTP API /makeRRG service to construct a RRG from JSON
input suitable for return.
The use and definition of RDGPath
is optional.
If it is not defined, then the RDG must reside at the path given in <url-pattern>
;
if it is defined, then its value must be the path to a valid RDG (Resource Description Graph)
on the local web server.
Future implementations of this servlet may offer semantic mapping based on the RDG.
Usage: This servlet allows SSWAP semantic description and discovery without the need
for Java programming: simply set up the mapping in web.xml and the servlet will handle proxying
the service and either returning the response to the caller or sending the response to the
appropriate presentation layer or next service in the pipeline. But semantic support for invocation
is limited; for full semantic support use the AbstractSSWAPServlet
in the SSWAP Java API.
Field Summary | |
---|---|
private static long |
serialVersionUID
Default |
Fields inherited from class info.sswap.api.servlet.AbstractSSWAPServlet |
---|
remoteServiceURI, RRG_RETRIEVAL_SUFFIX |
Constructor Summary | |
---|---|
SSWAPProxyServlet()
|
Method Summary | |
---|---|
protected void |
handleRequest(info.sswap.api.model.RIG rig)
Visibility for package access purposes only. |
void |
init(javax.servlet.ServletConfig servletConfig)
Visibility for package access purposes only. |
Methods inherited from class info.sswap.api.servlet.AbstractSSWAPServlet |
---|
doGet, doPost, getTimeout, setTimeout |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
public SSWAPProxyServlet()
Method Detail |
---|
public final void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class info.sswap.api.servlet.AbstractSSWAPServlet
javax.servlet.ServletException
protected final void handleRequest(info.sswap.api.model.RIG rig)
handleRequest
in class info.sswap.api.servlet.AbstractSSWAPServlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |