From d9019cc15044bb46816ac45887feaf6880838081 Mon Sep 17 00:00:00 2001 From: "jackdaw@loafle.com" Date: Wed, 12 Apr 2017 14:59:05 +0900 Subject: [PATCH] add crawlers --- .../loafle/overflow/rpc/api/RemoteImpl.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/com/loafle/overflow/rpc/api/RemoteImpl.java b/src/main/java/com/loafle/overflow/rpc/api/RemoteImpl.java index 77fb744..81635a8 100644 --- a/src/main/java/com/loafle/overflow/rpc/api/RemoteImpl.java +++ b/src/main/java/com/loafle/overflow/rpc/api/RemoteImpl.java @@ -3,6 +3,11 @@ package com.loafle.overflow.rpc.api; import com.fasterxml.jackson.databind.ObjectMapper; import com.googlecode.jsonrpc4j.spring.AutoJsonRpcServiceImpl; import com.loafle.overflow.crawler.Crawler; +import com.loafle.overflow.crawler.mongo.MongoCrawler; +import com.loafle.overflow.crawler.redis.RedisCralwer; +import com.loafle.overflow.crawler.snmp.SNMPCrawler; +import com.loafle.overflow.crawler.sql.SQLCrawler; +import com.loafle.overflow.crawler.wmi.WMICrawler; import com.loafle.overflow.rpc.model.Input; import com.loafle.overflow.rpc.model.Output; import org.springframework.stereotype.Service; @@ -17,6 +22,20 @@ public class RemoteImpl implements Remote { private Map crawlerMap = null; + public RemoteImpl() { + crawlerMap = new HashMap(); + + addDelegate("SQL",new SQLCrawler()); + addDelegate("SNMP",new SNMPCrawler()); + addDelegate("REDIS",new RedisCralwer()); + addDelegate("MONGO",new MongoCrawler()); + addDelegate("WMI",new WMICrawler()); + //addDelegate("JMX",new JMXCrawler()); + } + + public Crawler getCrawler(String id) { + return crawlerMap.get(id); + } @Override public Output init(Input input) throws Exception {