Class SocketProxy
- java.lang.Object
-
- org.apache.solr.client.solrj.cloud.SocketProxy
-
public class SocketProxy extends Object
Kindly borrowed the idea and base implementation from the ActiveMQ project; useful for blocking traffic on a specified port.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SocketProxy.Acceptor
class
SocketProxy.Bridge
-
Field Summary
Fields Modifier and Type Field Description static int
ACCEPT_TIMEOUT_MILLIS
List<SocketProxy.Bridge>
connections
static int
PUMP_SOCKET_TIMEOUT_MS
-
Constructor Summary
Constructors Constructor Description SocketProxy()
SocketProxy(boolean useSSL)
SocketProxy(int port, boolean useSSL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
getAcceptBacklog()
int
getListenPort()
URI
getUrl()
void
goOn()
void
halfClose()
boolean
isPauseAtStart()
void
open(URI uri)
void
pause()
void
reopen()
void
setAcceptBacklog(int acceptBacklog)
void
setPauseAtStart(boolean pauseAtStart)
void
setReceiveBufferSize(int receiveBufferSize)
void
setTarget(URI tcpBrokerUri)
String
toString()
boolean
waitUntilClosed(long timeoutSeconds)
-
-
-
Field Detail
-
ACCEPT_TIMEOUT_MILLIS
public static final int ACCEPT_TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
PUMP_SOCKET_TIMEOUT_MS
public static final int PUMP_SOCKET_TIMEOUT_MS
- See Also:
- Constant Field Values
-
connections
public List<SocketProxy.Bridge> connections
-
-
Method Detail
-
setReceiveBufferSize
public void setReceiveBufferSize(int receiveBufferSize)
-
setTarget
public void setTarget(URI tcpBrokerUri)
-
getListenPort
public int getListenPort()
-
getUrl
public URI getUrl()
-
close
public void close()
-
halfClose
public void halfClose()
-
waitUntilClosed
public boolean waitUntilClosed(long timeoutSeconds) throws InterruptedException
- Throws:
InterruptedException
-
reopen
public void reopen()
-
pause
public void pause()
-
goOn
public void goOn()
-
isPauseAtStart
public boolean isPauseAtStart()
-
setPauseAtStart
public void setPauseAtStart(boolean pauseAtStart)
-
getAcceptBacklog
public int getAcceptBacklog()
-
setAcceptBacklog
public void setAcceptBacklog(int acceptBacklog)
-
-