docs: 补充文档内容, 修复文档错误.

This commit is contained in:
LamGC 2021-09-05 14:32:58 +08:00
parent e6a81784a3
commit 749ea644f1
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D
3 changed files with 30 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -49,8 +49,11 @@ public class SshSession implements Closeable {
/**
* 创建本地 TCP 转发隧道.
* <p> 该隧道为方向为 "本地->远端" (本地发起连接转发至远端端口).
* <p> 该隧道为方向为 "本地-&gt;远端" (本地发起连接转发至远端端口).
* @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> 该隧道为方向为 "本地&lt;-远端" (远端服务器发起连接转发至本地端口).
* @param remotePort 远端监听端口号, 该端口为远端服务连接转发的端口号.
* @param localPort 本地连接端口号, 该端口为本地服务端的端口号.
* @return 返回 Tcp 转发通道对象, 用于管理转发通道.
* @throws IOException 当操作失败时抛出异常.
*/
public TcpForwardingChannel createRemoteTcpForwarding(int remotePort, int localPort) throws IOException {
ExplicitPortForwardingTracker tracker =