net.sf.zekr.engine.server
Class HttpServer
java.lang.Object
net.sf.zekr.engine.server.HttpServer
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- DefaultHttpServer
public abstract class HttpServer
- extends java.lang.Object
- implements java.lang.Runnable
An abstract HTTP server model. An HTTP server implementation can be accessed through
getInstance()
.
- Author:
- Mohsen Saboorian
Method Summary |
abstract java.lang.String |
getAddress()
|
abstract int |
getPort()
|
java.lang.String |
getUrl()
|
java.lang.String |
toRealPath(java.lang.String url)
|
java.lang.String |
toUrl(java.lang.String localPath)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
run |
pathLookup
public java.util.Map pathLookup
- a map of some constant names (defined in
HttpResourceNaming
) to their original normalized path
CACHED_RESOURCE
public static final java.lang.String CACHED_RESOURCE
- See Also:
- Constant Field Values
WORKSPACE_RESOURCE
public static final java.lang.String WORKSPACE_RESOURCE
- See Also:
- Constant Field Values
BASE_RESOURCE
public static final java.lang.String BASE_RESOURCE
- See Also:
- Constant Field Values
WORKSPACE_OR_BASE_RESOURCE
public static final java.lang.String WORKSPACE_OR_BASE_RESOURCE
- See Also:
- Constant Field Values
HttpServer
protected HttpServer()
getPort
public abstract int getPort()
- Returns:
- port on which HTTP server is listening for input connections.
getAddress
public abstract java.lang.String getAddress()
throws HttpServerRuntimeException
- Returns:
- HTTP server address. Examples are "192.168.0.1" and "127.0.0.1".
- Throws:
HttpServerRuntimeException
getUrl
public java.lang.String getUrl()
throws HttpServerRuntimeException
- Returns:
- HTTP server URL with a trailing slash. Examples are: "http://localhost:8920/" and
"http://zekr:80/".
- Throws:
HttpServerRuntimeException
toUrl
public java.lang.String toUrl(java.lang.String localPath)
toRealPath
public java.lang.String toRealPath(java.lang.String url)