diff --git a/pom.xml b/pom.xml index a646f6d..77e9004 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,14 @@ 1.0.0-SNAPSHOT com.loafle.overflow.crawler + + + + com.fasterxml.jackson.core + jackson-databind + 2.8.8 + + \ No newline at end of file diff --git a/src/main/java/com/loafle/overflow/crawler/config/Auth.java b/src/main/java/com/loafle/overflow/crawler/config/Auth.java new file mode 100644 index 0000000..1a0e9ad --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Auth.java @@ -0,0 +1,7 @@ +package com.loafle.overflow.crawler.config; + +/** + * Created by root on 17. 4. 13. + */ +public class Auth { +} diff --git a/src/main/java/com/loafle/overflow/crawler/config/Config.java b/src/main/java/com/loafle/overflow/crawler/config/Config.java new file mode 100644 index 0000000..b08dd02 --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Config.java @@ -0,0 +1,55 @@ +package com.loafle.overflow.crawler.config; + +import java.util.List; + +/** + * Created by root on 17. 4. 13. + */ +public class Config { + + private String id; + private Target target; + private Schedule schedule; + private Crawler crawler; + private List items; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Target getTarget() { + return target; + } + + public void setTarget(Target target) { + this.target = target; + } + + public Schedule getSchedule() { + return schedule; + } + + public void setSchedule(Schedule schedule) { + this.schedule = schedule; + } + + public Crawler getCrawler() { + return crawler; + } + + public void setCrawler(Crawler crawler) { + this.crawler = crawler; + } + + public List getItems() { + return items; + } + + public void setItems(List items) { + this.items = items; + } +} diff --git a/src/main/java/com/loafle/overflow/crawler/config/Connection.java b/src/main/java/com/loafle/overflow/crawler/config/Connection.java new file mode 100644 index 0000000..96adad5 --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Connection.java @@ -0,0 +1,43 @@ +package com.loafle.overflow.crawler.config; + +/** + * Created by root on 17. 4. 13. + */ +public class Connection { + private String ip; + private String port; + private String portType; + private boolean ssl; + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public String getPortType() { + return portType; + } + + public void setPortType(String portType) { + this.portType = portType; + } + + public boolean isSsl() { + return ssl; + } + + public void setSsl(boolean ssl) { + this.ssl = ssl; + } +} diff --git a/src/main/java/com/loafle/overflow/crawler/config/Crawler.java b/src/main/java/com/loafle/overflow/crawler/config/Crawler.java new file mode 100644 index 0000000..195aa3a --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Crawler.java @@ -0,0 +1,25 @@ +package com.loafle.overflow.crawler.config; + +/** + * Created by root on 17. 4. 13. + */ +public class Crawler { + private String name; + private String container; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getContainer() { + return container; + } + + public void setContainer(String container) { + this.container = container; + } +} diff --git a/src/main/java/com/loafle/overflow/crawler/config/Item.java b/src/main/java/com/loafle/overflow/crawler/config/Item.java new file mode 100644 index 0000000..504ad36 --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Item.java @@ -0,0 +1,7 @@ +package com.loafle.overflow.crawler.config; + +/** + * Created by root on 17. 4. 13. + */ +public class Item { +} diff --git a/src/main/java/com/loafle/overflow/crawler/config/Schedule.java b/src/main/java/com/loafle/overflow/crawler/config/Schedule.java new file mode 100644 index 0000000..214db54 --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Schedule.java @@ -0,0 +1,16 @@ +package com.loafle.overflow.crawler.config; + +/** + * Created by root on 17. 4. 13. + */ +public class Schedule { + private String interval; + + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } +} diff --git a/src/main/java/com/loafle/overflow/crawler/config/Target.java b/src/main/java/com/loafle/overflow/crawler/config/Target.java new file mode 100644 index 0000000..5e7619c --- /dev/null +++ b/src/main/java/com/loafle/overflow/crawler/config/Target.java @@ -0,0 +1,25 @@ +package com.loafle.overflow.crawler.config; + +/** + * Created by root on 17. 4. 13. + */ +public class Target { + private Auth auth; + private Connection connection; + + public Auth getAuth() { + return auth; + } + + public void setAuth(Auth auth) { + this.auth = auth; + } + + public Connection getConnection() { + return connection; + } + + public void setConnection(Connection connection) { + this.connection = connection; + } +} diff --git a/src/test/resources/config/example.json b/src/test/resources/config/example.json new file mode 100644 index 0000000..3cf0a7c --- /dev/null +++ b/src/test/resources/config/example.json @@ -0,0 +1,23 @@ +{ + "id" : "SOEJWEOJWOEJOSDJFOASDJFOSDFO2903870928734", + "target" : { + "connection" : { + "ip" : "192.168.1.104", + "port" : "6379", + "ssl" : false, + "portType" : "tcp" + }, + "auth" : { + + } + }, + "schedule" : { + "interval" : "10" + }, + "crawler" : { + "name":"redis_protocol_crawler", + "container":"network_crawler" + }, + "items" : [ + ] +} \ No newline at end of file