net.sf.j2ep.model
Interface Server

All Known Implementing Classes:
BaseServer, ClusterContainer.ClusteredServer

public interface Server

A representation of the server. Its main use it to be able to open a connection to the server sending back a executed method. The server has to choose which type of method to invoke and should support all method in the HTTP specification.

Author:
Anders Nyman

Method Summary
 java.lang.String getDomainName()
          Returns the host name and port for this server.
 java.lang.String getPath()
          Returns the path that we are mapping to.
 Rule getRule()
          Returns the mapped rule so we can rewrite links.
 HttpServletResponse postExecute(HttpServletResponse response)
          Can do handling of the response, if needed the server can also return a new HttpServletResponse if a wrapper of the response is needed.
 HttpServletRequest preExecute(HttpServletRequest request)
          Can do any handling needed of a request before the HttpMethod is executed.
 void setConnectionExceptionRecieved(java.lang.Exception e)
          Used to notify the server that there is a problem using the data this server supplied to the user.
 

Method Detail

preExecute

HttpServletRequest preExecute(HttpServletRequest request)
Can do any handling needed of a request before the HttpMethod is executed. Example of handling is to wrap the request.

Parameters:
request - The request we are receiving
Returns:
Eventual modified HttpServletRequest

postExecute

HttpServletResponse postExecute(HttpServletResponse response)
Can do handling of the response, if needed the server can also return a new HttpServletResponse if a wrapper of the response is needed.

Parameters:
response - The response we are receiving
Returns:
Eventual modified HttpServletResponse

setConnectionExceptionRecieved

void setConnectionExceptionRecieved(java.lang.Exception e)
Used to notify the server that there is a problem using the data this server supplied to the user. Maybe the domainName isn't working or the directory doesn't exist on the underlying server, in any case this method can be used to let the server know about the problems. The server should try to analyze the problem and if possible fix it so that the next request to this server will succeed.

Parameters:
e - The exception received when trying to use this servers data

getDomainName

java.lang.String getDomainName()
Returns the host name and port for this server.

Returns:
Host name and port

getPath

java.lang.String getPath()
Returns the path that we are mapping to. Starting from the servers root the path starts with a / but doesn't end with a /. A mapping to the root results in path being an empty string "".

Returns:
The path

getRule

Rule getRule()
Returns the mapped rule so we can rewrite links.

Returns:
The rule we are mapped to