|
|||||||||
| 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
org.hd.d.pg2k.webSvr.exhibit.ThumbnailServlet
public final class ThumbnailServlet
This is the servlet that serves thumbnail data. This is optimised to serve medium quantities of binary data efficiently, and to get headers right to optimise performance of caches, spiders, etc, while not losing site of usage logging.
| Field Summary | |
|---|---|
private static boolean |
SEND_TN_MD5
If true then we may generate/send the MD5 content hash for some/all thumbnails. |
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
| Constructor Summary | |
|---|---|
ThumbnailServlet()
|
|
| Method Summary | |
|---|---|
void |
doAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Respond to a GET/HEAD request for the content served by this servlet. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Respond to a GET request for the content served by this servlet. |
void |
doHead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Respond to a HEAD request for the content served by this servlet. |
private static DataSourceBean |
getDataSource(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request)
Get singleton (per-servlet-context) data pipeline/cache instance. |
long |
getLastModified(javax.servlet.http.HttpServletRequest request)
Get `last-modified' time for a thumbnail, or -1 if not available. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doOptions, doPost, doPut, doTrace, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, 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 boolean SEND_TN_MD5
private static final long serialVersionUID
| Constructor Detail |
|---|
public ThumbnailServlet()
| Method Detail |
|---|
private static DataSourceBean getDataSource(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request)
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
doGet in class javax.servlet.http.HttpServletrequest - The servlet request we are processingresponse - The servlet response we are producing
public void doHead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
doHead in class javax.servlet.http.HttpServletrequest - The servlet request we are processingresponse - The servlet response we are producing
public void doAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
The request path is of the form /XXX/exhibitname where XXX identifies the required thumbnail/sample size (small or standard).
If an exhibit is requested by a syntactically-invalid name, we produce an HTTP `forbidden' (403) response.
If we request an exhibit with a valid name, but that does not exist, return return a `not-found' (404) response (unless there are no exhibits available, perhaps because of a database problem, in which case we may return `service unavailable' in the hope that that will prevent search engines from purging our exhibits if they happen to visit when we are reloading the database).
We refuse to deal with some dubious requests (eg apparently hotlinks directly to our exhibits from external sites) if we are too busy, so as to conserve resources for bona fide users. Dubious requests are rejected with a temporary failure (5xx) code.
TODO:
request - The servlet request we are processingresponse - The servlet response we are producingpublic final long getLastModified(javax.servlet.http.HttpServletRequest request)
In case of any difficulty we return the -1 "not-known" value.
getLastModified in class javax.servlet.http.HttpServletrequest - The servlet request being processed
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||