Groovy Documentation

java.gate.cow.jetty
Class SecureProxyConnector

java.lang.Object
  org.mortbay.component.AbstractLifeCycle
      org.mortbay.jetty.AbstractBuffers
          org.mortbay.jetty.AbstractConnector
              org.mortbay.jetty.nio.AbstractNIOConnector
                  org.mortbay.jetty.nio.SelectChannelConnector
                      java.gate.cow.jetty.SecureProxyConnector

class SecureProxyConnector
extends org.mortbay.jetty.nio.SelectChannelConnector

Simple custom Jetty connector that speaks the normal HTTP protocol but pretends to be secure. It returns true from #isConfidential and #isIntegral and customizes the request to believe it is an HTTPS request. This connector is useful when you are running CoW behind an Apache proxy that handles HTTPS requests and thus don't want to have to handle encryption within CoW, but you still want to be able to use the web.xml security-constraint mechanism to redirect requests to the secure port where necessary. For such a scenario your Apache server would need to be set up to ProxyPass HTTP requests to the normal Grails port and HTTPS requests to the port on which this SecureProxyConnector is listening. The server.port.https system property should be set to the port on which the Apache HTTPS server is listening (typically 443), not the port on which this SecureProxyConnector is listening.


Constructor Summary
SecureProxyConnector(int port)

Create a SecureProxyConnector listening on the given port.

 
Method Summary
void customize(EndPoint ep, Request r)

Tell the request that it is being served over https.

boolean isConfidential(Request r)

We are confidential.

boolean isIntegral(Request r)

We are integral.

 
Methods inherited from class org.mortbay.jetty.nio.SelectChannelConnector
close, accept, open, getConnection, customize, persist, getDelaySelectKeyUpdate, getLocalPort, newContinuation, setDelaySelectKeyUpdate, setMaxIdleTime, getLowResourcesConnections, setLowResourcesConnections, getLowResourcesMaxIdleTime, setLowResourcesMaxIdleTime, setLowResourceMaxIdleTime, getUseDirectBuffers, setUseDirectBuffers, toString, getName, join, setName, getThreadPool, getHost, getPort, setHost, setPort, setServer, getReuseAddress, setReuseAddress, getAcceptQueueSize, getAcceptors, getMaxIdleTime, getServer, setThreadPool, getLowResourceMaxIdleTime, getSoLingerTime, setAcceptQueueSize, setAcceptors, setSoLingerTime, getConfidentialPort, getConfidentialScheme, isIntegral, getIntegralPort, getIntegralScheme, isConfidential, setConfidentialPort, setConfidentialScheme, setIntegralPort, setIntegralScheme, stopAccept, getResolveNames, setResolveNames, isForwarded, setForwarded, getHostHeader, setHostHeader, getForwardedHostHeader, setForwardedHostHeader, getForwardedServerHeader, setForwardedServerHeader, getForwardedForHeader, setForwardedForHeader, getRequests, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpenMin, getConnectionsRequestsMin, getConnections, getConnectionsOpen, getConnectionsOpenMax, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsRequestsAve, getConnectionsRequestsMax, statsReset, setStatsOn, getStatsOn, getStatsOnMs, getAcceptorPriorityOffset, setAcceptorPriorityOffset, getBuffer, returnBuffer, getHeaderBufferSize, setHeaderBufferSize, getRequestBufferSize, setRequestBufferSize, getResponseBufferSize, setResponseBufferSize, start, stop, isRunning, isStarted, isStarting, isStopping, isStopped, isFailed, addLifeCycleListener, removeLifeCycleListener, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll
 
