captive portal code view (java部分)I

模式:功能图片,及解释

           实现该功能的java文件

           实现该功能的类

               每个类下主要的函数详解

                    一些次要的或者尚且无法确定作用的类或函数

           其他注释

           结构树

 

0.   Captive Hosts

主要设置Capture Rules,如下图

captive <wbr>portal <wbr> <wbr>code <wbr>view <wbr>(java部分)I

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

设置服务器地址

……

剩余函数均为getset函数,获取和设置起始时间,终止时间,日期

 

 

1.   Passed Hosts

设置允许通过的客户端或服务器地址,如下图

captive <wbr>portal <wbr> <wbr>code <wbr>view <wbr>(java部分)I

 

Java文件为PassedAddress.java PassedClient.java PassedServer.java

PassedAddress是一个抽象类,继承自Rule

函数

 

IPDBMatcher getAddress()

 

获取允许通过的地址

setAddress()

IPDBMatcher newValue

设置允许通过的地址

 

PassedClientPassedServer是继承自PassedAddress的两个子类,没有自己的额外的函数定义。

 

2.   User Authentication

沒有设定在 Pass List 的使用者,就必须要利用ID/Password的验证方式,除了本身可以设定自己的名单(local directory),也可以利用Active Domain的方式來认证, 但需要启动Directory Connector。我测试时使用的是 Local Directory 

如下图,设置了一个guest账号,使的用户必须通过输入密码的方式联网

captive <wbr>portal <wbr> <wbr>code <wbr>view <wbr>(java部分)I

captive <wbr>portal <wbr> <wbr>code <wbr>view <wbr>(java部分)I

 

 

Java文件:AuthenticationTypeUserType.java   CPDBaseSettings.java(一部分)

类:class AuthenticationTypeUserType implements UserType

该类即重载了org.hibernate.usertype.UserType接口中的函数

其整体作用是对AuthenticationType类型变量的操作进行格式化,如写入,读取,序列化等等

 

函数或公有变量

说明

int[] sqlTypes()

返回UserType所映射的字段的SQL类型。返回类型为int[],其中包含了映射各字段的SQL类型代码,为Types.VARCHAR类型

Class<AuthenticationType> returnedClass()

AuthenticationTypeenum类型,来自于node.cpd.CPDSettings.AuthenticationTypeCPDSettings中会详述,该函数返回了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是二级缓存中的数据,返回其的深拷贝(这里由于isMutablefalse,所以在读取时可能不做深拷贝)

Serializabledisassemble(Object value)

在写入二级缓存前,将value转化为易于在二级缓存中保存的形式,即序列化。

int hashCode(Object o)

返回hash

 

类:class CPDBaseSettings implements Serializable

该类中的成员函数均为对下面列表中变量的getset函数,故不在一一罗列

 

成员变量

说明

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 areConcurrentLoginsEnabled

默认为true

以下变量是Captive Page功能中的变量

PageType pageType

枚举结构 来自于

node.cpd.CPDSettings.PageType

有下列几种值BASIC_LOGIN, BASIC_MESSAGE, CUSTOM  默认为PageType.BASIC_MESSAGE (官网上貌似显示的默认是BASIC_LOGIN)

String pageParameters

默认为空 设置页面参数

String redirectUrl

默认为空 设置重定向Url

boolean useHttpsPage

默认为false 是否使用Https页面

boolean isRedirectHttpsEnabled

默认为false 是否允许重定向

boolean isDirectoryConnectorEnabled

默认为false 是否允许DirectoryConnector功能(这是个付费功能)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值