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 classSocketProxy.AcceptorclassSocketProxy.Bridge
-
Field Summary
Fields Modifier and Type Field Description static intACCEPT_TIMEOUT_MILLISList<SocketProxy.Bridge>connectionsstatic intPUMP_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 voidclose()intgetAcceptBacklog()intgetListenPort()URIgetUrl()voidgoOn()voidhalfClose()booleanisPauseAtStart()voidopen(URI uri)voidpause()voidreopen()voidsetAcceptBacklog(int acceptBacklog)voidsetPauseAtStart(boolean pauseAtStart)voidsetReceiveBufferSize(int receiveBufferSize)voidsetTarget(URI tcpBrokerUri)StringtoString()booleanwaitUntilClosed(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)
-
-