public class InetRadiusProcessor extends RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams> implements EventListener<InetAccountingEvent>, ru.bitel.bgbilling.kernel.application.server.ExtendedLifecycle, ru.bitel.bgbilling.kernel.application.server.CommandListener
Modifier and Type | Class and Description |
---|---|
static class |
InetRadiusProcessor.AuthAcceptEvent |
RadiusProcessor.ConnectionIterator<C extends ru.bitel.bgbilling.kernel.network.radius.nas.NasConnection<?>,N extends ru.bitel.bgbilling.kernel.network.radius.nas.Nas<C,?,?>>
Modifier and Type | Field and Description |
---|---|
protected ru.bitel.bgbilling.modules.inet.access.Access |
access |
static RadiusPacket.RadiusPacketOption<java.lang.Integer> |
ACCESS_CODE
Опция, указывающая AccessCode.
|
protected ru.bitel.bgbilling.modules.inet.accounting.Accounting |
accounting |
static RadiusPacket.RadiusPacketOption<java.lang.Object> |
AGENT_CIRCUIT_ID
Circuit-Id из опции 82.
|
static RadiusPacket.RadiusPacketOption<java.lang.Object> |
AGENT_REMOTE_ID
Id удаленного устройства.
|
static RadiusPacket.RadiusPacketOption<java.lang.Object> |
AGENT_SVLAN
SVLAN, по которому будет происходить поиск агентского устройства
|
protected int |
applicationId |
static RadiusPacket.RadiusPacketOption<java.lang.Short> |
DEVICE_STATE
Опция, указывающая текущее состояние соединения.
|
static RadiusPacket.RadiusPacketOption<java.lang.String> |
IDENTIFIER
Опция, указывающая идентификатор сервиса.
|
static RadiusPacket.RadiusPacketOption<java.lang.Object> |
INTERFACE_ID
interfaceId.
|
static RadiusPacket.RadiusPacketOption<java.lang.String> |
MAC_ADDRESS
Опция, указывающая MAC-адрес.
|
static RadiusPacket.RadiusPacketOption<byte[]> |
MAC_ADDRESS_BYTES
Опция, указывающая MAC-адрес в байтах.
|
static RadiusPacket.RadiusPacketOption<java.lang.String> |
PARENT_ACCT_SESSION_ID
Опция, указывающая id родительского соединения.
|
static java.lang.String |
REALM_DEFAULT |
static java.lang.String |
REALM_DISABLE |
static RadiusPacket.RadiusPacketOption<java.lang.String> |
SERVICE_NAME
Опция, указывающая сервис текущего аккаунтинга, при посервисном аккаунтинге и для сервисного(дочернего) аккаунтинга.
|
static RadiusPacket.RadiusPacketOption<java.lang.Object> |
VLAN_ID
vlanId.
|
accountingIgnoreCount, accountingStartCounter, accountingStopCounter, accountingUpdateCounter, accountingUpdateIgnoreCount, antispamIgnoreCount, authenticationAcceptCounter, authenticationIgnoreCount, authenticationRejectCounter, forwardAccessAnswer, forwardAccessRequest, forwardAccountingResponse, forwardAfterPreprocess, forwardAfterProcess, module, nasList, setup
Constructor and Description |
---|
InetRadiusProcessor(Setup setup,
ru.bitel.bgbilling.modules.inet.access.Access access,
ru.bitel.bgbilling.modules.inet.accounting.Accounting accounting) |
Modifier and Type | Method and Description |
---|---|
protected void |
accessRequestImpl(RadiusListenerWorker<InetNas> req,
InetNas nas,
RadiusPacket request,
RadiusPacket response,
java.util.Date date,
RadiusSession<InetNas,InetRadiusSessionParams> radiusSession,
int logRecordId,
ConnectionSet connectionSet) |
protected void |
addToLog(java.util.Date date,
RadiusPacket packet,
int recordId) |
protected int |
authentication(RadiusListenerWorker<?> req,
InetNas nas,
RadiusSession<InetNas,InetRadiusSessionParams> session,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet,
int logRecordId)
Обработка Access-Request разделяется на два этапа - аутентификацию и авторизацию.
|
protected int |
authenticationImpl(RadiusListenerWorker<?> req,
InetNas nas,
RadiusSession<InetNas,InetRadiusSessionParams> radiusSession,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet,
int logRecordId) |
protected int |
authorization(RadiusListenerWorker<?> req,
InetNas nas,
RadiusSession<InetNas,InetRadiusSessionParams> radiusSession,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet,
int logRecordId,
ContractManager __cm,
Contract __contract,
java.lang.Object _login,
java.lang.String username)
Авторизация клиента.
|
void |
destroy() |
java.lang.String |
executeCommand(java.lang.String cmd,
java.lang.String param) |
protected ru.bitel.bgbilling.modules.inet.runtime.ServSearchResult |
findServRuntime(ru.bitel.bgbilling.modules.inet.runtime.InetApplication application,
RadiusListenerWorker<?> req,
InetNas nas,
java.lang.String userName,
RadiusPacket request,
java.util.Date time)
Вызывается при Access-Request и при Accounting-Request, если сессии еще нет.
|
java.lang.String |
getCommandsHelp() |
protected int |
getModuleId() |
protected InetNas |
getNas(java.net.SocketAddress clientAddress,
RadiusPacket packet)
Получение наса по радиус пакету.
|
InetNasConnection |
getNasConnection(RadiusListenerWorker<?> req,
ConnectionSet connectionSet,
InetNas nas,
RadiusPacket request,
java.util.Date time)
Ставит блокировку на inetServRuntime!
|
java.lang.String |
getStatus() |
void |
init() |
protected int |
insertToLog(java.util.Date date,
RadiusPacket packet) |
protected RadiusSession<InetNas,InetRadiusSessionParams> |
newRadiusSession(java.sql.Connection con,
InetNas nas,
RadiusPacket request,
RadiusSession.State state)
Создание новой радиус сессии.
|
void |
notify(InetAccountingEvent e,
EventListenerContext ctx) |
protected void |
postprocessAccessRequest(InetNas nas,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet)
Постобработка Access-Request
По умолчанию - обработка скриптом предобработки наса.
|
protected void |
postprocessAccountingRequest(InetNas nas,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet)
Постобработка Accounting-Request
По умолчанию - обработка скриптом предобработки наса.
|
protected void |
preprocessAccessRequest(InetNas nas,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet)
Предобработка Access-Request
По умолчанию - обработка скриптом предобработки наса.
|
protected void |
preprocessAccountingRequest(InetNas nas,
RadiusPacket request,
RadiusPacket response,
ConnectionSet connectionSet)
Предобработка Accounting-Request
По умолчанию - обработка скриптом предобработки наса.
|
protected void |
reloadConfig()
Перезагрузка конфигурации сервера + модуля.
|
protected void |
reloadNasList()
Корректная перезагрузка насов (конфига, инспекторов и т.п.).
|
void |
start() |
void |
stop() |
accessRequest, accounting, accountingRequest, afterNasListReload, connections, getAccessAcceptPerMinute, getAccessRejectPerMinute, getAccessRequestIgnorePerMinute, getAccountingStartPerMinute, getAccountingStopPerMinute, getAccountingUpdateIgnorePerMinute, getAccountingUpdatePerMinute, getActiveConnectionsCount, getAntispamIgnorePerMinute, getConnectionList, getNasList, getStoppedConnectionCount, getSuspendedConnectionCount, newInstance, processConnections
public static final java.lang.String REALM_DEFAULT
public static final java.lang.String REALM_DISABLE
public static final RadiusPacket.RadiusPacketOption<java.lang.Short> DEVICE_STATE
RadiusPacket
request в обработчике процессора протокола, при предобработке запроса.public static final RadiusPacket.RadiusPacketOption<java.lang.String> PARENT_ACCT_SESSION_ID
RadiusPacket
request в обработчике процессора протокола, при предобработке запроса.public static final RadiusPacket.RadiusPacketOption<java.lang.String> SERVICE_NAME
RadiusPacket
request в обработчике процессора протокола, при предобработке запроса.public static final RadiusPacket.RadiusPacketOption<java.lang.String> IDENTIFIER
RadiusPacket
request в обработчике процессора протокола, при предобработке запроса.public static final RadiusPacket.RadiusPacketOption<java.lang.String> MAC_ADDRESS
RadiusPacket
request в обработчике процессора протокола, при предобработке запроса.public static final RadiusPacket.RadiusPacketOption<byte[]> MAC_ADDRESS_BYTES
RadiusPacket
request в обработчике процессора протокола, при предобработке запроса.public static final RadiusPacket.RadiusPacketOption<java.lang.Integer> ACCESS_CODE
RadiusPacket
request в обработчике процессора протокола, при постобработке запроса.public static final RadiusPacket.RadiusPacketOption<java.lang.Object> AGENT_REMOTE_ID
public static final RadiusPacket.RadiusPacketOption<java.lang.Object> AGENT_CIRCUIT_ID
VLAN_ID
и INTERFACE_ID
public static final RadiusPacket.RadiusPacketOption<java.lang.Object> VLAN_ID
public static final RadiusPacket.RadiusPacketOption<java.lang.Object> INTERFACE_ID
public static final RadiusPacket.RadiusPacketOption<java.lang.Object> AGENT_SVLAN
protected final ru.bitel.bgbilling.modules.inet.access.Access access
protected final ru.bitel.bgbilling.modules.inet.accounting.Accounting accounting
protected final int applicationId
@ConstructorProperties(value={"setup","access","accounting"}) public InetRadiusProcessor(Setup setup, ru.bitel.bgbilling.modules.inet.access.Access access, ru.bitel.bgbilling.modules.inet.accounting.Accounting accounting) throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGException
protected final int getModuleId()
public void init() throws java.lang.Exception
init
in interface ru.bitel.bgbilling.kernel.application.server.ExtendedLifecycle
java.lang.Exception
public void start() throws java.lang.Exception
start
in interface ru.bitel.bgbilling.kernel.application.server.Lifecycle
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface ru.bitel.bgbilling.kernel.application.server.Lifecycle
java.lang.Exception
public void destroy() throws java.lang.Exception
destroy
in interface ru.bitel.bgbilling.kernel.application.server.ExtendedLifecycle
java.lang.Exception
protected void reloadConfig()
reloadConfig
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
protected void reloadNasList()
RadiusProcessor
reloadNasList
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
protected RadiusSession<InetNas,InetRadiusSessionParams> newRadiusSession(java.sql.Connection con, InetNas nas, RadiusPacket request, RadiusSession.State state)
RadiusProcessor
newRadiusSession
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
nas
- TODOprotected void preprocessAccessRequest(InetNas nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet)
RadiusProcessor
preprocessAccessRequest
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
connectionSet
- экземпляры соединений с БД: master, slave, trashprotected void preprocessAccountingRequest(InetNas nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet)
RadiusProcessor
preprocessAccountingRequest
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
connectionSet
- экземпляры соединений с БД: master, slave, trashprotected void accessRequestImpl(RadiusListenerWorker<InetNas> req, InetNas nas, RadiusPacket request, RadiusPacket response, java.util.Date date, RadiusSession<InetNas,InetRadiusSessionParams> radiusSession, int logRecordId, ConnectionSet connectionSet)
accessRequestImpl
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
protected int authentication(RadiusListenerWorker<?> req, InetNas nas, RadiusSession<InetNas,InetRadiusSessionParams> session, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet, int logRecordId)
RadiusProcessor
RadiusSession
RadiusProcessor.authorization(RadiusListenerWorker, Nas, RadiusSession, RadiusPacket, RadiusPacket, ConnectionSet, int, ContractManager, Contract, Object, String)
authentication
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
protected int authenticationImpl(RadiusListenerWorker<?> req, InetNas nas, RadiusSession<InetNas,InetRadiusSessionParams> radiusSession, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet, int logRecordId) throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGException
protected int authorization(RadiusListenerWorker<?> req, InetNas nas, RadiusSession<InetNas,InetRadiusSessionParams> radiusSession, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet, int logRecordId, ContractManager __cm, Contract __contract, java.lang.Object _login, java.lang.String username)
RadiusProcessor
authorization
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
connectionSet
- экземпляры соединений с БД: master, slave, trashRadiusProcessor.authentication(RadiusListenerWorker, Nas, RadiusSession, RadiusPacket, RadiusPacket, ConnectionSet, int)
public java.lang.String getStatus()
getStatus
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
public java.lang.String getCommandsHelp()
getCommandsHelp
in interface ru.bitel.bgbilling.kernel.application.server.CommandListener
public java.lang.String executeCommand(java.lang.String cmd, java.lang.String param)
executeCommand
in interface ru.bitel.bgbilling.kernel.application.server.CommandListener
executeCommand
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
protected ru.bitel.bgbilling.modules.inet.runtime.ServSearchResult findServRuntime(ru.bitel.bgbilling.modules.inet.runtime.InetApplication application, RadiusListenerWorker<?> req, InetNas nas, java.lang.String userName, RadiusPacket request, java.util.Date time)
application
- req
- nas
- userName
- request
- time
- public InetNasConnection getNasConnection(RadiusListenerWorker<?> req, ConnectionSet connectionSet, InetNas nas, RadiusPacket request, java.util.Date time) throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGException
protected void addToLog(java.util.Date date, RadiusPacket packet, int recordId)
addToLog
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
protected int insertToLog(java.util.Date date, RadiusPacket packet)
insertToLog
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
public void notify(InetAccountingEvent e, EventListenerContext ctx) throws ru.bitel.bgbilling.common.BGException
notify
in interface EventListener<InetAccountingEvent>
ru.bitel.bgbilling.common.BGException
protected void postprocessAccountingRequest(InetNas nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet)
RadiusProcessor
postprocessAccountingRequest
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
connectionSet
- экземпляры соединений с БД: master, slave, trashprotected void postprocessAccessRequest(InetNas nas, RadiusPacket request, RadiusPacket response, ConnectionSet connectionSet)
RadiusProcessor
postprocessAccessRequest
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>
connectionSet
- экземпляры соединений с БД: master, slave, trashprotected InetNas getNas(java.net.SocketAddress clientAddress, RadiusPacket packet)
RadiusProcessor
getNas
in class RadiusProcessor<InetNasConnection,InetNas,InetRadiusSessionParams>