use of net.i2p.data.i2cp.AbuseSeverity in project i2p.i2p by i2p.
the class I2CPMessageProducer method reportAbuse.
/**
* Send an abuse message to the router
*/
public void reportAbuse(I2PSessionImpl session, int msgId, int severity) throws I2PSessionException {
ReportAbuseMessage msg = new ReportAbuseMessage();
MessageId id = new MessageId();
id.setMessageId(msgId);
msg.setMessageId(id);
AbuseReason reason = new AbuseReason();
reason.setReason("Not specified");
msg.setReason(reason);
AbuseSeverity sv = new AbuseSeverity();
sv.setSeverity(severity);
msg.setSeverity(sv);
session.sendMessage(msg);
}
use of net.i2p.data.i2cp.AbuseSeverity in project i2p.i2p by i2p.
the class ReportAbuseJob method runJob.
public void runJob() {
if (_runner.isDead())
return;
AbuseReason res = new AbuseReason();
res.setReason(_reason);
AbuseSeverity sev = new AbuseSeverity();
sev.setSeverity(_severity);
ReportAbuseMessage msg = new ReportAbuseMessage();
msg.setReason(res);
SessionId id = _runner.getSessionId(_dest.calculateHash());
if (id == null)
return;
msg.setSessionId(id);
msg.setSeverity(sev);
try {
_runner.doSend(msg);
} catch (I2CPMessageException ime) {
_log.error("Error reporting abuse", ime);
}
}
Aggregations