Package org.apache.catalina
Interface Connector
-
- All Known Implementing Classes:
Connector,PECoyoteConnector,WebConnector
public interface ConnectorA Connector is a component responsible receiving requests from, and returning responses to, a client application. A Connector performs the following general logic:- Receive a request from the client application.
- Create (or allocate from a pool) appropriate Request and Response
instances, and populate their properties based on the contents of
the received request, as described below.
- For all Requests, the
connector,protocol,remoteAddr,response,scheme,secure,serverName,serverPortandstreamproperties MUST be set. ThecontentLengthandcontentTypeproperties are also generally set. - For HttpRequests, the
method,queryString,requestedSessionCookie,requestedSessionId,requestedSessionURL,requestURI, andsecureproperties MUST be set. In addition, the variousaddXxxmethods must be called to record the presence of cookies, headers, and locales in the original request. - For all Responses, the
connector,request, andstreamproperties MUST be set. - No additional headers must be set by the Connector for HttpResponses.
- For all Requests, the
- Identify an appropriate Container to use for processing this request. For a stand alone Catalina installation, this will probably be a (singleton) Engine implementation. For a Connector attaching Catalina to a web server such as Apache, this step could take advantage of parsing already performed within the web server to identify the Context, and perhaps even the Wrapper, to utilize in satisfying this Request.
- Call the
invoke()method of the selected Container, passing the initialized Request and Response instances as arguments. - Return any response created by the Container to the client, or return an appropriate error message if an exception of any type was thrown.
- If utilizing a pool of Request and Response objects, recycle the pair of instances that was just used.
- Version:
- $Revision: 1.6 $ $Date: 2007/05/05 05:31:50 $
- Author:
- Craig R. McClanahan
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequestcreateRequest()Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.ResponsecreateResponse()Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.booleangetAuthPassthroughEnabled()Returns the value of this connector's authPassthroughEnabled flag.X509Certificate[]getCertificates(Request request)Get the underlying WebContainer certificate for the requestContainergetContainer()Return the Container used for processing requests received by this Connector.StringgetDefaultHost()Gets the default host of this Connector.booleangetEnableLookups()Return the "enable DNS lookups" flag.ServerSocketFactorygetFactory()Return the server socket factory used by this Container.org.glassfish.grizzly.http.server.HttpHandlergetHandler()Get theHttpHandlerused by this connector.StringgetInfo()Return descriptive information about this Connector implementation.StringgetJvmRoute()Get the jvmRoute associated with this connector.intgetMaxSavePostSize()Return the maximum size of a POST which will be saved by the container during authentication.StringgetName()Gets the name of this Connector.ProxyHandlergetProxyHandler()Gets the ProxyHandler instance associated with this CoyoteConnector.intgetRedirectPort()Return the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL.StringgetScheme()Return the scheme that will be assigned to requests received through this connector.booleangetSecure()Return the secure connection flag that will be assigned to requests received through this connector.ServicegetService()Return theServicewith which we are associated (if any).StringgetURIEncoding()Get the encoding to be used for byte<-->char conversion for data sent/received via this Connectorvoidinitialize()Invoke a pre-startup initialization.voidsetAuthPassthroughEnabled(boolean authPassthroughEnabled)Sets the value of this connector's authPassthroughEnabled flag.voidsetContainer(Container container)Set the Container used for processing requests received by this Connector.voidsetDefaultHost(String defaultHost)Sets the default host for this Connector.voidsetEnableLookups(boolean enableLookups)Set the "enable DNS lookups" flag.voidsetFactory(ServerSocketFactory factory)Set the server socket factory used by this Container.voidsetHandler(org.glassfish.grizzly.http.server.HttpHandler adapter)Set theAdapterused by this connector.voidsetJvmRoute(String jvmRoute)Sets the jvmRoute associated with this connector.voidsetMaxPostSize(int maxPostSize)Set the maximum size of a POST which will be automatically parsed by the container.voidsetProxyHandler(ProxyHandler proxyHandler)Sets the ProxyHandler implementation for this CoyoteConnector to use.voidsetRedirectPort(int redirectPort)Set the redirect port number.voidsetScheme(String scheme)Set the scheme that will be assigned to requests received through this connector.voidsetSecure(boolean secure)Set the secure connection flag that will be assigned to requests received through this connector.voidsetService(Service service)Set theServicewith which we are associated (if any).voidsetURIEncoding(String encoding)Set the encoding to be used for byte<-->char conversion for data sent/received via this Connector
-
-
-
Method Detail
-
getContainer
Container getContainer()
Return the Container used for processing requests received by this Connector.
-
setContainer
void setContainer(Container container)
Set the Container used for processing requests received by this Connector.- Parameters:
container- The new Container to use
-
getEnableLookups
boolean getEnableLookups()
Return the "enable DNS lookups" flag.
-
setEnableLookups
void setEnableLookups(boolean enableLookups)
Set the "enable DNS lookups" flag.- Parameters:
enableLookups- The new "enable DNS lookups" flag value
-
getFactory
ServerSocketFactory getFactory()
Return the server socket factory used by this Container.
-
setFactory
void setFactory(ServerSocketFactory factory)
Set the server socket factory used by this Container.- Parameters:
factory- The new server socket factory
-
getInfo
String getInfo()
Return descriptive information about this Connector implementation.
-
getRedirectPort
int getRedirectPort()
Return the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL.
-
setRedirectPort
void setRedirectPort(int redirectPort)
Set the redirect port number.- Parameters:
redirectPort- The redirect port number (non-SSL to SSL)
-
getScheme
String getScheme()
Return the scheme that will be assigned to requests received through this connector. Default value is "http".
-
setScheme
void setScheme(String scheme)
Set the scheme that will be assigned to requests received through this connector.- Parameters:
scheme- The new scheme
-
getSecure
boolean getSecure()
Return the secure connection flag that will be assigned to requests received through this connector. Default value is "false".
-
setSecure
void setSecure(boolean secure)
Set the secure connection flag that will be assigned to requests received through this connector.- Parameters:
secure- The new secure connection flag
-
getService
Service getService()
Return theServicewith which we are associated (if any).
-
setService
void setService(Service service)
Set theServicewith which we are associated (if any).- Parameters:
service- The service that owns this Engine
-
setDefaultHost
void setDefaultHost(String defaultHost)
Sets the default host for this Connector.- Parameters:
defaultHost- The default host for this Connector
-
getDefaultHost
String getDefaultHost()
Gets the default host of this Connector.- Returns:
- The default host of this Connector
-
getAuthPassthroughEnabled
boolean getAuthPassthroughEnabled()
Returns the value of this connector's authPassthroughEnabled flag.- Returns:
- true if this connector is receiving its requests from a trusted intermediate server, false otherwise
-
setAuthPassthroughEnabled
void setAuthPassthroughEnabled(boolean authPassthroughEnabled)
Sets the value of this connector's authPassthroughEnabled flag.- Parameters:
authPassthroughEnabled- true if this connector is receiving its requests from a trusted intermediate server, false otherwise
-
getProxyHandler
ProxyHandler getProxyHandler()
Gets the ProxyHandler instance associated with this CoyoteConnector.- Returns:
- ProxyHandler instance associated with this CoyoteConnector, or null
-
setProxyHandler
void setProxyHandler(ProxyHandler proxyHandler)
Sets the ProxyHandler implementation for this CoyoteConnector to use.- Parameters:
proxyHandler- ProxyHandler instance to use
-
getName
String getName()
Gets the name of this Connector.
-
setJvmRoute
void setJvmRoute(String jvmRoute)
Sets the jvmRoute associated with this connector.
-
getJvmRoute
String getJvmRoute()
Get the jvmRoute associated with this connector.
-
createRequest
Request createRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.
-
createResponse
Response createResponse()
Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.
-
initialize
void initialize() throws LifecycleExceptionInvoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.- Throws:
LifecycleException- If this server was already initialized.
-
getCertificates
X509Certificate[] getCertificates(Request request)
Get the underlying WebContainer certificate for the request
-
getURIEncoding
String getURIEncoding()
Get the encoding to be used for byte<-->char conversion for data sent/received via this Connector
-
setURIEncoding
void setURIEncoding(String encoding)
Set the encoding to be used for byte<-->char conversion for data sent/received via this Connector
-
setHandler
void setHandler(org.glassfish.grizzly.http.server.HttpHandler adapter)
Set theAdapterused by this connector.
-
getHandler
org.glassfish.grizzly.http.server.HttpHandler getHandler()
Get theHttpHandlerused by this connector.
-
setMaxPostSize
void setMaxPostSize(int maxPostSize)
Set the maximum size of a POST which will be automatically parsed by the container.- Parameters:
maxPostSize- The new maximum size in bytes of a POST which will be automatically parsed by the container
-
getMaxSavePostSize
int getMaxSavePostSize()
Return the maximum size of a POST which will be saved by the container during authentication.
-
-