Package org.aoju.bus.socket.plugins
Class BlackListPlugin<T>
java.lang.Object
org.aoju.bus.socket.plugins.AbstractPlugin<T>
org.aoju.bus.socket.plugins.BlackListPlugin<T>
- All Implemented Interfaces:
NetMonitor,Plugin<T>
黑名单插件,bus-socket会拒绝与黑名单中的IP建立连接
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid添加黑名单失败规则void移除黑名单规则shouldAccept(AsynchronousSocketChannel channel) 监控已接收到的连接Methods inherited from class org.aoju.bus.socket.plugins.AbstractPlugin
afterRead, afterWrite, beforeRead, beforeWrite, preProcess, stateEvent
-
Constructor Details
-
BlackListPlugin
public BlackListPlugin()
-
-
Method Details
-
shouldAccept
Description copied from interface:NetMonitor监控已接收到的连接
- Specified by:
shouldAcceptin interfaceNetMonitor- Overrides:
shouldAcceptin classAbstractPlugin<T>- Parameters:
channel- 当前已经建立连接的通道对象- Returns:
- 非null:接受该连接,null:拒绝该连接
-
addRule
-
removeRule
-