模式:功能图片,及解释
0.
主要设置Capture Rules,如下图
Java文件为CaptureRule.java
类Class CaptureRule extends Rule
函数 | 参数 | 说明 |
CaptureRule() 构造函数 | Boolean live | 设置是否激活 |
Boolean capture | 是否为Capture 默认true | |
String description | 对该规则的描述 | |
IntfDBMatcher ClientInterface | 客户端接口,该类型来自于 node.firewall.intf.IntfDBMatcher | |
IPDBMatcher clientAddress | 客户端地址 node.firewall.ip.IPDBMatcher | |
IPDBMatcher serverAddress | 服务器地址 node.firewall.ip.IPDBMatcher | |
String startTime | 起始时间,默认00:00 | |
String endTime | 终止时间,默认23:59 | |
String days | 允许的日期,以星期格式 默认mon,tue,wed,thu,fri,sat,sun | |
boolean getCapture() | | 获取是否为capture |
void setCapture() | boolean newValue | 设置是否为capture |
IntfDBMatcher getClientInterface() | | 获取客户端接口 |
voidsetClientInterface() | IntfDBMatcher newValue | 设置客户端接口 |
IPDBMatcher getClientAddress() | | 获取客户端地址 |
void setClientAddress() | IPDBMatcher newValue | 设置客户端地址 |
IPDBMatcher getServerAddress() | | 获取服务器地址 |
void setServerAddress() | IPDBMatcher newValue | 设置服务器地址 |
…… 剩余函数均为get和set函数,获取和设置起始时间,终止时间,日期 |
1.
设置允许通过的客户端或服务器地址,如下图
Java文件为PassedAddress.java PassedClient.java PassedServer.java
PassedAddress是一个抽象类,继承自Rule
函数
IPDBMatcher getAddress() | | 获取允许通过的地址 |
setAddress() | IPDBMatcher newValue | 设置允许通过的地址 |
PassedClient和PassedServer是继承自PassedAddress的两个子类,没有自己的额外的函数定义。
2.
沒有设定在 Pass List 的使用者,就必须要利用ID/Password的验证方式,除了本身可以设定自己的名单(local directory),也可以利用Active Domain的方式來认证, 但需要启动Directory Connector。我测试时使用的是 Local Directory 。
如下图,设置了一个guest账号,使的用户必须通过输入密码的方式联网
Java文件:AuthenticationTypeUserTy
类:class AuthenticationTypeUserTy
该类即重载了org.hibernate.usertype.UserType接口中的函数
其整体作用是对AuthenticationType类型变量的操作进行格式化,如写入,读取,序列化等等
函数或公有变量 | 说明 |
int[] sqlTypes() | 返回UserType所映射的字段的SQL类型。返回类型为int[],其中包含了映射各字段的SQL类型代码,为Types.VARCHAR类型 |
Class<AuthenticationType> returnedClass() | AuthenticationType是enum类型,来自于node.cpd.CPDSettings.AuthenticationType在CPDSettings中会详述,该函数返回了AuthenticationType.class |
boolean equals(Object x, Object y) | 两者比较方法,如果返回false,则会认为数据发生变化,将变化更新到库表中 |
Object deepCopy(Object v) | 深拷贝 |
boolean isMutable() | 本类型实例是否可变,这里返回false |
Object nullSafeGet(ResultSet rs , String[] names , Object owner) | 从ResultSet中读取数据,返回 AuthenticationType枚举中的一个常量 |
voidnullSafeSet(PreparedStatement ps, Object v, int i) | 将Object v(先转换成AuthenticationType类型)写入到数据库表PreparedStatement ps中,int i应为长度。 |
Object replace(Object original, Object target, Object owner) | 返回original 不明白其作用 |
Object assemble(Serializable cached, Object owner) | 用于将二级缓存中获取的缓存数据重新转换为指定的对象类型,cached是二级缓存中的数据,返回其的深拷贝(这里由于isMutable是false,所以在读取时可能不做深拷贝) |
Serializabledisassemble(Object value) | 在写入二级缓存前,将value转化为易于在二级缓存中保存的形式,即序列化。 |
int hashCode(Object o) | 返回hash值 |
类:class CPDBaseSettings implements Serializable
该类中的成员函数均为对下面列表中变量的get和set函数,故不在一一罗列
成员变量 | 说明 |
boolean captureBypassedTraffic | 默认为false 作用未知 |
AuthenticationType authenticationType | AuthenticationType是枚举结构 来自于 node.cpd.CPDSettings.AuthenticationType 有下列几种值ACTIVE_DIRECTORY, RADIUS, LOCAL_DIRECTORY, NONE 这里默认为NONE 用户可在界面上作选择。 |
int idleTimeout | 默认为0 |
int timeout | 默认为3600,单位second 超时时间,用户设置 |
boolean isLogoutButtonEnabled | 默认为false |
boolean areConcurrentLoginsEnabl | 默认为true |
以下变量是Captive Page功能中的变量 | |
PageType pageType | 枚举结构 来自于 node.cpd.CPDSettings.PageType 有下列几种值BASIC_LOGIN, BASIC_MESSAGE, CUSTOM |
String pageParameters | 默认为空 设置页面参数 |
String redirectUrl | 默认为空 设置重定向Url |
boolean useHttpsPage | 默认为false 是否使用Https页面 |
boolean isRedirectHttpsEnabled | 默认为false 是否允许重定向 |
boolean isDirectoryConnectorEnab | 默认为false 是否允许DirectoryConnector功能(这是个付费功能) |