|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.iges.anagram.AbstractModule
|
+--org.iges.anagram.service.Service
A handler for a particular type of client request. All server output to the network is generated by the service modules.
| Field Summary | |
protected boolean |
enabled
|
protected java.lang.String |
moduleID
|
protected java.text.SimpleDateFormat |
updateFormat
|
| Fields inherited from class org.iges.anagram.AbstractModule |
log, moduleName, parent, server |
| Constructor Summary | |
Service()
|
|
| Method Summary | |
protected java.lang.String |
getBaseURL(ClientRequest clientRequest)
Convenience method that determines the base URL of the server, using the current request. |
protected DataHandle |
getDataFromPath(ClientRequest clientRequest)
Convenience method for data services, which ensures that the client request contains a usable data handle. |
java.lang.String |
getModuleID()
Returns an ID for this module. |
abstract java.lang.String |
getServiceName()
Returns the name of this service. |
abstract void |
handle(ClientRequest request)
Performs the service provided by this module. |
boolean |
isEnabled()
Returns whether this service should be invoked or not. |
protected void |
printFooter(java.io.PrintStream p,
Handle path,
long updateTime,
java.lang.String baseURL)
Used to provide a consistent "look and feel" to pages served by the server. |
protected void |
printHeader(java.io.PrintStream p,
java.lang.String windowTitle,
java.lang.String pageTitle,
Handle path,
java.lang.String baseURL)
Used to provide a consistent "look and feel" to pages served by the server. |
void |
setEnabled(boolean enabled)
Sets the enabled property of this service. |
protected java.io.PrintStream |
startHTML(ClientRequest clientRequest)
Convenience method that opens the response stream to the client and sets the content type to HTML. |
| Methods inherited from class org.iges.anagram.AbstractModule |
configModule, configure, debug, debug, error, fail, fail, fail, getModuleName, info, init, toString, verbose, verbose |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.text.SimpleDateFormat updateFormat
protected boolean enabled
protected java.lang.String moduleID
| Constructor Detail |
public Service()
| Method Detail |
public java.lang.String getModuleID()
Module
getModuleID in interface ModulegetModuleID in class AbstractModulepublic void setEnabled(boolean enabled)
public boolean isEnabled()
public abstract java.lang.String getServiceName()
public abstract void handle(ClientRequest request)
throws ModuleException
request - The request to be handled
ModuleException - if the service fails for any reasonprotected java.lang.String getBaseURL(ClientRequest clientRequest)
protected java.io.PrintStream startHTML(ClientRequest clientRequest)
protected void printHeader(java.io.PrintStream p,
java.lang.String windowTitle,
java.lang.String pageTitle,
Handle path,
java.lang.String baseURL)
windowTitle - A title to appear in the window's title barpageTitle - A title to appear at the top of the page (can be HTML)path - The handle associated with this request. If non-null,
a hierarchical set of links up to the parents of this handle
will be printed next to the link to the server home pagebaseURL - The server's base URL. This must be specified with
each request, as it is not guaranteed to be constant.
protected void printFooter(java.io.PrintStream p,
Handle path,
long updateTime,
java.lang.String baseURL)
path - The handle associated with this request. If non-null,
a hierarchical set of links up to the parents of this handle
will be printed next to the link to the server home pageupdateTime - Te last update time for the page, or zero if not
applicablebaseURL - The server's base URL. This must be specified with
each request, as it is not guaranteed to be constant.
protected DataHandle getDataFromPath(ClientRequest clientRequest)
throws ModuleException
ModuleException - If the handle is null, a directory,
forbidden by the client's privilege set,
or flagged as unavailable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||