org.glassfish.grizzly.http.server
Class NetworkListener

java.lang.Object
  extended by org.glassfish.grizzly.http.server.NetworkListener

public class NetworkListener
extends Object


Field Summary
static String DEFAULT_NETWORK_HOST
          The default network host to which the HttpServer will bind to in order to service HTTP requests.
static int DEFAULT_NETWORK_PORT
          The default network port to which the HttpServer will bind to in order to service HTTP requests.
 
Constructor Summary
NetworkListener(String name)
           Constructs a new NetworkListener using the specified name.
NetworkListener(String name, String host)
           Constructs a new NetworkListener using the specified name and host.
NetworkListener(String name, String host, int port)
           Constructs a new NetworkListener using the specified name, host, and port.
 
Method Summary
 JmxObject createManagementObject()
           
 String getCompressableMimeTypes()
           
 String getCompression()
           
 int getCompressionMinSize()
           
 Set<ContentEncoding> getContentEncodings()
           
 FileCache getFileCache()
           
 FilterChain getFilterChain()
           
 String getHost()
           
 HttpCodecFilter getHttpCodecFilter()
           
 HttpServerFilter getHttpServerFilter()
           
 KeepAlive getKeepAlive()
           
 int getMaxHttpHeaderSize()
           
 int getMaxPendingBytes()
           
 int getMaxPostSize()
           
 String getName()
           
 String getNoCompressionUserAgents()
           
 int getPort()
           
 String getRestrictedUserAgents()
           
 SSLEngineConfigurator getSslEngineConfig()
           
 int getTransactionTimeout()
           
 TCPNIOTransport getTransport()
           
 int getUploadTimeout()
           
 String getUriEncoding()
           
 boolean isAuthPassthroughEnabled()
           
 boolean isChunkingEnabled()
           
 boolean isDisableUploadTimeout()
           
 boolean isPaused()
           
 boolean isRcmSupportEnabled()
           
 boolean isSecure()
           
 boolean isStarted()
           
 boolean isTraceEnabled()
           
 boolean isWebSocketsEnabled()
           
 void pause()
           Pauses the listener.
 void resume()
           Resumes a paused listener.
 void setAuthPassthroughEnabled(boolean authPassthroughEnabled)
           
 void setChunkingEnabled(boolean chunkingEnabled)
          Enable/disable chunking of an http response body if no content length has been explictly specified.
 void setCompressableMimeTypes(String compressableMimeTypes)
           
 void setCompression(String compression)
           
 void setCompressionMinSize(int compressionMinSize)
           
 void setDisableUploadTimeout(boolean disableUploadTimeout)
           
 void setFilterChain(FilterChain filterChain)
           Specifies the FilterChain to be used by the TCPNIOTransport associated with this listener.
 void setMaxHttpHeaderSize(int maxHttpHeaderSize)
           Configures the maximum header size for an HTTP request.
 void setMaxPendingBytes(int maxPendingBytes)
          The maximum size, in bytes, of all data waiting to be written to the associated Connection.
 void setMaxPostSize(int maxPostSize)
           
 void setNoCompressionUserAgents(String noCompressionUserAgents)
           
 void setRcmSupportEnabled(boolean enabled)
           
 void setRestrictedUserAgents(String restrictedUserAgents)
           
 void setSecure(boolean secure)
           Enable or disable security for this listener.
 void setSSLEngineConfig(SSLEngineConfigurator sslEngineConfig)
           Provides customization of the SSLEngine used by this listener.
 void setTraceEnabled(boolean traceEnabled)
           
 void setTransactionTimeout(int transactionTimeout)
           
 void setTransport(TCPNIOTransport transport)
           This allows the developer to specify a custom TCPNIOTransport implementation to be used by this listener.
 void setUploadTimeout(int uploadTimeout)
           
 void setUriEncoding(String uriEncoding)
           
 void setWebSocketsEnabled(boolean webSocketsEnabled)
          Enables/disables Web Sockets support for this listener.
 void start()
           Starts the listener.
 void stop()
           Stops the listener.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NETWORK_HOST

