From 3ccea663d543bfa8ec4752f5ea98ef274adbff3d Mon Sep 17 00:00:00 2001 From: snoop Date: Fri, 29 Sep 2017 14:48:14 +0900 Subject: [PATCH] added start discovery --- .../discovery/model/DiscoveryStartInfo.java | 63 +++++++++++++++++++ .../discovery/service/DiscoveryService.java | 30 +++++++++ 2 files changed, 93 insertions(+) create mode 100644 src/main/java/com/loafle/overflow/module/discovery/model/DiscoveryStartInfo.java create mode 100644 src/main/java/com/loafle/overflow/module/discovery/service/DiscoveryService.java diff --git a/src/main/java/com/loafle/overflow/module/discovery/model/DiscoveryStartInfo.java b/src/main/java/com/loafle/overflow/module/discovery/model/DiscoveryStartInfo.java new file mode 100644 index 0000000..2a18f2a --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/discovery/model/DiscoveryStartInfo.java @@ -0,0 +1,63 @@ +package com.loafle.overflow.module.discovery.model; + +import java.util.List; + +/** + * Created by snoop on 17. 9. 29. + */ +public class DiscoveryStartInfo { + String startIp; + String endIP; + String excludeIp; + String startPort; + String endPort; + List services; + + public String getStartIp() { + return startIp; + } + + public void setStartIp(String startIp) { + this.startIp = startIp; + } + + public String getEndIP() { + return endIP; + } + + public void setEndIP(String endIP) { + this.endIP = endIP; + } + + public String getExcludeIp() { + return excludeIp; + } + + public void setExcludeIp(String excludeIp) { + this.excludeIp = excludeIp; + } + + public String getStartPort() { + return startPort; + } + + public void setStartPort(String startPort) { + this.startPort = startPort; + } + + public String getEndPort() { + return endPort; + } + + public void setEndPort(String endPort) { + this.endPort = endPort; + } + + public List getServices() { + return services; + } + + public void setServices(List services) { + this.services = services; + } +} diff --git a/src/main/java/com/loafle/overflow/module/discovery/service/DiscoveryService.java b/src/main/java/com/loafle/overflow/module/discovery/service/DiscoveryService.java new file mode 100644 index 0000000..cebcbe1 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/discovery/service/DiscoveryService.java @@ -0,0 +1,30 @@ +package com.loafle.overflow.module.discovery.service; + +import com.loafle.overflow.commons.service.MessagePublisher; +import com.loafle.overflow.module.discovery.model.DiscoveryStartInfo; +import org.codehaus.jackson.map.ObjectMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.IOException; + +/** + * Created by snoop on 17. 9. 28. + */ +@Service("DiscoveryService") +public class DiscoveryService { + + @Autowired + private MessagePublisher messagePublisher; + + public void startDiscovery(DiscoveryStartInfo startInfo) throws IOException { + + ObjectMapper objectMapper = new ObjectMapper(); + + String json = objectMapper.writeValueAsString(startInfo); + + System.out.println("Start Discovery"); + System.out.println(json); +// this.messagePublisher.publishToProbe("/auth", noAuthProbe.getTempProbeKey(), "NoAuthProbeService.acceptNoAuthProbe", probe.getProbeKey()); + } +}