# HG changeset patch # User František Kučera # Date 1234379280 -3600 # Node ID 62bddd9b51fbf75b6b055cc1a5a342ee2b57bcee # Parent e3e2a3a4c36afdc65b91edb70631b8c3cf08b232 Hotová jednoduchá JSP vrstva diff -r e3e2a3a4c36a -r 62bddd9b51fb java/HrisniciSpameri/nbproject/private/private.xml --- a/java/HrisniciSpameri/nbproject/private/private.xml Wed Feb 11 19:36:28 2009 +0100 +++ b/java/HrisniciSpameri/nbproject/private/private.xml Wed Feb 11 20:08:00 2009 +0100 @@ -1,2 +1,12 @@ - + + + + file:/home/fiki/src/HrisniciSpameri/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/DenniSouhrn.java + file:/home/fiki/src/HrisniciSpameri/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/Cil.java + file:/home/fiki/src/HrisniciSpameri/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/Souhrn.java + file:/home/fiki/src/HrisniciSpameri/java/HrisniciSpameri/web/index.jsp + file:/home/fiki/src/HrisniciSpameri/java/HrisniciSpameri/web/souhrn.jspx + file:/home/fiki/src/HrisniciSpameri/java/HrisniciSpameri/web/styl.css + + diff -r e3e2a3a4c36a -r 62bddd9b51fb java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/DenniSouhrn.java --- a/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/DenniSouhrn.java Wed Feb 11 19:36:28 2009 +0100 +++ b/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/DenniSouhrn.java Wed Feb 11 20:08:00 2009 +0100 @@ -1,6 +1,7 @@ package cz.frantovo.hrisniciSpameri; import cz.frantovo.hrisniciSpameri.dto.Cil; +import cz.frantovo.hrisniciSpameri.dto.SitovaAdresa; import cz.frantovo.hrisniciSpameri.dto.Souhrn; import java.io.Serializable; import java.net.InetAddress; @@ -72,12 +73,8 @@ Cil cil = new Cil(1, "Frantovo.cz", "http://frantovo.cz/blog/", null, null); for (int i = 1; i < 11; i++) { - try { - Souhrn s = new Souhrn(getVychoziDen(), InetAddress.getByName("127.0.0.1"), 100 + i, cil); - souhrn.add(s); - } catch (UnknownHostException e) { - log.log(Level.SEVERE, null, e); - } + Souhrn s = new Souhrn(getVychoziDen(), new SitovaAdresa("10.0.0.8", i + ".frantovo.cz"), 100 + i, cil); + souhrn.add(s); } return souhrn; diff -r e3e2a3a4c36a -r 62bddd9b51fb java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/SitovaAdresa.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/SitovaAdresa.java Wed Feb 11 20:08:00 2009 +0100 @@ -0,0 +1,33 @@ +package cz.frantovo.hrisniciSpameri.dto; + +/** + * Hloupá přepravka na dvojici IP adresa – doména. + * Neklade si za cíl DNS překlady, jen přenáší tyto dvě hodnoty. + * @author fiki + */ +public class SitovaAdresa { + + private String ip; + private String domena; + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getDomena() { + return domena; + } + + public void setDomena(String domena) { + this.domena = domena; + } + + public SitovaAdresa(String ip, String domena) { + this.ip = ip; + this.domena = domena; + } +} diff -r e3e2a3a4c36a -r 62bddd9b51fb java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/Souhrn.java --- a/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/Souhrn.java Wed Feb 11 19:36:28 2009 +0100 +++ b/java/HrisniciSpameri/src/java/cz/frantovo/hrisniciSpameri/dto/Souhrn.java Wed Feb 11 20:08:00 2009 +0100 @@ -12,7 +12,7 @@ private static final long serialVersionUID = 6502435361626487366L; private Date den; - private InetAddress adresa; + private SitovaAdresa adresa; private int pocet; private Cil cil; @@ -40,15 +40,15 @@ this.cil = cil; } - public InetAddress getAdresa() { + public SitovaAdresa getAdresa() { return adresa; } - public void setAdresa(InetAddress adresa) { + public void setAdresa(SitovaAdresa adresa) { this.adresa = adresa; } - public Souhrn(Date den, InetAddress adresa, int pocet, Cil cil) { + public Souhrn(Date den, SitovaAdresa adresa, int pocet, Cil cil) { this.den = den; this.adresa = adresa; this.pocet = pocet; diff -r e3e2a3a4c36a -r 62bddd9b51fb java/HrisniciSpameri/web/souhrn.jspx --- a/java/HrisniciSpameri/web/souhrn.jspx Wed Feb 11 19:36:28 2009 +0100 +++ b/java/HrisniciSpameri/web/souhrn.jspx Wed Feb 11 20:08:00 2009 +0100 @@ -6,6 +6,7 @@ --> @@ -25,10 +26,18 @@ - - + + - + + + + + + + + + diff -r e3e2a3a4c36a -r 62bddd9b51fb java/HrisniciSpameri/web/styl.css --- a/java/HrisniciSpameri/web/styl.css Wed Feb 11 19:36:28 2009 +0100 +++ b/java/HrisniciSpameri/web/styl.css Wed Feb 11 20:08:00 2009 +0100 @@ -1,3 +1,7 @@ +body { + font-family: sans-serif; +} + table { border: 1px solid black; border-collapse:collapse; @@ -5,6 +9,8 @@ td { border: 1px solid black; padding: 3px; + padding-left: 5px; + padding-right: 5px; } thead { background: silver; diff -r e3e2a3a4c36a -r 62bddd9b51fb sql/schéma.sql --- a/sql/schéma.sql Wed Feb 11 19:36:28 2009 +0100 +++ b/sql/schéma.sql Wed Feb 11 20:08:00 2009 +0100 @@ -26,7 +26,7 @@ CREATE TABLE souhrn ( den date NOT NULL, - ip inet NOT NULL, -- IP adresa hříšníka + ip character varying NOT NULL, -- IP adresa hříšníka domena character varying, -- Doménové jméno hříšníka (překlad IP adresy) pocet bigint NOT NULL, -- Počet pokusů o spamování v daném dni cil bigint, -- Cíl útoku - spamování