public static final String DEFAULT_NETWORK_HOST
The default network host to which the HttpServer will bind to in order to service HTTP requests.

See Also:
Constant Field Values

DEFAULT_NETWORK_PORT

public static final int DEFAULT_NETWORK_PORT
The default network port to which the HttpServer will bind to in order to service HTTP requests.

See Also:
Constant Field Values
Constructor Detail

NetworkListener

public NetworkListener(String name)

Constructs a new NetworkListener using the specified name. The listener's host and port will default to DEFAULT_NETWORK_HOST and DEFAULT_NETWORK_PORT.

Parameters:
name - the logical name of the listener.

NetworkListener

public NetworkListener(String name,
                       String host)

Constructs a new NetworkListener using the specified name and host. The listener's port will default to DEFAULT_NETWORK_PORT.

Parameters:
name - the logical name of the listener.
host - the network host to which this listener will bind.

NetworkListener

public NetworkListener(String name,
                       String host,
                       int port)

Constructs a new NetworkListener using the specified name, host, and port.

Parameters:
name - the logical name of the listener.
host - the network host to which this listener will bind.
port - the network port to which this listener will bind..
Method Detail

getName

public String getName()
Returns:
the logical name of this listener.

getHost

public String getHost()
Returns:
the network host to which this listener is configured to bind to.

getPort

public int getPort()
Returns:
the network port to which this listener is configured to bind to.

getKeepAlive

public KeepAlive getKeepAlive()
Returns:
the configuration for the keep-alive HTTP connections.

getTransport

public TCPNIOTransport getTransport()
Returns:
the TCPNIOTransport used by this listener.

setTransport

public void setTransport(TCPNIOTransport transport)

This allows the developer to specify a custom TCPNIOTransport implementation to be used by this listener.

Attempts to change the transport implementation while the listener is running will be ignored.

Parameters:
transport - a custom TCPNIOTransport implementation.

isWebSocketsEnabled

public boolean isWebSocketsEnabled()
Returns:
true if Web Sockets is enabled, otherwise, returns false.

isChunkingEnabled

public boolean isChunkingEnabled()
Returns:
true if the http response bodies should be chunked if not content length has been explicitly specified.

setChunkingEnabled

public void setChunkingEnabled(boolean chunkingEnabled)
Enable/disable chunking of an http response body if no content length has been explictly specified. Chunking is enabled by default.

Parameters:
chunkingEnabled - true to enable chunking; false to disable.

setWebSocketsEnabled

public void setWebSocketsEnabled(boolean webSocketsEnabled)
Enables/disables Web Sockets support for this listener.

Parameters:
webSocketsEnabled - true if Web Sockets support should be enabled.

isSecure

public boolean isSecure()
Returns:
true if this is a secure listener, otherwise false. Listeners are not secure by default.

setSecure

public void setSecure(boolean secure)

Enable or disable security for this listener.

Attempts to change this value while the listener is running will be ignored.

Parameters:
secure - if true this listener will be secure.

getSslEngineConfig

public SSLEngineConfigurator getSslEngineConfig()
Returns:
the SSLEngine configuration for this listener.

setSSLEngineConfig

public void setSSLEngineConfig(SSLEngineConfigurator sslEngineConfig)

Provides customization of the SSLEngine used by this listener.

Attempts to change this value while the listener is running will be ignored.

Parameters:
sslEngineConfig - custom SSL configuration.

getMaxHttpHeaderSize

public int getMaxHttpHeaderSize()
Returns:
the maximum header size for an HTTP request.

getCompression

public String getCompression()

setCompression

public void setCompression(String compression)

setMaxHttpHeaderSize

public void setMaxHttpHeaderSize(int maxHttpHeaderSize)

Configures the maximum header size for an HTTP request.

Attempts to change this value while the listener is running will be ignored.

