|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.yuccasrv.ConnectionHandler ikrs.yuccasrv.TCPAdapter ikrs.httpd.HTTPHandler
public class HTTPHandler
Field Summary | |
---|---|
protected static HTTPHandler |
sharedInstance
This is a bit ugly. |
protected static java.lang.String[] |
SUPPORTED_METHODS
Technically these are all _implemented_ methods, not all supported. |
Constructor Summary | |
---|---|
HTTPHandler()
|
Method Summary | |
---|---|
HexDumpOutputStream |
createHexDumpOutputStream()
|
void |
finalize(long time,
java.util.concurrent.TimeUnit unit)
This method will be called if the SocketManager is going to terminate. |
protected java.util.Set<java.lang.String> |
getCGIMapHeadersSet()
This method returns the internal Header-to-CGI mapping set. |
java.net.URI |
getDefaultErrorDocumentURI(java.lang.Integer statusCode)
Get the default configured error document (URI relative to document root) by the given status code. |
protected DefaultResponseBuilder |
getDefaultResponseBuilder()
Get the global response builder with dynamic type 'DefaultResponseBuilder'. |
java.io.File |
getDocumentRoot()
Get the handler's configured document root file. |
Environment<java.lang.String,BasicType> |
getEnvironment()
|
protected java.util.Map<java.lang.Integer,java.net.URI> |
getErrorDocumentMap()
This method returns the internal error document map which will be configured by the HTTPConfigurator. |
HTTPFileFilter |
getFileFilter()
|
FileHandler |
getFileHandlerByExtension(java.lang.String fileExtension)
This method resolves the FileHandler matching the given file extension. |
FileHandler |
getFileHandlerByName(java.lang.String handlerName)
This method resolves the FileHandler matching the given file extension. |
Environment<java.lang.String,BasicType> |
getGlobalConfiguration()
|
java.text.DateFormat |
getHTTPDateFormat()
|
CustomLogger |
getLogger()
Get the global logger. |
ResourceAccessor |
getResourceAccessor()
Get the global resource accessor. |
ResponseBuilder |
getResponseBuilder()
Get the global response builder. |
protected HTTPDRuntimeStatistics |
getRuntimeStatistics()
Get the runtime statistics for this handler. |
SessionManager<java.lang.String,BasicType,HTTPConnectionUserID> |
getSessionManager()
Get this handler's session manager. |
java.lang.String |
getSoftwareName()
Get the server's software name, compatible with the 'Server' header field. |
java.util.List<java.lang.String> |
getSupportedMethods()
Get a list of allowed (implemented) methods. |
void |
init(Environment<java.lang.String,BasicType> additionalSettings,
Environment<java.lang.String,BasicType> optionalReturnValues)
This method will be called after the connection handler was instantiated (usually using the Class.newInstance() method). |
protected void |
initFileHandlers(java.io.File fileHandlersFile)
This method initializes the FileHandler map. |
boolean |
isDirectoryListingAllowed()
This is a global flag indicatng if directory listings are allowed or not. |
boolean |
isInsideDocumentRoot(java.io.File file)
This method checks whether the passed file-system file is 'inside' the configured document root. |
boolean |
isSupportedMethod(java.lang.String method)
|
java.lang.Boolean |
mapHeaderToCGIEnvironment(java.lang.String headerName)
This method indicates if a given HTTP header should be mapped to the CGI environment or not. |
protected void |
perform_hexdumpFormat(java.lang.String formatString)
This method is called by ikrs.http.ModuleCommand.execute(). |
protected void |
perform_status()
This method is called by ikrs.http.ModuleCommand.execute(). |
void |
rejectedExecution(java.lang.Runnable r,
java.util.concurrent.ThreadPoolExecutor executor)
The RejectedExecutionHandler.rejectedExecution(...) is called by the ThreadPoolExecutor if the request queue is full and all threads are busy. |
void |
serverAcceptedTCPConnection(BindManager source,
java.util.UUID socketID,
java.net.Socket sock,
ConnectionUserID<ConnectionUserID> userID)
|
protected void |
setDocumentRoot(java.io.File newDocumentRoot)
|
Methods inherited from class ikrs.yuccasrv.TCPAdapter |
---|
serverAcceptedUDPConnection, serverClosed, serverCreated, serverError |
Methods inherited from class ikrs.yuccasrv.ConnectionHandler |
---|
getUUID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static HTTPHandler sharedInstance
protected static final java.lang.String[] SUPPORTED_METHODS
Constructor Detail |
---|
public HTTPHandler()
Method Detail |
---|
protected void setDocumentRoot(java.io.File newDocumentRoot) throws java.lang.NullPointerException
java.lang.NullPointerException
public boolean isInsideDocumentRoot(java.io.File file) throws java.lang.NullPointerException
file
- A file inside the local system's file system; must not be null.
java.lang.NullPointerException
- If the passed file is null.protected void initFileHandlers(java.io.File fileHandlersFile)
public Environment<java.lang.String,BasicType> getGlobalConfiguration()
protected HTTPDRuntimeStatistics getRuntimeStatistics()
public java.io.File getDocumentRoot()
public boolean isDirectoryListingAllowed()
public boolean isSupportedMethod(java.lang.String method)
public java.util.List<java.lang.String> getSupportedMethods()
public java.text.DateFormat getHTTPDateFormat()
public HexDumpOutputStream createHexDumpOutputStream()
public java.lang.String getSoftwareName()
public ResponseBuilder getResponseBuilder()
protected DefaultResponseBuilder getDefaultResponseBuilder()
public ResourceAccessor getResourceAccessor()
public CustomLogger getLogger()
public Environment<java.lang.String,BasicType> getEnvironment()
public SessionManager<java.lang.String,BasicType,HTTPConnectionUserID> getSessionManager()
public HTTPFileFilter getFileFilter()
public FileHandler getFileHandlerByExtension(java.lang.String fileExtension)
public FileHandler getFileHandlerByName(java.lang.String handlerName)
public java.net.URI getDefaultErrorDocumentURI(java.lang.Integer statusCode)
statusCode
- The error code (usually a 30*, 40* or 50* status) you want to get
the error document for.
protected java.util.Map<java.lang.Integer,java.net.URI> getErrorDocumentMap()
protected java.util.Set<java.lang.String> getCGIMapHeadersSet()
public java.lang.Boolean mapHeaderToCGIEnvironment(java.lang.String headerName)
public void rejectedExecution(java.lang.Runnable r, java.util.concurrent.ThreadPoolExecutor executor)
rejectedExecution
in interface java.util.concurrent.RejectedExecutionHandler
r
- The Runnable object that was rejected to be executed.executor
- The executor that rejected the request.public void init(Environment<java.lang.String,BasicType> additionalSettings, Environment<java.lang.String,BasicType> optionalReturnValues) throws java.lang.InstantiationException
init
in class TCPAdapter
additionalSettings
- An environment containing additional initialization params. Might be null or empty.optionalReturnValues
- An environment the method may use to store (optional) return values in. May be null.
java.lang.InstantiationException
public void serverAcceptedTCPConnection(BindManager source, java.util.UUID socketID, java.net.Socket sock, ConnectionUserID<ConnectionUserID> userID)
serverAcceptedTCPConnection
in interface BindListener
serverAcceptedTCPConnection
in class TCPAdapter
source
- The BindManager that reports the event.sockedID
- The server socket's unique ID.sock
- The accepted connection socket.public void finalize(long time, java.util.concurrent.TimeUnit unit)
finalize
in interface BindListener
finalize
in class TCPAdapter
time
- The time value all dependent child threads have to terminate in.unit
- The time unit.protected void perform_hexdumpFormat(java.lang.String formatString)
protected void perform_status()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |