mirror of
https://github.com/LamGC/Oracle-Sentry.git
synced 2025-04-29 14:17:34 +00:00
docs: 补充文档内容, 修复文档错误.
This commit is contained in:
parent
e6a81784a3
commit
749ea644f1
@ -24,10 +24,19 @@ public class LevelRangeFilter extends Filter<ILoggingEvent> {
|
||||
return FilterReply.NEUTRAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置最高等级.
|
||||
* <p> 仅限 XML 配置文件设置.
|
||||
* @param maxLevel 最高等级(包括).
|
||||
*/
|
||||
public void setMaxLevel(String maxLevel) {
|
||||
this.maxLevel = Level.toLevel(maxLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置最低等级.
|
||||
* @param minLevel 允许的最低等级(包括).
|
||||
*/
|
||||
public void setMinLevel(String minLevel) {
|
||||
this.minLevel = Level.toLevel(minLevel);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package net.lamgc.oracle.sentry.common.logging;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.filter.Filter;
|
||||
import ch.qos.logback.core.spi.FilterReply;
|
||||
import org.slf4j.Marker;
|
||||
|
||||
/**
|
||||
* @author LamGC
|
||||
@ -19,14 +20,28 @@ public class MarkerFilter extends Filter<ILoggingEvent> {
|
||||
return event.getMarker() != null && event.getMarker().getName().equals(markerName) ? onMatch : onMismatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置要匹配的 {@link Marker} 名称.
|
||||
* @param markerName Marker 名称.
|
||||
*/
|
||||
public void setMarkerName(String markerName) {
|
||||
this.markerName = markerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果匹配, 需要执行的操作.
|
||||
* @see FilterReply
|
||||
* @param onMatch 操作名称.
|
||||
*/
|
||||
public void setOnMatch(String onMatch) {
|
||||
this.onMatch = FilterReply.valueOf(onMatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果不匹配, 需要执行的操作.
|
||||
* @see FilterReply
|
||||
* @param onMismatch 操作名称.
|
||||
*/
|
||||
public void setOnMismatch(String onMismatch) {
|
||||
this.onMismatch = FilterReply.valueOf(onMismatch);
|
||||
}
|
||||
|
@ -49,8 +49,11 @@ public class SshSession implements Closeable {
|
||||
|
||||
/**
|
||||
* 创建本地 TCP 转发隧道.
|
||||
* <p> 该隧道为方向为 "本地->远端" (本地发起连接转发至远端端口).
|
||||
* <p> 该隧道为方向为 "本地->远端" (本地发起连接转发至远端端口).
|
||||
* @param localPort 本地监听端口.
|
||||
* @param remotePort 远端目标端口.
|
||||
* @return 返回 TCP 转发通道对象, 可获取通道信息和关闭通道.
|
||||
* @throws IOException 当操作失败时抛出该异常.
|
||||
*/
|
||||
public TcpForwardingChannel createLocalTcpForwarding(int localPort, int remotePort) throws IOException {
|
||||
ExplicitPortForwardingTracker tracker = clientSession
|
||||
@ -60,10 +63,11 @@ public class SshSession implements Closeable {
|
||||
|
||||
/**
|
||||
* 创建远端 TCP 转发隧道.
|
||||
* <p> 该隧道为方向为 "本地<-远端" (远端服务器发起连接转发至本地端口).
|
||||
* <p> 该隧道为方向为 "本地<-远端" (远端服务器发起连接转发至本地端口).
|
||||
* @param remotePort 远端监听端口号, 该端口为远端服务连接转发的端口号.
|
||||
* @param localPort 本地连接端口号, 该端口为本地服务端的端口号.
|
||||
* @return 返回 Tcp 转发通道对象, 用于管理转发通道.
|
||||
* @throws IOException 当操作失败时抛出异常.
|
||||
*/
|
||||
public TcpForwardingChannel createRemoteTcpForwarding(int remotePort, int localPort) throws IOException {
|
||||
ExplicitPortForwardingTracker tracker =
|
||||
|
Loading…
Reference in New Issue
Block a user