Parameters:
maxHttpHeaderSize - the maximum header size for an HTTP request.

getFilterChain

public FilterChain getFilterChain()
Returns:
the FilterChain used to by the TCPNIOTransport associated with this listener.

setFilterChain

public void setFilterChain(FilterChain filterChain)

Specifies the FilterChain to be used by the TCPNIOTransport associated with this listener.

Attempts to change this value while the listener is running will be ignored.

Parameters:
filterChain - the FilterChain.

getFileCache

public FileCache getFileCache()
Returns:
the FileCache associated with this listener.

getContentEncodings

public Set<ContentEncoding> getContentEncodings()
Returns:
the set of the supported ContentEncodings.

getMaxPendingBytes

public int getMaxPendingBytes()
Returns:
the maximum size, in bytes, of all data waiting to be written to the associated Connection.

setMaxPendingBytes

public void setMaxPendingBytes(int maxPendingBytes)
The maximum size, in bytes, of all data waiting to be written to the associated Connection.

Parameters:
maxPendingBytes - the maximum size, in bytes, of all data waiting to be written to the associated Connection.

isPaused

public boolean isPaused()
Returns:
true if this listener has been paused, otherwise false

isStarted

public boolean isStarted()
Returns:
true if the listener has been started, otherwise false.

start

public void start()
           throws IOException

Starts the listener.

Throws:
IOException - if an error occurs when attempting to start the listener.

stop

public void stop()
          throws IOException

Stops the listener.

Throws:
IOException - if an error occurs when attempting to stop the listener.

pause

public void pause()
           throws IOException

Pauses the listener.

Throws:
IOException - if an error occurs when attempting to pause the listener.

resume

public void resume()
            throws IOException

Resumes a paused listener.

Throws:
IOException - if an error occurs when attempting to resume the listener.

toString

public String toString()
Overrides:
toString in class Object
Returns:
a value containing the name, host, port, and secure status of this listener.

createManagementObject

public JmxObject createManagementObject()

getHttpServerFilter

public HttpServerFilter getHttpServerFilter()

getHttpCodecFilter

public HttpCodecFilter getHttpCodecFilter()

isRcmSupportEnabled

public boolean isRcmSupportEnabled()

setRcmSupportEnabled

public void setRcmSupportEnabled(boolean enabled)

isAuthPassthroughEnabled

public boolean isAuthPassthroughEnabled()

setAuthPassthroughEnabled

public void setAuthPassthroughEnabled(boolean authPassthroughEnabled)

setMaxPostSize

public void setMaxPostSize(int maxPostSize)

setCompressableMimeTypes

public void setCompressableMimeTypes(String compressableMimeTypes)

setNoCompressionUserAgents

public void setNoCompressionUserAgents(String noCompressionUserAgents)

setCompressionMinSize

public void setCompressionMinSize(int compressionMinSize)

setRestrictedUserAgents

public void setRestrictedUserAgents(String restrictedUserAgents)

setUploadTimeout

public void setUploadTimeout(int uploadTimeout)

setDisableUploadTimeout

public void setDisableUploadTimeout(boolean disableUploadTimeout)

setTraceEnabled

public void setTraceEnabled(boolean traceEnabled)

setUriEncoding

public void setUriEncoding(String uriEncoding)

getCompressableMimeTypes

public String getCompressableMimeTypes()

getCompressionMinSize

public int getCompressionMinSize()

isDisableUploadTimeout

public boolean isDisableUploadTimeout()

getMaxPostSize

public int getMaxPostSize()

getNoCompressionUserAgents

public String getNoCompressionUserAgents()

getRestrictedUserAgents

public String getRestrictedUserAgents()

isTraceEnabled

public boolean isTraceEnabled()

getUploadTimeout

public int getUploadTimeout()

getUriEncoding

public String getUriEncoding()

getTransactionTimeout

public int getTransactionTimeout()

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)


Copyright © 2010 Oracle Corpration. All Rights Reserved.