Methods inherited from class org.mortbay.jetty.nio.AbstractNIOConnector
getUseDirectBuffers, setUseDirectBuffers, toString, getName, join, setName, getThreadPool, getHost, getPort, setHost, setPort, setServer, customize, persist, newContinuation, setMaxIdleTime, setLowResourceMaxIdleTime, getReuseAddress, setReuseAddress, getAcceptQueueSize, getAcceptors, getMaxIdleTime, getServer, setThreadPool, getLowResourceMaxIdleTime, getSoLingerTime, setAcceptQueueSize, setAcceptors, setSoLingerTime, getConfidentialPort, getConfidentialScheme, isIntegral, getIntegralPort, getIntegralScheme, isConfidential, setConfidentialPort, setConfidentialScheme, setIntegralPort, setIntegralScheme, stopAccept, getResolveNames, setResolveNames, isForwarded, setForwarded, getHostHeader, setHostHeader, getForwardedHostHeader, setForwardedHostHeader, getForwardedServerHeader, setForwardedServerHeader, getForwardedForHeader, setForwardedForHeader, getRequests, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpenMin, getConnectionsRequestsMin, getConnections, getConnectionsOpen, getConnectionsOpenMax, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsRequestsAve, getConnectionsRequestsMax, statsReset, setStatsOn, getStatsOn, getStatsOnMs, getAcceptorPriorityOffset, setAcceptorPriorityOffset, getBuffer, returnBuffer, getHeaderBufferSize, setHeaderBufferSize, getRequestBufferSize, setRequestBufferSize, getResponseBufferSize, setResponseBufferSize, start, stop, isRunning, isStarted, isStarting, isStopping, isStopped, isFailed, addLifeCycleListener, removeLifeCycleListener, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll, close, open, getConnection, getLocalPort
 
Methods inherited from class org.mortbay.jetty.AbstractConnector
toString, getName, join, setName, getThreadPool, getHost, getPort, setHost, setPort, setServer, customize, persist, newContinuation, setMaxIdleTime, setLowResourceMaxIdleTime, getReuseAddress, setReuseAddress, getAcceptQueueSize, getAcceptors, getMaxIdleTime, getServer, setThreadPool, getLowResourceMaxIdleTime, getSoLingerTime, setAcceptQueueSize, setAcceptors, setSoLingerTime, getConfidentialPort, getConfidentialScheme, isIntegral, getIntegralPort, getIntegralScheme, isConfidential, setConfidentialPort, setConfidentialScheme, setIntegralPort, setIntegralScheme, stopAccept, getResolveNames, setResolveNames, isForwarded, setForwarded, getHostHeader, setHostHeader, getForwardedHostHeader, setForwardedHostHeader, getForwardedServerHeader, setForwardedServerHeader, getForwardedForHeader, setForwardedForHeader, getRequests, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpenMin, getConnectionsRequestsMin, getConnections, getConnectionsOpen, getConnectionsOpenMax, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsRequestsAve, getConnectionsRequestsMax, statsReset, setStatsOn, getStatsOn, getStatsOnMs, getAcceptorPriorityOffset, setAcceptorPriorityOffset, getBuffer, returnBuffer, getHeaderBufferSize, setHeaderBufferSize, getRequestBufferSize, setRequestBufferSize, getResponseBufferSize, setResponseBufferSize, start, stop, isRunning, isStarted, isStarting, isStopping, isStopped, isFailed, addLifeCycleListener, removeLifeCycleListener, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll, close, open, getConnection, getLocalPort
 
Methods inherited from class org.mortbay.jetty.AbstractBuffers
getBuffer, returnBuffer, getHeaderBufferSize, setHeaderBufferSize, getRequestBufferSize, setRequestBufferSize, getResponseBufferSize, setResponseBufferSize, start, stop, isRunning, isStarted, isStarting, isStopping, isStopped, isFailed, addLifeCycleListener, removeLifeCycleListener, wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
start, stop, isRunning, isStarted, isStarting, isStopping, isStopped, isFailed, addLifeCycleListener, removeLifeCycleListener, wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Constructor Detail

SecureProxyConnector

public SecureProxyConnector(int port)
Create a SecureProxyConnector listening on the given port.


 
Method Detail

customize

public void customize(EndPoint ep, Request r)
Tell the request that it is being served over https.


isConfidential

public boolean isConfidential(Request r)
We are confidential.


isIntegral

public boolean isIntegral(Request r)
We are integral.


 

Groovy Documentation