public void onAcctStarted(SessionExpiredEvent event) { JRadiusSession session = event.getSession(); String error = "Session Expired in Accounting-Started state, Accounting never stopped"; RadiusLog.warn(session.getSessionKey() + ": " + error); JRadiusLogEntry logEntry = session.getLogEntry(event, "0"); logEntry.setType("error"); logEntry.addMessage(error); }
if (logEntry.getInboundRequest() == null) logEntry.setInboundRequest(p.toString(false, true)); if (logEntry.getOutboundRequest() == null) logEntry.setOutboundRequest(p.toString(false, true)); if (logEntry.getInboundReply() == null) logEntry.setInboundReply(p.toString(false, true)); if (logEntry.getOutboundReply() == null) logEntry.setOutboundReply(p.toString(false, true));
public void commitLogEntries(int result) { Iterator<Map.Entry<String, JRadiusLogEntry>> it = logEntryMap.entrySet().iterator(); long now = new Date().getTime(); long threshold = 180; while (it.hasNext()) { Map.Entry<String, JRadiusLogEntry> mapEntry = it.next(); JRadiusLogEntry entry = mapEntry.getValue(); if (entry.isFinished() && !entry.isCommitted()) { entry.setCode(new Integer(result)); commitLogEntry(entry, result); entry.setCommitted(true); } if (entry.getLastUpdate().getTime() < (now - threshold)) { it.remove(); } } }
public void addLogMessage(JRadiusRequest request, String message) throws RadiusException { getLogEntry(request).addMessage(message); }
public JRadiusLogEntry getLogEntry(JRadiusRequest request) throws RadiusException { AttributeList ci = request.getConfigItems(); RadiusAttribute a = ci.get(Attr_JRadiusRequestId.TYPE); String key; if (a != null) key = (String)a.getValue().getValueObject(); else key = Integer.toString((char)request.getRequestPacket().getIdentifier()); JRadiusLogEntry entry = getLogEntry(request, key); entry.setCode(new Integer(request.getReturnValue())); return entry; }
logEntry.init(request, session);
public void addLogMessage(JRadiusRequest request, String message) throws RadiusException { getLogEntry(request).addMessage(message); }
public JRadiusLogEntry getLogEntry(JRadiusRequest request) throws RadiusException { AttributeList ci = request.getConfigItems(); RadiusAttribute a = ci.get(Attr_JRadiusRequestId.TYPE); String key; if (a != null) key = (String)a.getValue().getValueObject(); else key = Integer.toString((char)request.getRequestPacket().getIdentifier()); JRadiusLogEntry entry = getLogEntry(request, key); entry.setCode(new Integer(request.getReturnValue())); return entry; }
logEntry.init(request, session);
if (logEntry.getInboundRequest() == null) logEntry.setInboundRequest(p.toString(false, true)); if (logEntry.getOutboundRequest() == null) logEntry.setOutboundRequest(p.toString(false, true)); if (logEntry.getInboundReply() == null) logEntry.setInboundReply(p.toString(false, true)); if (logEntry.getOutboundReply() == null) logEntry.setOutboundReply(p.toString(false, true));
public void commitLogEntries(int result) { Iterator<Map.Entry<String, JRadiusLogEntry>> it = logEntryMap.entrySet().iterator(); long now = new Date().getTime(); long threshold = 180; while (it.hasNext()) { Map.Entry<String, JRadiusLogEntry> mapEntry = it.next(); JRadiusLogEntry entry = mapEntry.getValue(); if (entry.isFinished() && !entry.isCommitted()) { entry.setCode(new Integer(result)); commitLogEntry(entry, result); entry.setCommitted(true); } if (entry.getLastUpdate().getTime() < (now - threshold)) { it.remove(); } } }
public void onAcctStarted(SessionExpiredEvent event) { JRadiusSession session = event.getSession(); String error = "Session Expired in Accounting-Started state, Accounting never stopped"; RadiusLog.warn(session.getSessionKey() + ": " + error); JRadiusLogEntry logEntry = session.getLogEntry(event, "0"); logEntry.setType("error"); logEntry.addMessage(error); }
public void addLogMessage(JRadiusRequest request, String message) throws RadiusException { getLogEntry(request).addMessage(message); }
public JRadiusLogEntry getLogEntry(JRadiusRequest request) throws RadiusException { AttributeList ci = request.getConfigItems(); RadiusAttribute a = ci.get(Attr_JRadiusRequestId.TYPE); String key; if (a != null) key = (String)a.getValue().getValueObject(); else key = Integer.toString((char)request.getRequestPacket().getIdentifier()); JRadiusLogEntry entry = getLogEntry(request, key); entry.setCode(new Integer(request.getReturnValue())); return entry; }
logEntry.init(request, session);
if (logEntry.getInboundRequest() == null) logEntry.setInboundRequest(p.toString(false, true)); if (logEntry.getOutboundRequest() == null) logEntry.setOutboundRequest(p.toString(false, true)); if (logEntry.getInboundReply() == null) logEntry.setInboundReply(p.toString(false, true)); if (logEntry.getOutboundReply() == null) logEntry.setOutboundReply(p.toString(false, true));
public void commitLogEntries(int result) { Iterator<Map.Entry<String, JRadiusLogEntry>> it = logEntryMap.entrySet().iterator(); long now = new Date().getTime(); long threshold = 180; while (it.hasNext()) { Map.Entry<String, JRadiusLogEntry> mapEntry = it.next(); JRadiusLogEntry entry = mapEntry.getValue(); if (entry.isFinished() && !entry.isCommitted()) { entry.setCode(new Integer(result)); commitLogEntry(entry, result); entry.setCommitted(true); } if (entry.getLastUpdate().getTime() < (now - threshold)) { it.remove(); } } }
public void onAcctStarted(SessionExpiredEvent event) { JRadiusSession session = event.getSession(); String error = "Session Expired in Accounting-Started state, Accounting never stopped"; RadiusLog.warn(session.getSessionKey() + ": " + error); JRadiusLogEntry logEntry = session.getLogEntry(event, "0"); logEntry.setType("error"); logEntry.addMessage(error); }
public boolean onNoAccountingStatusType(JRadiusRequest request) throws RadiusException { JRadiusLogEntry logEntry = getLogEntry(request); String error = "Accounting packet without a Acct-Status-Type!"; RadiusLog.error(error); logEntry.addMessage(error); request.setReturnValue(JRadiusServer.RLM_MODULE_REJECT); return true; }
public void onAuthAccepted(SessionExpiredEvent event) { JRadiusSession session = event.getSession(); String error = "Session Expired in Auth-Accepted state, Accounting never started"; RadiusLog.warn(session.getSessionKey() + ": " + error); JRadiusLogEntry logEntry = session.getLogEntry(event, "0"); logEntry.setType("error"); logEntry.addMessage(error); session.commitLogEntries(JRadiusServer.RLM_MODULE_FAIL); }