|
ZetaGrid v1.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--zeta.handler.statistic.AbstractHandler
Base handler to response a GET request for a specific statistic.
| Nested Class Summary | |
(package private) class |
AbstractHandler.InnerPageBuffer
|
| Field Summary | |
private int |
diffTimeImageUpdate
Duration in milliseconds when the images should be new created. |
private int |
diffTimeInnerPageUpdate
Duration in milliseconds when the HTML page should be new created. |
private int |
diffTimePageUpdate
Duration in milliseconds when the HTML page should be new created. |
private java.util.Map |
imageBuffer
Buffer containing the created images today. |
protected static int |
imgHeight
Height of the created images. |
protected static int |
imgWidth
Width of the created images. |
private java.util.Map |
lastImageUpdate
Timestamp when the images are created. |
private long |
lastInnerPageUpdate
Timestamp when the inner page is send to a client. |
private long |
lastPageUpdate
Timestamp when the page is send to a client. |
private java.lang.String |
pageBuffer
Buffer containing the HTML page. |
protected ZetaServlet |
servlet
Servlet which owns this handler. |
private static java.text.DateFormat |
timeFormatter
Format 'MM/dd/yyyy HH:mm:ss' to print current timestamp. |
private long |
timestampOfPage
Timestamp when the inner page was generated. |
| Constructor Summary | |
AbstractHandler(ZetaServlet servlet,
int diffTimeInnerPageUpdate,
int diffTimePageUpdate,
int diffTimeImageUpdate)
|
|
| Method Summary | |
private void |
appendMenu(java.lang.StringBuffer buffer)
Append a menu on the left side of the HTML page. |
private void |
createCompletePage(javax.servlet.http.HttpServletRequest req)
Creates HTML page with the content of a specified statistic. |
java.awt.image.BufferedImage |
createImage(java.sql.Connection con,
java.lang.String imageName)
Creates PNG image for a specified name which is defined in the HTML page. |
abstract java.lang.String |
createPage(java.sql.Connection con)
Creates HTML page with the content of a specified statistic. |
protected java.lang.String |
createPage(javax.servlet.http.HttpServletRequest req,
java.sql.Connection con)
Creates HTML page with the content of a specified statistic. |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Handles a GET request resp for the specified statistic.
|
java.lang.String |
getBufferedPage(javax.servlet.http.HttpServletRequest req)
Returns the buffered page. |
int |
getImageHeight(java.lang.String imageName)
Determines the height of the image in the statistic page. |
int |
getImageWidth(java.lang.String imageName)
Determines the width of the image in the statistic page. |
AbstractHandler.InnerPageBuffer |
getInnerPageBuffer()
Returns the buffer containing the main inner HTML page (table). |
int |
getInnerPageExpiredDiffTime()
Returns time difference when a web inner page expired. |
int |
getPageExpiredDiffTime()
Returns time difference when a web page expired. |
void |
imageUpdateCompleted(java.lang.String imageName)
Event when a new image was generated. |
boolean |
isImageExpired(java.lang.String imageName)
Checks if the image of the web page should be updated. |
boolean |
isInnerPageExpired()
Checks if the web inner page (table) should be updated. |
boolean |
isPageExpired()
Checks if the web page should be updated. |
void |
pageUpdateCompleted()
Event when a new web page was generated. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ZetaServlet servlet
private static java.text.DateFormat timeFormatter
protected static final int imgWidth
protected static final int imgHeight
private java.util.Map imageBuffer
private java.util.Map lastImageUpdate
private java.lang.String pageBuffer
private long lastInnerPageUpdate
private long lastPageUpdate
private int diffTimeInnerPageUpdate
private int diffTimePageUpdate
private int diffTimeImageUpdate
private long timestampOfPage
| Constructor Detail |
public AbstractHandler(ZetaServlet servlet,
int diffTimeInnerPageUpdate,
int diffTimePageUpdate,
int diffTimeImageUpdate)
servlet - servlet which owns this handler.diffTimePageUpdate - duration in milliseconds when the HTML page should be new created.diffTimeImageUpdate - duration in milliseconds when the images should be new created.| Method Detail |
public abstract java.lang.String createPage(java.sql.Connection con)
throws java.sql.SQLException,
javax.servlet.ServletException
con - connection to the back-end database
java.sql.SQLException
javax.servlet.ServletException
protected java.lang.String createPage(javax.servlet.http.HttpServletRequest req,
java.sql.Connection con)
throws java.sql.SQLException,
javax.servlet.ServletException
req - GET requestcon - connection to the back-end database
java.sql.SQLException
javax.servlet.ServletException
public java.awt.image.BufferedImage createImage(java.sql.Connection con,
java.lang.String imageName)
throws java.sql.SQLException,
javax.servlet.ServletException
con - connection to the back-end databaseimageName - name of the image
java.sql.SQLException
javax.servlet.ServletExceptionpublic boolean isImageExpired(java.lang.String imageName)
imageName - name of the image
true if the image of the web page should be updated.public boolean isInnerPageExpired()
true if the web page should be updated.public boolean isPageExpired()
true if the web page should be updated.public int getInnerPageExpiredDiffTime()
public int getPageExpiredDiffTime()
public final void imageUpdateCompleted(java.lang.String imageName)
imageName - name of the imagepublic final void pageUpdateCompleted()
public AbstractHandler.InnerPageBuffer getInnerPageBuffer()
throws javax.servlet.ServletException
javax.servlet.ServletException
public java.lang.String getBufferedPage(javax.servlet.http.HttpServletRequest req)
throws javax.servlet.ServletException
req - GET request
javax.servlet.ServletException
public final void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
resp for the specified statistic.
The response resp contains either the HTML page or an image.
doGet in interface GetHandlerjavax.servlet.ServletException
java.io.IOExceptionpublic int getImageWidth(java.lang.String imageName)
imageName - name of the image
public int getImageHeight(java.lang.String imageName)
imageName - name of the image
private void createCompletePage(javax.servlet.http.HttpServletRequest req)
throws javax.servlet.ServletException
req - GET request
javax.servlet.ServletExceptionprivate void appendMenu(java.lang.StringBuffer buffer)
buffer - buffer containing the HTML page.
|
ZetaGrid v1.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||