浏览代码

dev centercomm

shjung 2 年之前
父节点
当前提交
7458de2c20
共有 42 个文件被更改,包括 357 次插入1521 次删除
  1. 8 1
      pom.xml
  2. 50 41
      src/main/java/com/its/vds/VdsCommServerApplication.java
  3. 21 17
      src/main/java/com/its/vds/config/ApplicationConfig.java
  4. 0 32
      src/main/java/com/its/vds/config/FacilityManagerConfig.java
  5. 0 55
      src/main/java/com/its/vds/config/ProcessConfig.java
  6. 2 2
      src/main/java/com/its/vds/config/RunningConfig.java
  7. 0 92
      src/main/java/com/its/vds/config/SystemInfo.java
  8. 1 5
      src/main/java/com/its/vds/config/ThreadPoolInitializer.java
  9. 0 19
      src/main/java/com/its/vds/entity/TbVdsCtlr.java
  10. 8 8
      src/main/java/com/its/vds/scheduler/SchedulerTask.java
  11. 3 3
      src/main/java/com/its/vds/service/UnitSystService.java
  12. 0 32
      src/main/java/com/its/vds/service/VdsCtlrService.java
  13. 9 14
      src/main/java/com/its/vds/ui/MainUI.java
  14. 10 3
      src/main/java/com/its/vds/ui/SubUIController.java
  15. 5 5
      src/main/java/com/its/vds/webapp/controller/WebAppCommonController.java
  16. 3 3
      src/main/java/com/its/vds/webapp/controller/WebAppController.java
  17. 2 8
      src/main/java/com/its/vds/xnettcp/TcpServerAbstract.java
  18. 3 3
      src/main/java/com/its/vds/xnettcp/TcpServerVdsComm.java
  19. 2 2
      src/main/java/com/its/vds/xnettcp/center/CenterTcpServerService.java
  20. 187 0
      src/main/java/com/its/vds/xnettcp/center/protocol/CenterProtocol.java
  21. 15 7
      src/main/java/com/its/vds/xnettcp/vds/VdsTcpClient.java
  22. 2 2
      src/main/java/com/its/vds/xnettcp/vds/VdsTcpClientCommService.java
  23. 14 5
      src/main/java/com/its/vds/xnettcp/vds/process/Job_Temperature.java
  24. 0 14
      src/main/java/com/its/vds/xnetudp/UdpServerAbstract.java
  25. 0 78
      src/main/java/com/its/vds/xnetudp/UdpServerCenterComm.java
  26. 0 88
      src/main/java/com/its/vds/xnetudp/codec/CenterCommClientEncoder.java
  27. 0 47
      src/main/java/com/its/vds/xnetudp/codec/CenterCommServerDecoder.java
  28. 0 44
      src/main/java/com/its/vds/xnetudp/handler/CenterCommServerPacketHandler.java
  29. 0 174
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_COMM_DEFINE.java
  30. 0 137
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_COMM_MESSAGE.java
  31. 0 61
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_PG_STATE_RES.java
  32. 0 69
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_REQ_COMMON.java
  33. 0 9
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_REQ_RESET.java
  34. 0 24
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_REQ_STOPIMAGE.java
  35. 0 85
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_RES_STATE.java
  36. 0 63
      src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_RES_STOPIMAGE.java
  37. 0 29
      src/main/java/com/its/vds/xnetudp/protocol/voVdsState.java
  38. 0 48
      src/main/java/com/its/vds/xnetudp/service/CenterCommResponseService.java
  39. 0 10
      src/main/java/com/its/vds/xnetudp/thread/AbstractCenterCommServerReceiver.java
  40. 0 54
      src/main/java/com/its/vds/xnetudp/thread/CenterCommClientSender.java
  41. 0 107
      src/main/java/com/its/vds/xnetudp/thread/CenterCommServerReceiver.java
  42. 12 21
      src/main/resources/application.yml

+ 8 - 1
pom.xml

@@ -33,7 +33,7 @@
         <maven.compiler.target>1.8</maven.compiler.target>
         <!--main 함수가 있는 class 경로-->
         <start-class>com.its.vds.VdsCommServerApplication</start-class>
-        <webapp.lib>C:\DEV\ITS\01.WINDOWS\22.07.PyeongTaek\JAVA\repository</webapp.lib>
+        <webapp.lib>C:\java\repository</webapp.lib>
         <maven.test.skip>true</maven.test.skip>
     </properties>
 
@@ -90,6 +90,13 @@
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <!-- Exclude the Tomcat dependency -->
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>

+ 50 - 41
src/main/java/com/its/vds/VdsCommServerApplication.java

@@ -3,7 +3,8 @@ package com.its.vds;
 import com.its.app.AppUtils;
 import com.its.app.utils.OS;
 import com.its.app.utils.SysUtils;
-import com.its.vds.config.ProcessConfig;
+import com.its.vds.config.ApplicationConfig;
+import com.its.vds.entity.TbUnitSyst;
 import com.its.vds.process.DbmsDataProcess;
 import com.its.vds.service.UnitSystService;
 import com.its.vds.service.VdsCtlrService;
@@ -74,45 +75,6 @@ public class VdsCommServerApplication implements CommandLineRunner, ApplicationL
 
     @Override
     public void run(String... args) throws Exception {
-
-        ProcessConfig processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
-
-        log.info("");
-        log.info("");
-        log.info("************************************************************************************");
-        log.info("**                                                                                **");
-        log.info("**                         Intelligent Traffic System                             **");
-        log.info("**                      VDS Communication Server Program.                         **");
-        log.info("**                                                                                **");
-        log.info("**                                                                   [ver.1.0]    **");
-        log.info("**          {}", processConfig.getId());
-        log.info("** startup: {}", processConfig.getBootingDateTime());
-        log.info("************************************************************************************");
-
-        // init application
-        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess)AppUtils.getBean(DbmsDataProcess.class);
-        dbmsDataProcess.run();
-
-        VdsDataProcess tcpServerDataProcess = (VdsDataProcess)AppUtils.getBean(VdsDataProcess.class);
-        tcpServerDataProcess.run();
-
-        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
-        unitSystService.loadMaster();
-        unitSystService.updateUnitSystStts(true);
-
-        VdsCtlrService ctlrService = (VdsCtlrService)AppUtils.getBean(VdsCtlrService.class);
-        ctlrService.loadDb();
-        ctlrService.updateCtlrStts(true);
-
-        VdsTcpClientCommService vdsCommClientService = (VdsTcpClientCommService)AppUtils.getBean(VdsTcpClientCommService.class);
-        vdsCommClientService.run();
-
-        CenterTcpServerService centerService = (CenterTcpServerService)AppUtils.getBean(CenterTcpServerService.class);
-        centerService.run();
-
-        // schedule enable
-        processConfig.setStartSchedule(true);
-
         if (OS.isWindows()) {
             SwingUtilities.invokeLater(() -> {
                 String sysTime = SysUtils.getSysTimeStr();
@@ -148,9 +110,56 @@ public class VdsCommServerApplication implements CommandLineRunner, ApplicationL
                 logArea.setText(null);
                 JTextAreaOutputStream out = new JTextAreaOutputStream(logArea);
                 System.setOut(new PrintStream(out));
+            });
+        }
+
+        ApplicationConfig applicationConfig = (ApplicationConfig) AppUtils.getBean(ApplicationConfig.class);
 
+        log.info("");
+        log.info("");
+        log.info("************************************************************************************");
+        log.info("**                                                                                **");
+        log.info("**                         Intelligent Traffic System                             **");
+        log.info("**                      VDS Communication Server Program.                         **");
+        log.info("**                                                                                **");
+        log.info("**                                                                   [ver.1.0]    **");
+        log.info("**          {}", applicationConfig.getId());
+        log.info("** startup: {}", applicationConfig.getBootingDateTime());
+        log.info("************************************************************************************");
+
+        // init application
+        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess)AppUtils.getBean(DbmsDataProcess.class);
+        dbmsDataProcess.run();
+
+        VdsDataProcess tcpServerDataProcess = (VdsDataProcess)AppUtils.getBean(VdsDataProcess.class);
+        tcpServerDataProcess.run();
+
+        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
+        unitSystService.loadMaster();
+        unitSystService.updateUnitSystStts(true);
+        TbUnitSyst unit = unitSystService.getUnitSystMap().get(applicationConfig.getId());
+        if (unit != null) {
+            applicationConfig.setListenPort(unit.getPRGM_PORT());
+        }
+
+        VdsCtlrService ctlrService = (VdsCtlrService)AppUtils.getBean(VdsCtlrService.class);
+        ctlrService.loadDb();
+        ctlrService.updateCtlrStts(true);
+
+        VdsTcpClientCommService vdsCommClientService = (VdsTcpClientCommService)AppUtils.getBean(VdsTcpClientCommService.class);
+        vdsCommClientService.run();
+
+        CenterTcpServerService centerService = (CenterTcpServerService)AppUtils.getBean(CenterTcpServerService.class);
+        centerService.run();
+
+        // schedule enable
+        applicationConfig.setStartSchedule(true);
+
+        if (OS.isWindows()) {
+            MainUI UI = MainUI.getInstance();
+            if (UI != null) {
                 UI.LoadControllerInfo();
-            });
+            }
         }
     }
 

+ 21 - 17
src/main/java/com/its/vds/config/CenterCommConfig.java → src/main/java/com/its/vds/config/ApplicationConfig.java

@@ -1,5 +1,6 @@
 package com.its.vds.config;
 
+import com.its.app.utils.SysUtils;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
@@ -14,11 +15,23 @@ import javax.annotation.PostConstruct;
 @Setter
 @ToString
 @Configuration
-@ConfigurationProperties(prefix = "application.center-comm")
-public class CenterCommConfig {
+@ConfigurationProperties(prefix = "application")
+public class ApplicationConfig {
 
-    private boolean enable = true;
-    private int listenPort = 9901;
+    private String bootingDateTime;
+    private boolean startSchedule;
+
+    private String id = "VDS01";
+    private String name = "VDS Communication Server";
+    private boolean history = true;
+    private boolean statistics = true;
+
+    private String userId = "admin";
+    private String userPswd = "1234";
+
+    // Center Communication Config
+    private boolean centerCommEnable = true;
+    private int listenPort = 9902;
     protected String bindingAddr = "0.0.0.0";
     protected int backlog = 0;
     protected int acceptThreads = 0;
@@ -32,6 +45,8 @@ public class CenterCommConfig {
 
     @PostConstruct
     private void init() {
+        this.startSchedule = false;
+
         final int DEFAULT_EVENT_THREADS  = Runtime.getRuntime().availableProcessors() * 2;
         if (this.bindingAddr.equals("")) {
             this.bindingAddr = "0.0.0.0";
@@ -39,18 +54,6 @@ public class CenterCommConfig {
         if (this.backlog == 0) {
             this.backlog = 1024;
         }
-        /*if (this.acceptThreads == 0) {
-            if (MAX_CORE <= 8) {
-                this.acceptThreads = 4;
-            } else if (MAX_CORE >= 32) {
-                this.acceptThreads = 12;
-            } else {
-                this.acceptThreads = 6;
-            }
-        }
-        if (this.workerThreads == 0) {
-            this.workerThreads = totalThreads - this.acceptThreads;
-        }*/
         if (this.acceptThreads == 0) {
             this.acceptThreads = DEFAULT_EVENT_THREADS;
         }
@@ -65,7 +68,8 @@ public class CenterCommConfig {
             this.sndBuf = Short.MAX_VALUE / 2;
         }
 
+        this.bootingDateTime = SysUtils.getSysTimeStr();
+
         log.info("{}", this);
     }
-
 }

+ 0 - 32
src/main/java/com/its/vds/config/FacilityManagerConfig.java

@@ -1,32 +0,0 @@
-package com.its.vds.config;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-import javax.annotation.PostConstruct;
-
-@Slf4j
-@Getter
-@Setter
-@ToString
-@Configuration
-@ConfigurationProperties(prefix = "application.facility-manager")
-public class FacilityManagerConfig {
-
-    private boolean enable = true;
-    private String ipAddr = "";
-    private int sendPort = 5701;
-    private int recvPort = 5202;
-
-    @PostConstruct
-    private void init() {
-        if (this.ipAddr.equals(""))
-            this.enable = false;
-        log.info("{}", this);
-    }
-
-}

+ 0 - 55
src/main/java/com/its/vds/config/ProcessConfig.java

@@ -1,55 +0,0 @@
-package com.its.vds.config;
-
-import com.its.app.utils.SysUtils;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-import javax.annotation.PostConstruct;
-
-@Slf4j
-@Getter
-@Setter
-@ToString
-@Configuration
-@ConfigurationProperties(prefix = "application.process")
-public class ProcessConfig {
-
-    private String bootingDateTime;
-    private boolean startSchedule;
-
-    private String id = "VDS01";
-    private String name = "VDS Communication Server";
-    private boolean history = true;
-    private boolean statistics = true;
-
-    private String userId = "admin";
-    private String userPswd = "1234";
-
-    private String centerBindAddr = "0.0.0.0";
-    private int centerBindPort = 9901;
-    private boolean centerDump = false;
-
-    private String localBindAddr = "0.0.0.0";
-    private int localBindPort = 30100;
-    private boolean localDump = false;
-
-    private String facilityIp = "172.16.12.25";
-    private int facilitySendPort = 5701;
-    private int facilityRecvPort = 5202;
-
-    @PostConstruct
-    private void init() {
-        this.startSchedule = false;
-
-        if (this.centerBindAddr.equals(""))
-            this.centerBindAddr = "0.0.0.0";
-
-        this.bootingDateTime = SysUtils.getSysTimeStr();
-
-        log.info("{}", this);
-    }
-}

+ 2 - 2
src/main/java/com/its/vds/config/ControllerCommConfig.java → src/main/java/com/its/vds/config/RunningConfig.java

@@ -14,8 +14,8 @@ import javax.annotation.PostConstruct;
 @Setter
 @ToString
 @Configuration
-@ConfigurationProperties(prefix = "application.controller-comm")
-public class ControllerCommConfig {
+@ConfigurationProperties(prefix = "running")
+public class RunningConfig {
 
     private boolean commLogging = false;
     private int retrySeconds = 10;

+ 0 - 92
src/main/java/com/its/vds/config/SystemInfo.java

@@ -1,92 +0,0 @@
-package com.its.vds.config;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-
-import javax.annotation.PostConstruct;
-import java.net.*;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.List;
-
-@Slf4j
-@Getter
-@Setter
-@ToString
-@Configuration
-public class SystemInfo {
-
-    private final Environment env;
-
-    private String activeProfiles;
-    private String osName;
-    private int    cpuCores;
-    private String hostName;
-    private String ipAddress;
-
-    public SystemInfo(Environment env) {
-        this.env = env;
-    }
-
-    @PostConstruct
-    private void init() {
-        setActiveProfiles(Arrays.toString((Object[])this.env.getActiveProfiles()));
-        setOsName(System.getProperty("os.name"));
-        setCpuCores(Integer.valueOf(Runtime.getRuntime().availableProcessors()));
-        setHostName(getLocalHostName());
-        setIpAddress(getLocalIpAddress());
-
-        log.info("{}", this);
-    }
-    private String getLocalHostName() {
-        String hostName = null;
-        try {
-            hostName = InetAddress.getLocalHost().getHostName();
-        } catch (UnknownHostException e) {
-            log.error("getLocalHostName: UnknownHostException");
-        }
-        return hostName;
-    }
-
-    private String getLocalIpAddress() {
-        List<String> ipAddresses = new ArrayList<String>();
-        Enumeration<NetworkInterface> e = null;
-        try {
-            e = NetworkInterface.getNetworkInterfaces();
-        } catch (SocketException ex) {
-            log.error("getLocalIpAddress: SocketException");
-            return "127.0.0.1";
-        }
-        while (e.hasMoreElements()) {
-            for (InterfaceAddress ifAddr : ((NetworkInterface)e.nextElement()).getInterfaceAddresses()) {
-                if (!(ifAddr.getAddress() instanceof java.net.Inet6Address))
-                    ipAddresses.add(ifAddr.getAddress().getHostAddress());
-            }
-        }
-
-        return ipAddresses.toString();
-    }
-
-    public List<String> getIpAddressesList() {
-        List<String> ipAddresses = new ArrayList<>();
-        Enumeration<NetworkInterface> e = null;
-        try {
-            e = NetworkInterface.getNetworkInterfaces();
-        } catch (SocketException ex) {
-            log.error("getIpAddressesList: SocketException");
-            return ipAddresses;
-        }
-        while (e.hasMoreElements()) {
-                for (InterfaceAddress ifAddr : ((NetworkInterface)e.nextElement()).getInterfaceAddresses()) {
-                    if (!(ifAddr.getAddress() instanceof java.net.Inet6Address))
-                        ipAddresses.add(ifAddr.getAddress().getHostAddress());
-                }
-            }
-        return ipAddresses;
-    }
-}

+ 1 - 5
src/main/java/com/its/vds/config/ThreadPoolInitializer.java

@@ -29,11 +29,7 @@ public class ThreadPoolInitializer extends AsyncConfigurerSupport {
 
     @PostConstruct
     private void init() {
-
-        int MAX_CORE = Runtime.getRuntime().availableProcessors();
-        if (MAX_CORE < 8)
-            MAX_CORE = 16;
-
+        int MAX_CORE = Math.max(8, Runtime.getRuntime().availableProcessors());
         if (this.comm <= 0) {
             this.comm = MAX_CORE;
         }

+ 0 - 19
src/main/java/com/its/vds/entity/TbVdsCtlr.java

@@ -4,7 +4,6 @@ import com.its.app.utils.SysUtils;
 import com.its.vds.domain.NET;
 import com.its.vds.xnettcp.vds.handler.VdsTcpClientIdleHandler;
 import com.its.vds.xnettcp.vds.protocol.*;
-import com.its.vds.xnetudp.protocol.voVdsState;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import lombok.Getter;
@@ -259,24 +258,6 @@ public class TbVdsCtlr {
 		return result;
 	}
 
-	public voVdsState getVdsStts() {
-		voVdsState ss = new voVdsState();
-		ss.setCTLR_NMBR(getVDS_CTLR_NMBR());
-		ss.setComm(getStts().getSttsComm());				//Comm
-		ss.setVideoInput(getStts().getSttsVideoInput());	//VideoInput
-		ss.setHeater(getStts().getSttsHeater());			//Heater
-		ss.setFan(getStts().getSttsFan());				    //Fan
-		ss.setBackDoorOpen(getStts().getSttsBackDoor());	//BackDoorOpen
-		ss.setFrontDoorOpen(getStts().getSttsFrontDoor());	//FrontDoorOpen
-		ss.setTemperature(getStts().getSttsTemp());		    //Temperature
-		ss.setFanMode(getStts().getSttsFanMode());			//FanMode
-		ss.setFanRunTemp(getStts().getSttsFanRunTemp());	//FanRunTemp
-		ss.setHetrMode(getStts().getSttsHetrMode());		//HetrMode
-		ss.setHetrRunTemp(getStts().getSttsHetrRunTemp());	//HetrRunTemp
-
-		return ss;
-	}
-
 	public boolean channelClose() {
 		if (getChannel() == null || getNetState() == NET.CLOSED) {
 			log.error("Close Request: channel not connected: [{}]", this);

+ 8 - 8
src/main/java/com/its/vds/scheduler/SchedulerTask.java

@@ -2,7 +2,7 @@ package com.its.vds.scheduler;
 
 import com.its.app.utils.Elapsed;
 import com.its.app.utils.StatisticsTime;
-import com.its.vds.config.ProcessConfig;
+import com.its.vds.config.ApplicationConfig;
 import com.its.vds.service.StatisticsServices;
 import com.its.vds.service.UnitSystService;
 import com.its.vds.service.VdsCtlrService;
@@ -20,14 +20,14 @@ import javax.annotation.PreDestroy;
 @Component
 public class SchedulerTask {
 
-    private final ProcessConfig processConfig;
+    private final ApplicationConfig applicationConfig;
     private final UnitSystService unitSystService;
     private final VdsCtlrService vdsCtlrService;
     private final StatisticsServices statisticsServices;
 
     @Scheduled(cron = "6 * * * * *")  // 1분주기 작업 실행(매분 6초)
     public void UnitSystSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();
@@ -41,7 +41,7 @@ public class SchedulerTask {
 
     @Scheduled(cron = "15 1 0/1 * * *")    // 매시 1분 15초
     public void VdsRTCSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();
@@ -54,7 +54,7 @@ public class SchedulerTask {
 
     @Scheduled(cron = "4/30 * * * * *")    // 30초마다 요청(4초, 34초)
     public void VdsSynchronizationSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();
@@ -67,7 +67,7 @@ public class SchedulerTask {
 
     @Scheduled(cron = "9/30 * * * * *")    // 30초마다 요청(9초, 39초)
     public void VdsDataRequestSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();
@@ -80,12 +80,12 @@ public class SchedulerTask {
 
     @Scheduled(cron = "40 0/5 * * * *")    // 정주기 5분 40초에 스케쥴 실행
     public void StatisticsSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();
         log.info("     VdsStatisticsSchedule: start. {}", Thread.currentThread().getName());
-        if (this.processConfig.isStatistics()) {
+        if (this.applicationConfig.isStatistics()) {
             StatisticsTime its = new StatisticsTime();
             its.init();
             its.setProcessing(true);

+ 3 - 3
src/main/java/com/its/vds/service/UnitSystService.java

@@ -2,7 +2,7 @@ package com.its.vds.service;
 
 import com.its.app.AppUtils;
 import com.its.app.utils.SysUtils;
-import com.its.vds.config.ProcessConfig;
+import com.its.vds.config.ApplicationConfig;
 import com.its.vds.dao.mapper.UnitSystMapper;
 import com.its.vds.entity.TbUnitSyst;
 import com.its.vds.entity.TbUnitSystStts;
@@ -44,8 +44,8 @@ public class UnitSystService {
     @PostConstruct
     private void init() {
         log.info("[INIT...] UnitSystService.init: start.");
-        ProcessConfig processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
-        this.processId = processConfig.getId();
+        ApplicationConfig applicationConfig = (ApplicationConfig) AppUtils.getBean(ApplicationConfig.class);
+        this.processId = applicationConfig.getId();
         this.historyMin = -1;
 
         try {

+ 0 - 32
src/main/java/com/its/vds/service/VdsCtlrService.java

@@ -13,8 +13,6 @@ import com.its.vds.process.DbmsData;
 import com.its.vds.process.DbmsDataProcess;
 import com.its.vds.process.DbmsDataType;
 import com.its.vds.xnettcp.vds.protocol.VdsReqRTC;
-import com.its.vds.xnetudp.protocol.CENTER_VDS_RES_STATE;
-import com.its.vds.xnetudp.protocol.voVdsState;
 import lombok.extern.slf4j.Slf4j;
 import org.slf4j.MDC;
 import org.springframework.stereotype.Service;
@@ -161,7 +159,6 @@ public class VdsCtlrService {
         String UPDT_DT = SysUtils.getSysTime();
         int normal = 0;
         int error  = 0;
-        CENTER_VDS_RES_STATE stts = new CENTER_VDS_RES_STATE((byte)0x00);
         for (Map.Entry<String, TbVdsCtlr> e : AppRepository.getInstance().getCtlrMap().entrySet()) {
             TbVdsCtlr vds = e.getValue();
             vds.getStts().setUPDT_DT(UPDT_DT);
@@ -177,9 +174,6 @@ public class VdsCtlrService {
                 vds.getStts().initStts(false);
             }
 
-            voVdsState ss = vds.getVdsStts();
-            stts.getObjList().add(ss);
-
             if (isRun) {
                 ctlrSttsList.add(vds.getStts());
             }
@@ -197,32 +191,6 @@ public class VdsCtlrService {
             dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_CTLR_STTS, insHs, ctlrSttsList));
         }
 
-        stts.setTotal((short)(normal+error));
-        stts.setError((short)error);
-        stts.setNormal((short)normal);
-        stts.setModule((short)0);
-
-        /**
-         * 운영단말로 상태정보 등을 전송하지 않는다.(웹 기반)
-         */
-//        // 제어기 상태정보 운영단말 전송
-//        CenterCommClientSender notify = (CenterCommClientSender) AppUtils.getBean(CenterCommClientSender.class);
-//        notify.run(null, 0, stts.getBuffer());
-//
-//        // 프로세스 상태정보 운영단말 전송
-//        byte db = CENTER_PG_STATE_RES.STATE_ERROR;
-//        byte comm = error > 0 ? CENTER_PG_STATE_RES.STATE_ERROR : CENTER_PG_STATE_RES.STATE_NORMAL;
-//        byte action = CENTER_PG_STATE_RES.STATE_NORMAL;
-//        if (!isRun) {
-//            db = CENTER_PG_STATE_RES.STATE_ERROR;
-//            comm = CENTER_PG_STATE_RES.STATE_ERROR;
-//            action = CENTER_PG_STATE_RES.STATE_ERROR;
-//        }
-//
-//        // 프로그램 상태정보 운영단말 전송
-//        CENTER_PG_STATE_RES pgStts = new CENTER_PG_STATE_RES(CENTER_COMM_DEFINE.INT_ID_VDS_SERVER, db, comm, action);
-//        notify.run(null, 0, pgStts.getBuffer());
-
         log.info("VdsCtlrService.updateCtlrStts: total {}, normal {}, error {}", normal + error, normal, error);
     }
 

+ 9 - 14
src/main/java/com/its/vds/ui/MainUI.java

@@ -72,6 +72,7 @@ public class MainUI {
     private JButton btnDisconnect;
     private JTextField txtName;
     private JTextField txtId;
+    private boolean isUpdatable;
 
     public static MainUI getInstance() {
         return _instance;
@@ -96,6 +97,7 @@ public class MainUI {
     public MainUI(JFrame jFrame) {
         System.setProperty("awt.useSystemAAFontSettings", "false"); // AntiAliasing false
 
+        this.isUpdatable = false;
         this.jFrame = jFrame;
         if (_instance == null) {
             _instance = this;
@@ -103,7 +105,6 @@ public class MainUI {
             subUIController.setVisible(false);
         }
 
-        //osBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
         try {
             Font font = Font.createFont(Font.TRUETYPE_FONT, new File("fonts/D2Coding.ttc"));
             GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
@@ -111,23 +112,11 @@ public class MainUI {
         } catch (FontFormatException e) {
         } catch (IOException e) {
         }
-
-        //taLog.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14));
         Font d2font = new Font("D2Coding", Font.PLAIN, 14);
         if (d2font != null) {
             taLog.setFont(d2font);
         }
 
-//        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-//        String fontNames[] = ge.getAvailableFontFamilyNames();
-//        for (int ii = 0; ii < fontNames.length; ii++) {
-//            log.error("GraphicsEnvironment Fonts: {}", fontNames[ii]);
-//        }
-//        final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
-//        for (Font font : fonts) {
-//            log.error("FONTS: {}", font);
-//        }
-
         displaySystime();
         displayResource();
         timer = new Timer(1000, new ActionListener() {
@@ -283,7 +272,9 @@ public class MainUI {
         if (subUIController.isVisible()) {
             subUIController.setVisible(false);
         }
-
+        if (!this.isUpdatable) {
+            return false;
+        }
         int row = tblCtlrList.getSelectedRow();
         if (row < 0) {
             return false;
@@ -355,6 +346,7 @@ public class MainUI {
         for (int ii = 0; ii < getColumnModel.getColumnCount(); ii++) {
             getColumnModel.getColumn(ii).setCellRenderer(cellRenderer);
         }
+        this.isUpdatable = true;
     }
 
     public void updateCommSttsTotal() {
@@ -387,6 +379,9 @@ public class MainUI {
     }
 
     public void updateCtlrStts(TbVdsCtlr obj) {
+        if (!this.isUpdatable) {
+            return;
+        }
         if (this.ctlrSttsTableModel == null) {
             return;
         }

+ 10 - 3
src/main/java/com/its/vds/ui/SubUIController.java

@@ -1,9 +1,11 @@
 package com.its.vds.ui;
 
 import com.its.vds.entity.TbVdsCtlr;
+import org.springframework.core.io.ClassPathResource;
 
 import javax.swing.*;
-import java.awt.*;
+import java.io.IOException;
+import java.net.URL;
 
 public class SubUIController extends JFrame {
     private SubUI view;
@@ -11,8 +13,13 @@ public class SubUIController extends JFrame {
 
     public SubUIController(JFrame jFrame) {
         super("제어기 정보");
-        String pathOfImage = "C:\\DEV\\ITS\\01.WINDOWS\\22.01.YONGIN\\JAVA\\vds-comm-server\\src\\main\\resources\\static\\image\\application.png";
-        setIconImage(Toolkit.getDefaultToolkit().getImage(pathOfImage));
+        try {
+            ClassPathResource file = new ClassPathResource("static/image/application.png");
+            URL imgURL = file.getURL();
+            setIconImage(new ImageIcon(imgURL).getImage());
+        } catch (IOException e) {
+        }
+
         this.caller = jFrame;
         this.view = new SubUI() {
             @Override

+ 5 - 5
src/main/java/com/its/vds/webapp/controller/WebAppCommonController.java

@@ -2,7 +2,7 @@ package com.its.vds.webapp.controller;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.its.app.utils.Ping;
-import com.its.vds.config.ProcessConfig;
+import com.its.vds.config.ApplicationConfig;
 import com.its.vds.webapp.service.FileService;
 import com.its.vds.webapp.vo.FileInfoVo;
 import lombok.RequiredArgsConstructor;
@@ -32,14 +32,14 @@ import java.util.Map;
 public class WebAppCommonController {
 
     private final ResourceLoader resourceLoader;
-    private final ProcessConfig processConfig;
+    private final ApplicationConfig applicationConfig;
     private final FileService fileService;
 
     @RequestMapping({"/", "/index"})
     public String index(Model model, HttpServletRequest request) {
 
         String result = "system";
-        model.addAttribute("ServerConfig", this.processConfig);
+        model.addAttribute("ServerConfig", this.applicationConfig);
         model.addAttribute("ServerTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
         return result;
     }
@@ -59,7 +59,7 @@ public class WebAppCommonController {
             log.error("WebAppController.logFiles: Exception: {}", e.toString());
         }
 
-        model.addAttribute("ServerConfig", this.processConfig);
+        model.addAttribute("ServerConfig", this.applicationConfig);
         model.addAttribute("fileList",jsonList);
         model.addAttribute("ServerTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
         return result;
@@ -68,7 +68,7 @@ public class WebAppCommonController {
     @RequestMapping("/login")
     public String login(Model model) {
         String result = "login";
-        model.addAttribute("ServerConfig", this.processConfig);
+        model.addAttribute("ServerConfig", this.applicationConfig);
         model.addAttribute("ServerTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
         return result;
     }

+ 3 - 3
src/main/java/com/its/vds/webapp/controller/WebAppController.java

@@ -1,6 +1,6 @@
 package com.its.vds.webapp.controller;
 
-import com.its.vds.config.ProcessConfig;
+import com.its.vds.config.ApplicationConfig;
 import com.its.vds.domain.NET;
 import com.its.vds.entity.TbVdsCtlr;
 import com.its.vds.global.AppRepository;
@@ -30,7 +30,7 @@ import java.util.concurrent.ConcurrentHashMap;
 public class WebAppController {
 
     private final ResourceLoader resourceLoader;
-    private final ProcessConfig processConfig;
+    private final ApplicationConfig applicationConfig;
     private final FileService fileService;
 
     @RequestMapping(value = {"/controller"})
@@ -43,7 +43,7 @@ public class WebAppController {
                 ctlrMap.put(Integer.valueOf(obj.getVDS_CTLR_NMBR()), obj);
             }
         }
-        model.addAttribute("ServerConfig", this.processConfig);
+        model.addAttribute("ServerConfig", this.applicationConfig);
         //model.addAttribute("list", AppRepository.getInstance().getCtlrMap().entrySet());
         model.addAttribute("list", ctlrMap);
         model.addAttribute("ServerTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

+ 2 - 8
src/main/java/com/its/vds/xnettcp/TcpServerAbstract.java

@@ -1,6 +1,5 @@
 package com.its.vds.xnettcp;
 
-import com.its.vds.config.SystemInfo;
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.EventLoopGroup;
@@ -8,7 +7,6 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 
 @Slf4j
 @Getter
@@ -16,21 +14,17 @@ import org.springframework.beans.factory.annotation.Autowired;
 @ToString
 public abstract class TcpServerAbstract {
 
-    @Autowired
-    SystemInfo systemInfo;
-
     protected EventLoopGroup workerGroups = null;
     protected EventLoopGroup acceptGroups = null;
     protected ServerBootstrap serverBootstrap = null;
     protected ChannelFuture channelFuture = null;
 
     protected int getWorkerThreads() {
-        return this.systemInfo.getCpuCores() * 2;
+        return Runtime.getRuntime().availableProcessors() * 2;
     }
 
     protected int getAcceptThreads() {
-        int acceptThreads = getWorkerThreads() / 4;
-        if (acceptThreads == 0) acceptThreads = 1;
+        int acceptThreads = Math.max(1, getWorkerThreads() / 4);
         return acceptThreads;
     }
 }

+ 3 - 3
src/main/java/com/its/vds/xnettcp/TcpServerVdsComm.java

@@ -1,7 +1,7 @@
 package com.its.vds.xnettcp;
 
 import com.its.app.AppUtils;
-import com.its.vds.config.ProcessConfig;
+import com.its.vds.config.ApplicationConfig;
 import lombok.ToString;
 import lombok.extern.slf4j.Slf4j;
 
@@ -12,7 +12,7 @@ import javax.annotation.PostConstruct;
 //@Component
 public class TcpServerVdsComm extends TcpServerAbstract {
 
-    private ProcessConfig processConfig;
+    private ApplicationConfig applicationConfig;
     private String socketType;
 
     @PostConstruct
@@ -20,7 +20,7 @@ public class TcpServerVdsComm extends TcpServerAbstract {
     }
     public void run() {
         log.info("TcpCommServer.init: Start.");
-        this.processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
+        this.applicationConfig = (ApplicationConfig) AppUtils.getBean(ApplicationConfig.class);
 //        try {
 //            this.serverBootstrap = new ServerBootstrap();
 //            //ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));

+ 2 - 2
src/main/java/com/its/vds/xnettcp/center/CenterTcpServerService.java

@@ -2,7 +2,7 @@ package com.its.vds.xnettcp.center;
 
 import com.its.app.utils.NettyUtils;
 import com.its.app.utils.OS;
-import com.its.vds.config.CenterCommConfig;
+import com.its.vds.config.ApplicationConfig;
 import com.its.vds.xnettcp.center.codec.CenterTcpServerEncoder;
 import com.its.vds.xnettcp.center.handler.CenterTcpServerInboundHandler;
 import com.its.vds.xnettcp.center.initializer.CenterTcpServerInitializer;
@@ -21,7 +21,7 @@ import org.springframework.stereotype.Service;
 @Service
 public class CenterTcpServerService {
 
-    private final CenterCommConfig config;
+    private final ApplicationConfig config;
     private final CenterTcpServerInboundHandler centerTcpServerInboundHandler;
     private final CenterTcpServerEncoder centerTcpServerEncoder;
 

+ 187 - 0
src/main/java/com/its/vds/xnettcp/center/protocol/CenterProtocol.java

@@ -1,5 +1,6 @@
 package com.its.vds.xnettcp.center.protocol;
 
+import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
 public class CenterProtocol {
@@ -7,4 +8,190 @@ public class CenterProtocol {
     public static final ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
     public static final int HEADER_SIZE = 10;
 
+    /*******************************************************************************
+     * 시스템 ID
+     *******************************************************************************/
+    public static final int INT_ID_TRAFFIC_SERVER		= 0x01;    /* 가공서버 */
+    public static final int INT_ID_SIGCTL_SERVER		= 0x02;    /* 신호제어서버 */
+    public static final int INT_ID_SIGCOM_SERVER		= 0x03;    /* 신호통신서버 */
+    public static final int INT_ID_VDS_SERVER			= 0x04;    /* VDS 서버 */
+    public static final int INT_ID_AVI_SERVER			= 0x05;    /* AVI 서버 */
+    public static final int INT_ID_DSRC_SERVER 			= 0x06;    /* DSRC 서버 */
+    public static final int INT_ID_VMS_SERVER 			= 0x07;    /* VMS 서버 */
+    public static final int INT_ID_CCTV_SERVER			= 0x08;    /* CCTV 서버 */
+    public static final int INT_ID_WEB_SERVER		   	= 0x09;    /* WEB 서버 */
+    public static final int INT_ID_UTIS_SERVER			= 0x0A;    /* UTIS 서버 */
+    public static final int INT_ID_KMA_SERVER			= 0x0B;    /* 기상청 연계 서버 */
+    public static final int INT_ID_WCAM_SERVER			= 0x0C;    /* 웹카메라 연계 서버 */
+    public static final int INT_ID_FCLT_SERVER			= 0x0D;    /* 시설물관리 서버 */
+    public static final int INT_ID_EXT01_SERVER			= 0x0E;    /* 연계 서버1 */
+    public static final int INT_ID_EXT02_SERVER			= 0x0F;    /* 연계 서버2 */
+    public static final int INT_ID_EXT03_SERVER			= 0x10;    /* 연계 서버3 */
+    public static final int INT_ID_CCAM_SERVER			= 0x11;    /* 교차로감시카메라 연계 서버 */
+    public static final int INT_ID_PARK_SERVER			= 0x12;    /* 주차장 연계 서버 */
+    public static final int INT_ID_RSE_SERVER			= 0x13;    /* RSE 연계 서버 */
+
+    public static final int INT_ID_MAIN_OPER 			= 0x21;    /* 통합운영단말 */
+    public static final int INT_ID_WALL_OPER 			= 0x22;    /* 상황판운영단말 */
+    public static final int INT_ID_SIG_OPER 			= 0x23;    /* 신호운영단말 */
+    public static final int INT_ID_VDS_OPER 			= 0x24;    /* VDS운영단말 */
+    public static final int INT_ID_AVI_OPER 			= 0x25;    /* AVI운영단말 */
+    public static final int INT_ID_DSRC_OPER 			= 0x26;    /* DSRC운영단말 */
+    public static final int INT_ID_VMS_OPER 			= 0x27;    /* VMS운영단말 */
+    public static final int INT_ID_CCTV_OPER 			= 0x28;    /* CCTV운영단말 */
+    public static final int INT_ID_FMS_OPER 			= 0x29;    /* 시설물관리단말 */
+    public static final int INT_ID_UTIS_OPER 			= 0x2A;    /* UTIS관리단말 */
+    public static final int INT_ID_WCAM_OPER 			= 0x2B;    /* WCAM관리단말 */
+
+    public static final int INT_ID_OPER_MIN 			= INT_ID_MAIN_OPER ;    /* 운영단말 최소값 */
+    public static final int INT_ID_OPER_MAX 			= INT_ID_WCAM_OPER ;    /* 운영단말 최대값 */
+
+    /*******************************************************************************
+     * 프로토콜 OP CODE 정의
+     *******************************************************************************/
+    public static final int INT_OP_TRAFFIC_CHANGE   	    = 0x10;        /* 교통정보가공완료 */
+    public static final int INT_OP_NODELINK_CHANGE          = 0x11;        /* 노드링크 기반 정보 변경 */
+    public static final int INT_OP_FACILITY_CHANGE          = 0x12;        /* 시설물 기반 정보 변경 */
+    public static final int INT_OP_PG_STATE_REQ             = 0x13;        /* 공통사항, 프로그램 동작상태 요청 */
+    public static final int INT_OP_PG_STATE_RES             = 0x14;        /* 공통사항, 프로그램 동작상태 응답 */
+    public static final int INT_OP_CHANGE_EVENT             = 0x15;        /* 공통사항, 마스터정보 변경 알림 */
+    public static final int INT_OP_INC_EVENT                = 0x16;        /* 공통사항, 돌발정보 전송 */
+    public static final int INT_OP_ACK                      = 0x17;        /* 공통사항, ACK(Acknowledge) */
+    public static final int INT_OP_NACK                     = 0x18;        /* 공통사항, NACK(Negative Acknowledge) */
+    public static final int INT_OP_EXTENSION                = 0x19;        /* 공통사항, EXTENSION 요청/응답 */
+
+    /*******************************************************************************
+     * VMS Protocol OP Code
+     *******************************************************************************/
+    public static final int INT_OP_VMS_STATE_REQ            = 0x21;        /* VMS 통신 서버, VMS 시설물 상태정보 요청 */
+    public static final int INT_OP_VMS_STATE_RES            = 0x22;        /* VMS 통신 서버, VMS 시설물 상태정보 전송 */
+    public static final int INT_OP_VMS_POWER_CTL            = 0x23;        /* VMS 통신 서버, VMS 전광판 On/Off 제어 */
+    public static final int INT_OP_VMS_LUMINANCE_CTL        = 0x24;        /* VMS 통신 서버, VMS 휘도 제어 */
+
+    public static final int INT_OP_VMS_PARA_SET             = 0x25;        /* VMS 통신 서버, VMS 환경설정정보 전송 */
+    public static final int INT_OP_VMS_PARA_SET2            = 0x26;        /* VMS 통신 서버, VMS 환경설정정보 전송(For Pasig) */
+    public static final int INT_OP_VMS_RESET                = 0x27;        /* VMS 통신 서버, VMS 제어기 리셋 전송 */
+    public static final int INT_OP_VMS_MODE                 = 0x28;        /* VMS 통신 서버, VMS 운영모드 변경 */
+    public static final int INT_OP_VMS_FORM_SAVE            = 0x29;        /* VMS 통신 서버, 실시간 VMS 제공정보 저장 */
+    public static final int INT_OP_VMS_FORM_DOWNLOAD        = 0x2A;        /* VMS 통신 서버, 실시간 VMS 제공정보 저장 */
+    public static final int INT_OP_VMS_IMAGE_SYMBOL         = 0x2B;        /* VMS image symbol update */
+    public static final int INT_OP_VMS_IMAGE_TRAFFIC        = 0x2C;        /* VMS image traffic update */
+    public static final int INT_OP_VMS_FORM_UPDATE          = 0x2D;        /* VMS form update */
+    public static final int INT_OP_VMS_IFSC_UPDATE          = 0x2E;        /* VMS ifsc update */
+
+    public static final int INT_OP_VMS_PARAM_RES            = 0x2F;        /* VMS 통신 서버, VMS 시설물 파라미터정보 전송 ==> 목포시 싸인텔레콤 추가 */
+
+    public static final int INT_OP_VMS_COMMON               = 0x30;        /* 신규로 생성될 명령어를 처리하기 위한 OP Code */
+    public static final int INT_OP_VMS_COMMON_EXT           = 0x31;        /* 신규로 생성될 명령어를 처리하기 위한 OP Code */
+    public static final int INT_OP_VMS_IMMEDIATE_SCN_DNLD   = 0x32;        /* 폼 즉시 다운로드 OP Code */
+    public static final int INT_OP_VMS_PARAM_REQ            = 0x33;        /* VMS 파라미터 요청 */
+    public static final int INT_OP_VMS_DIRECT               = 0x34;        /* VMS Direct command */
+
+
+    /*******************************************************************************
+     * VDS Protocol OP Code
+     *******************************************************************************/
+    public static final int INT_OP_VDS_STOP_IMAGE_REQ       = 0x50;        /* VDS 통신 서버, VDS 정지영상 요청 */
+    public static final int INT_OP_VDS_STOP_IMAGE_RES       = 0x51;        /* VDS 통신 서버, VDS 정지영상 요청 응답 */
+    public static final int INT_OP_VDS_STATE_RES            = 0x52;        /* VDS 통신 서버, VDS 시설물 상태정보 전송 */
+    public static final int INT_OP_VDS_FAN_CONTROL          = 0x54;        /* VDS 통신 서버, VDS FAN 제어 */
+    public static final int INT_OP_VDS_RESET                = 0x59;        /* VDS 통신 서버, VDS 제어기 리셋 전송 */
+
+    public static final int INT_OP_VDS_PARAM_REQ            = 0x55;        /* VDS 통신 서버, VDS 파라미터 요청 */
+    public static final int INT_OP_VDS_PARAM_RES            = 0x56;        /* VDS 통신 서버, VDS 파라미터 요청 응답 */
+    public static final int INT_OP_VDS_PARAM_SET_REQ        = 0x57;        /* VDS 통신 서버, VDS 파라미터 설정 요청 */
+    public static final int INT_OP_VDS_PARAM_SET_RES        = 0x58;        /* VDS 통신 서버, VDS 파라미터 설정 요청 응답 */
+
+    /*******************************************************************************
+     * DSRC Protocol OP Code
+     *******************************************************************************/
+    public static final int INT_OP_DSRC_CONTROL_REQ         = 0x60;        /* DSRC 통신 서버, DSRC 제어 요청 */
+    public static final int INT_OP_DSRC_CONTROL_RES         = 0x61;        /* DSRC 통신 서버, DSRC 제어 요청 응답 */
+    public static final int INT_OP_DSRC_STATE_RES           = 0x62;        /* DSRC 통신 서버, DSRC 시설물 상태정보 전송 */
+
+
+    /*******************************************************************************
+     * WCAM Protocol OP Code
+     *******************************************************************************/
+    public static final int INT_OP_WCAM_STATE_RES           = 0x70;        /* WCAM 통신 서버, WCAM 시설물 상태정보 전송 */
+
+    /*******************************************************************************
+     * CCAM Protocol OP Code
+     *******************************************************************************/
+    public static final int INT_OP_CCAM_STATE_RES           = 0x71;        /* CCAM 통신 서버, CCAM 시설물 상태정보 전송 */
+
+    /*******************************************************************************
+     * PARK Protocol OP Code
+     *******************************************************************************/
+    public static final int INT_OP_PARK_STATE_RES           = 0x81;        /* PARK 통신 서버, PARK 시설물 상태정보 전송 */
+
+    /*******************************************************************************
+     *  프로세스 상태정보 요청/응답
+     *******************************************************************************/
+    public static final int INT_MAX_PG_STATE                = 146;        /* 최대 프로그램 상태정보 */
+
+    /*******************************************************************************
+     *  돌발 발생 통보
+     *******************************************************************************/
+    public static final int INT_INC_TIME_SIZE           = 14;        /* 'YYYYMMDDHH24MISS' */
+    public static final int INT_INC_ID_SIZE             = 12;        /* 돌발 ID */
+
+    /*******************************************************************************
+     *  VMS
+     *******************************************************************************/
+    public static final int INT_VMS_MAX_ID              = 15;       /* VMS 제어기 ID */
+    public static final int INT_VMS_MAX_MODULE          = 100;      /* 최대 VMS 모듈 */
+    public static final int INT_VMS_MAX_POWER           = 10;       /* 최대 VMS 전원 */
+    public static final int INT_VMS_MAX_MODULE_BIT      = 100;      /* 최대 VMS 모듈 비트*/
+    public static final int INT_VMS_MAX_POWER_BIT       = 10;       /* 최대 VMS 전원 비트 */
+
+    public static final int INT_VMS_MAX_DATETIME        = 14;       /* YYYYMMDDHHMMSS */
+    public static final int INT_VMS_MAX_OPER_ID         = 20;
+
+    public static final int INT_VMS_MAX_STATE           = 80;       /* 최대 VMS 시설물 상태정보 */
+    public static final int INT_VMS_MAX_PARAM           = 100;      /* 최대 VMS 파라미터 */
+    public static final int INT_VMS_MAX_PREP            = 93;       /* 최대 VMS 폼 갯수 정보 */
+    public static final int INT_VMS_MAX_FORM            = 40;       /* 최대 VMS 폼 */
+    public static final int INT_VMS_MAX_OBJECT          = 64;       /* 최대 VMS 오브젝트 */
+    public static final int INT_VMS_MAX_STRING_BUF      = 64;       /* 최대 VMS 문자열 데이터 버퍼 */
+    public static final int INT_VMS_MAX_FORM_DOWNLOAD   = 100;      /* 최대 VMS 제공정보 저장 (256개 까지 증가 가능) */
+    public static final int INT_VMS_MAX_MODE            = 100;      /* 최대 VMS 모드변경 갯수 */
+
+    /*******************************************************************************
+     *  VDS
+     *******************************************************************************/
+    public static final int INT_VDS_MAX_DATETIME        = 14;       /* YYYYMMDDHHMMSS */
+    public static final int INT_VDS_MAX_OPER_ID         = 20;
+    public static final int INT_VDS_MAX_STATE           = 200;      /* 최대 VDS 시설물 상태정보 */
+    public static final int INT_VDS_MAX_STOP_IMAGE      = 65535;    /* 정지영상 패킷 최대크기 */
+    /* VDS 정지영상 요청 응답 */
+    public static final int ERR_VDS_STOP_IMAGE_NORMAL           = 0x00;
+    public static final int ERR_VDS_STOP_IMAGE_NOT_CONNECT      = 0x01;
+    public static final int ERR_VDS_STOP_IMAGE_BUSY             = 0x02;
+    public static final int ERR_VDS_STOP_IMAGE_UNKNOWN_ID       = 0x03;
+    public static final int ERR_VDS_STOP_IMAGE_SIZE             = 0x04;
+
+    /*******************************************************************************
+     *  DSRC
+     *******************************************************************************/
+    public static final int INT_DSRC_MAX_DATETIME        = 14;      /* YYYYMMDDHHMMSS */
+    public static final int INT_DSRC_MAX_OPER_ID         = 20;
+    public static final int INT_DSRC_MAX_STATE           = 200;     /* 최대 DSRC 시설물 상태정보 */
+
+    public static byte[] getRequestHead(int sndSystem, int rcvSystem, byte opCode, int length) {
+
+        ByteBuffer byteBuffer = ByteBuffer.allocate(10);
+        byteBuffer.order(ByteOrder.BIG_ENDIAN);
+        byteBuffer.put((byte)sndSystem); // 송신시스템-운영단말
+        byteBuffer.put((byte)rcvSystem); // 수신시스템
+        byteBuffer.put((byte)0x01); // 전체프레임개수
+        byteBuffer.put((byte)0x01); // 현재프레임번호
+        byteBuffer.put((byte)0x00); // Reserved
+        byteBuffer.put(opCode);     // OP Code
+        byteBuffer.putInt(length);  // 데이터 길이
+
+        //log.error("HEAD: {}", SysUtils.byteArrayToHex(byteBuffer.array()));
+        return byteBuffer.array();
+    }
+
 }

+ 15 - 7
src/main/java/com/its/vds/xnettcp/vds/VdsTcpClient.java

@@ -1,15 +1,18 @@
 package com.its.vds.xnettcp.vds;
 
 import com.its.app.AppUtils;
-import com.its.vds.ui.MainUI;
-import com.its.vds.config.ControllerCommConfig;
+import com.its.vds.config.RunningConfig;
 import com.its.vds.entity.TbVdsCtlr;
+import com.its.vds.entity.TbVdsCtlrStts;
+import com.its.vds.process.DbmsData;
+import com.its.vds.process.DbmsDataProcess;
+import com.its.vds.process.DbmsDataType;
+import com.its.vds.ui.MainUI;
 import com.its.vds.xnettcp.vds.codec.VdsTcpClientDecoder;
 import com.its.vds.xnettcp.vds.codec.VdsTcpClientEncoder;
 import com.its.vds.xnettcp.vds.handler.VdsTcpClientIdleHandler;
 import com.its.vds.xnettcp.vds.handler.VdsTcpClientInboundHandler;
 import com.its.vds.xnettcp.vds.process.VdsDataProcess;
-import com.its.vds.xnetudp.service.CenterCommResponseService;
 import io.netty.bootstrap.Bootstrap;
 import io.netty.channel.*;
 import io.netty.channel.socket.SocketChannel;
@@ -22,6 +25,9 @@ import lombok.extern.slf4j.Slf4j;
 
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 
@@ -32,7 +38,7 @@ import java.util.concurrent.TimeUnit;
 public class VdsTcpClient implements Callable<Object> {
 
     private final TbVdsCtlr controller;
-    private final ControllerCommConfig commConfig;
+    private final RunningConfig commConfig;
     private final VdsDataProcess vdsDataProcess;
     private final VdsTcpClientBootstrapFactory bootstrapFactory;
 
@@ -128,9 +134,11 @@ public class VdsTcpClient implements Callable<Object> {
         if (obj.getChannel() != null) {
             log.error("[{}]. VDS Controller closed: channel {}", this.controller.getVDS_CTLR_ID(), channel);
             // 연결 되어 있다가 종료 된 경우임....
-            // 클라이언트 연결 종료정보를 운영단말로 전송한다.
-            CenterCommResponseService centerCommResponseService = (CenterCommResponseService) AppUtils.getBean(CenterCommResponseService.class);
-            centerCommResponseService.notifyStatus(obj, false);
+            // 제어기 상태정보 DB 업데이트
+            List<TbVdsCtlrStts> ctlrSttsList = Collections.synchronizedList(new ArrayList<>());
+            ctlrSttsList.add(obj.getStts());
+            DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+            dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_CTLR_STTS, false, ctlrSttsList));
             MainUI mainUI = MainUI.getInstance();
             if (mainUI != null) {
                 mainUI.updateCtlrStts(obj);

+ 2 - 2
src/main/java/com/its/vds/xnettcp/vds/VdsTcpClientCommService.java

@@ -1,6 +1,6 @@
 package com.its.vds.xnettcp.vds;
 
-import com.its.vds.config.ControllerCommConfig;
+import com.its.vds.config.RunningConfig;
 import com.its.vds.entity.TbVdsCtlr;
 import com.its.vds.global.AppRepository;
 import com.its.vds.xnettcp.vds.process.VdsDataProcess;
@@ -25,7 +25,7 @@ import java.util.concurrent.Future;
 @Service
 public class VdsTcpClientCommService {
 
-    private final ControllerCommConfig commConfig;
+    private final RunningConfig commConfig;
     private final VdsDataProcess vdsDataProcess;
 
     private VdsTcpClientBootstrapFactory bootstrapFactory;

+ 14 - 5
src/main/java/com/its/vds/xnettcp/vds/process/Job_Temperature.java

@@ -2,14 +2,21 @@ package com.its.vds.xnettcp.vds.process;
 
 import com.its.app.AppUtils;
 import com.its.app.utils.SysUtils;
-import com.its.vds.ui.MainUI;
 import com.its.vds.domain.NET;
 import com.its.vds.entity.TbVdsCtlr;
+import com.its.vds.entity.TbVdsCtlrStts;
+import com.its.vds.process.DbmsData;
+import com.its.vds.process.DbmsDataProcess;
+import com.its.vds.process.DbmsDataType;
+import com.its.vds.ui.MainUI;
 import com.its.vds.xnettcp.vds.protocol.VdsResFramePacket;
-import com.its.vds.xnetudp.service.CenterCommResponseService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 @Slf4j
 @RequiredArgsConstructor
 public class Job_Temperature implements JobProtocol {
@@ -47,9 +54,11 @@ public class Job_Temperature implements JobProtocol {
 			obj.getStts().setUPDT_DT(UPDT_DT);
 			obj.getStts().setCMNC_STTS_CD("CMS0");
 
-			// 클라이언트 연결 정보를 운영단말로 전송한다.
-			CenterCommResponseService centerCommResponseService = (CenterCommResponseService) AppUtils.getBean(CenterCommResponseService.class);
-			centerCommResponseService.notifyStatus(obj, true);
+			// 제어기 상태정보 DB 업데이트
+			List<TbVdsCtlrStts> ctlrSttsList = Collections.synchronizedList(new ArrayList<>());
+			ctlrSttsList.add(obj.getStts());
+			DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+			dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_CTLR_STTS, false, ctlrSttsList));
 			MainUI mainUI = MainUI.getInstance();
 			if (mainUI != null) {
 				mainUI.updateCtlrStts(obj);

+ 0 - 14
src/main/java/com/its/vds/xnetudp/UdpServerAbstract.java

@@ -1,14 +0,0 @@
-package com.its.vds.xnetudp;
-
-import io.netty.bootstrap.Bootstrap;
-import io.netty.channel.EventLoopGroup;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-
-@Getter
-@Slf4j
-public abstract class UdpServerAbstract {
-
-    protected EventLoopGroup nioEventLoopGroup;
-    protected Bootstrap bootstrap;
-}

+ 0 - 78
src/main/java/com/its/vds/xnetudp/UdpServerCenterComm.java

@@ -1,78 +0,0 @@
-package com.its.vds.xnetudp;
-
-import com.its.app.AppUtils;
-import com.its.vds.config.ProcessConfig;
-import com.its.vds.xnetudp.codec.CenterCommServerDecoder;
-import com.its.vds.xnetudp.handler.CenterCommServerPacketHandler;
-import io.netty.bootstrap.Bootstrap;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelInitializer;
-import io.netty.channel.ChannelOption;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.channel.socket.nio.NioDatagramChannel;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.PostConstruct;
-
-@Slf4j
-@ToString
-@Component
-public class UdpServerCenterComm extends UdpServerAbstract {
-
-    private ProcessConfig processConfig;
-
-    @PostConstruct
-    private void init() {
-        this.processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
-    }
-    public void run() {
-        log.info("UdpServerCenterComm.init: Start.");
-
-        try {
-            this.nioEventLoopGroup = new NioEventLoopGroup();
-            this.bootstrap = new Bootstrap();
-            this.bootstrap.channel(NioDatagramChannel.class);
-            this.bootstrap.group(this.nioEventLoopGroup);
-            this.bootstrap.option(ChannelOption.SO_BROADCAST, Boolean.valueOf(true));
-            //this.bootstrap.option(ChannelOption.SO_RCVBUF, Integer.valueOf(655350));
-            //this.bootstrap.option(ChannelOption.SO_SNDBUF, Integer.valueOf(655350));
-            this.bootstrap.option(ChannelOption.SO_REUSEADDR, Boolean.valueOf(true));
-            this.bootstrap.handler(new ChannelInitializer<Channel>() {
-                @Override
-                protected void initChannel(Channel channel) throws Exception
-                {
-                    channel.pipeline().addLast("centerCommServerDecoder", new CenterCommServerDecoder());
-                    channel.pipeline().addLast("centerCommServerPacketHandler", new CenterCommServerPacketHandler());
-                }
-            });
-        }
-        catch (Exception e) {
-            this.log.error("UdpServerCenterComm.init: Exception: {}", e.toString());
-        }
-
-        log.info("===============================================================");
-        log.info("=  UDP Center Communication Server Start.......................");
-        log.info("=  bindAddress: {}", processConfig.getCenterBindAddr());
-        log.info("=     bindPort: {}", processConfig.getCenterBindPort());
-        log.info("===============================================================");
-
-        try {
-            if (this.processConfig.getCenterBindAddr().equals("0.0.0.0")) {
-                this.bootstrap.bind(this.processConfig.getCenterBindPort());
-            }
-            else {
-                this.bootstrap.bind(this.processConfig.getCenterBindAddr(), processConfig.getCenterBindPort());
-            }
-        }
-        catch (Exception e) {
-            this.log.error("UdpServerCenterComm.init: Bind Exception: {}", e.toString());
-            this.nioEventLoopGroup.shutdownGracefully();
-        }
-        finally {
-        }
-        log.info("UdpServerCenterComm.init: ..End. {}", toString());
-    }
-
-}

+ 0 - 88
src/main/java/com/its/vds/xnetudp/codec/CenterCommClientEncoder.java

@@ -1,88 +0,0 @@
-package com.its.vds.xnetudp.codec;
-
-import com.its.app.AppUtils;
-import com.its.app.utils.SysUtils;
-import com.its.vds.config.ProcessConfig;
-import com.its.vds.entity.TbUnitSyst;
-import com.its.vds.service.UnitSystService;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.socket.DatagramPacket;
-import io.netty.handler.codec.MessageToMessageEncoder;
-import lombok.extern.slf4j.Slf4j;
-
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@Slf4j
-public class CenterCommClientEncoder extends MessageToMessageEncoder<Object> {
-
-	private String remoteIpAddr;
-	private int remotePort;
-
-	public CenterCommClientEncoder(String hostIp, int hostPort) {
-		this.remoteIpAddr = hostIp;
-		this.remotePort = hostPort;
-	}
-
-	@Override
-	protected void encode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception {
-
-		ProcessConfig processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
-
-		Channel channel = ctx.channel();
-		if (!channel.isOpen()) {
-			log.error("SEND: Channel Closed.");
-		}
-		if (!channel.isActive()) {
-			log.error("SEND: Channel InActive.");
-			channel.flush();
-			return;
-		}
-
-		if (!(msg instanceof ByteBuffer)) {
-			log.error("SEND: Encoding Data source Unknown Type.");
-			return;
-		}
-
-		int sendBytes = ((ByteBuffer) msg).array().length;
-		if (this.remoteIpAddr == null) {
-			log.info("SEND: [ALL], {} Bytes.", sendBytes);
-		}
-		else {
-			log.info("SEND: [{}:{}], {} Bytes.", this.remoteIpAddr, this.remotePort, sendBytes);
-		}
-
-		if (processConfig.isCenterDump()) {
-			log.info("SEND DUMP: {}", SysUtils.byteArrayToHex(((ByteBuffer) msg).array()));
-		}
-
-		// 브로드 캐스팅(모든 운영단말로 전송) 및 개별 메시지 응답
-		UnitSystService unitSystService = (UnitSystService) AppUtils.getBean(UnitSystService.class);
-		ConcurrentHashMap<String, TbUnitSyst> untiSystMap = unitSystService.getUnitSystMap();
-		for (Map.Entry<String, TbUnitSyst> e : untiSystMap.entrySet()) {
-			if (this.remoteIpAddr == null || this.remoteIpAddr.equals(e.getValue().getSYST_IP_1())) {
-				try {
-					ByteBuf byteBuf = Unpooled.buffer(sendBytes);
-					byteBuf.writeBytes(((ByteBuffer) msg).array());
-					InetSocketAddress addr = new InetSocketAddress(e.getValue().getSYST_IP_1(), e.getValue().getPRGM_PORT());
-					DatagramPacket packet = new DatagramPacket(byteBuf, addr);
-					out.add(packet);
-					if (this.remoteIpAddr == null) {
-						log.debug("SEND: [{}] [{}:{}], {} Bytes. OK....", e.getValue().getSYST_ID(), e.getValue().getSYST_IP_1(), e.getValue().getPRGM_PORT(), sendBytes);
-					}
-					else {
-						log.info("SEND: [{}] [{}:{}], {} Bytes. OK....", e.getValue().getSYST_ID(), e.getValue().getSYST_IP_1(), e.getValue().getPRGM_PORT(), sendBytes);
-					}
-				} catch (Exception e2) {
-					log.error("SEND: [{}] [{}:{}], {} Bytes. Failed. Exception: {}", e.getValue().getSYST_ID(), e.getValue().getSYST_IP_1(), e.getValue().getPRGM_PORT(), sendBytes, e2.toString());
-				}
-			}
-		}
-	}
-}

+ 0 - 47
src/main/java/com/its/vds/xnetudp/codec/CenterCommServerDecoder.java

@@ -1,47 +0,0 @@
-package com.its.vds.xnetudp.codec;
-
-import com.its.app.AppUtils;
-import com.its.app.utils.SysUtils;
-import com.its.vds.config.ProcessConfig;
-import com.its.vds.xnetudp.protocol.CENTER_COMM_MESSAGE;
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.socket.DatagramPacket;
-import io.netty.handler.codec.MessageToMessageDecoder;
-import lombok.extern.slf4j.Slf4j;
-
-import java.util.List;
-
-@Slf4j
-public class CenterCommServerDecoder extends MessageToMessageDecoder<DatagramPacket> {
-
-	private ProcessConfig processConfig;
-
-	public CenterCommServerDecoder() {
-		processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
-	}
-
-	@Override
-	protected void decode(ChannelHandlerContext ctx, DatagramPacket packet, List<Object> out) throws Exception {
-
-		ByteBuf buf = (ByteBuf)packet.content();
-
-		int recvBytes = buf.readableBytes();
-		log.info("RECV: [{}], {} Bytes.", packet.sender(), recvBytes);
-
-		if (buf.readableBytes() < CENTER_COMM_MESSAGE.CENTER_HEADER_SIZE) {
-			log.error("RECV: UDP Message header length error: {}/{} Bytes.", recvBytes, CENTER_COMM_MESSAGE.CENTER_HEADER_SIZE);
-			return;
-		}
-
-		byte[] buffer = new byte[recvBytes];
-		buf.getBytes(buf.readerIndex(), buffer);
-
-		if (this.processConfig.isCenterDump()) {
-			log.info("RECV DUMP: {}", SysUtils.byteArrayToHex(buffer));
-		}
-
-		CENTER_COMM_MESSAGE msg = new CENTER_COMM_MESSAGE(buffer, packet.sender());
-		out.add(msg);
-	}
-}

+ 0 - 44
src/main/java/com/its/vds/xnetudp/handler/CenterCommServerPacketHandler.java

@@ -1,44 +0,0 @@
-package com.its.vds.xnetudp.handler;
-
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.vds.xnetudp.protocol.CENTER_COMM_MESSAGE;
-import com.its.vds.xnetudp.thread.AbstractCenterCommServerReceiver;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.SimpleChannelInboundHandler;
-import lombok.extern.slf4j.Slf4j;
-
-import java.net.InetSocketAddress;
-
-@Slf4j
-public class CenterCommServerPacketHandler extends SimpleChannelInboundHandler<Object> {
-
-	@Override
-	protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
-
-		if (!(msg instanceof CENTER_COMM_MESSAGE)) {
-			log.error("CenterCommServerPacketHandler: Received Data Unknown Type: {}", NettyUtils.getTcpAddress(ctx.channel()));
-			return;
-		}
-
-		// UDP 통신은 스레드 풀로 처리한다.
-		//CenterCommServerReceiver handler = (CenterCommServerReceiver) AppUtils.getBean(CenterCommServerReceiver.class);
-		AbstractCenterCommServerReceiver handler = (AbstractCenterCommServerReceiver) AppUtils.getBean("centerCommServerReceiver");
-		if (handler != null) {
-			handler.run((CENTER_COMM_MESSAGE) msg);
-		}
-	}
-
-	public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
-		ctx.channel().flush();
-	}
-
-	public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
-	{
-		InetSocketAddress remoteAddress = (InetSocketAddress)ctx.channel().remoteAddress();
-        String ip = remoteAddress.getAddress().getHostAddress();
-        log.error("CenterCommServerPacketHandler::exceptionCaught: {}, {}", ip, cause.getMessage());
-	    cause.printStackTrace();
-	    super.exceptionCaught(ctx, cause);
-	}
-}

+ 0 - 174
src/main/java/com/its/vds/xnetudp/protocol/CENTER_COMM_DEFINE.java

@@ -1,174 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-public class CENTER_COMM_DEFINE {
-
-	/*******************************************************************************
-	 * 시스템 ID
-	 *******************************************************************************/
-	public static final int INT_ID_TRAFFIC_SERVER		= 0x01;    /* 가공서버 */
-	public static final int INT_ID_SIGCTL_SERVER		= 0x02;    /* 신호제어서버 */
-	public static final int INT_ID_SIGCOM_SERVER		= 0x03;    /* 신호통신서버 */
-	public static final int INT_ID_VDS_SERVER			= 0x04;    /* VDS 서버 */
-	public static final int INT_ID_AVI_SERVER			= 0x05;    /* AVI 서버 */
-	public static final int INT_ID_DSRC_SERVER 			= 0x06;    /* DSRC 서버 */
-	public static final int INT_ID_VMS_SERVER 			= 0x07;    /* VMS 서버 */
-	public static final int INT_ID_CCTV_SERVER			= 0x08;    /* CCTV 서버 */
-	public static final int INT_ID_WEB_SERVER		   	= 0x09;    /* WEB 서버 */
-	public static final int INT_ID_UTIS_SERVER			= 0x0A;    /* UTIS 서버 */
-	public static final int INT_ID_KMA_SERVER			= 0x0B;    /* 기상청 연계 서버 */
-	public static final int INT_ID_WCAM_SERVER			= 0x0C;    /* 웹카메라 연계 서버 */
-	public static final int INT_ID_FCLT_SERVER			= 0x0D;    /* 시설물관리 서버 */
-	public static final int INT_ID_EXT01_SERVER			= 0x0E;    /* 연계 서버1 */
-	public static final int INT_ID_EXT02_SERVER			= 0x0F;    /* 연계 서버2 */
-	public static final int INT_ID_EXT03_SERVER			= 0x10;    /* 연계 서버3 */
-	public static final int INT_ID_CCAM_SERVER			= 0x11;    /* 교차로감시카메라 연계 서버 */
-	public static final int INT_ID_PARK_SERVER			= 0x12;    /* 주차장 연계 서버 */
-	public static final int INT_ID_RSE_SERVER			= 0x13;    /* RSE 연계 서버 */
-
-	public static final int INT_ID_MAIN_OPER 			= 0x21;    /* 통합운영단말 */
-	public static final int INT_ID_WALL_OPER 			= 0x22;    /* 상황판운영단말 */
-	public static final int INT_ID_SIG_OPER 			= 0x23;    /* 신호운영단말 */
-	public static final int INT_ID_VDS_OPER 			= 0x24;    /* VDS운영단말 */
-	public static final int INT_ID_AVI_OPER 			= 0x25;    /* AVI운영단말 */
-	public static final int INT_ID_DSRC_OPER 			= 0x26;    /* DSRC운영단말 */
-	public static final int INT_ID_VMS_OPER 			= 0x27;    /* VMS운영단말 */
-	public static final int INT_ID_CCTV_OPER 			= 0x28;    /* CCTV운영단말 */
-	public static final int INT_ID_FMS_OPER 			= 0x29;    /* 시설물관리단말 */
-	public static final int INT_ID_UTIS_OPER 			= 0x2A;    /* UTIS관리단말 */
-	public static final int INT_ID_WCAM_OPER 			= 0x2B;    /* WCAM관리단말 */
-
-	public static final int INT_ID_OPER_MIN 			= INT_ID_MAIN_OPER ;    /* 운영단말 최소값 */
-	public static final int INT_ID_OPER_MAX 			= INT_ID_WCAM_OPER ;    /* 운영단말 최대값 */
-
-	/*******************************************************************************
-	 * 프로토콜 OP CODE 정의
-	 *******************************************************************************/
-	public static final int INT_OP_TRAFFIC_CHANGE   	    = 0x10;        /* 교통정보가공완료 */
-	public static final int INT_OP_NODELINK_CHANGE          = 0x11;        /* 노드링크 기반 정보 변경 */
-	public static final int INT_OP_FACILITY_CHANGE          = 0x12;        /* 시설물 기반 정보 변경 */
-	public static final int INT_OP_PG_STATE_REQ             = 0x13;        /* 공통사항, 프로그램 동작상태 요청 */
-	public static final int INT_OP_PG_STATE_RES             = 0x14;        /* 공통사항, 프로그램 동작상태 응답 */
-	public static final int INT_OP_CHANGE_EVENT             = 0x15;        /* 공통사항, 마스터정보 변경 알림 */
-	public static final int INT_OP_INC_EVENT                = 0x16;        /* 공통사항, 돌발정보 전송 */
-	public static final int INT_OP_ACK                      = 0x17;        /* 공통사항, ACK(Acknowledge) */
-	public static final int INT_OP_NACK                     = 0x18;        /* 공통사항, NACK(Negative Acknowledge) */
-	public static final int INT_OP_EXTENSION                = 0x19;        /* 공통사항, EXTENSION 요청/응답 */
-
-	/*******************************************************************************
-	 * VMS Protocol OP Code
-	 *******************************************************************************/
-	public static final int INT_OP_VMS_STATE_REQ            = 0x21;        /* VMS 통신 서버, VMS 시설물 상태정보 요청 */
-	public static final int INT_OP_VMS_STATE_RES            = 0x22;        /* VMS 통신 서버, VMS 시설물 상태정보 전송 */
-	public static final int INT_OP_VMS_POWER_CTL            = 0x23;        /* VMS 통신 서버, VMS 전광판 On/Off 제어 */
-	public static final int INT_OP_VMS_LUMINANCE_CTL        = 0x24;        /* VMS 통신 서버, VMS 휘도 제어 */
-
-	public static final int INT_OP_VMS_PARA_SET             = 0x25;        /* VMS 통신 서버, VMS 환경설정정보 전송 */
-	public static final int INT_OP_VMS_PARA_SET2            = 0x26;        /* VMS 통신 서버, VMS 환경설정정보 전송(For Pasig) */
-	public static final int INT_OP_VMS_RESET                = 0x27;        /* VMS 통신 서버, VMS 제어기 리셋 전송 */
-	public static final int INT_OP_VMS_MODE                 = 0x28;        /* VMS 통신 서버, VMS 운영모드 변경 */
-	public static final int INT_OP_VMS_FORM_SAVE            = 0x29;        /* VMS 통신 서버, 실시간 VMS 제공정보 저장 */
-	public static final int INT_OP_VMS_FORM_DOWNLOAD        = 0x2A;        /* VMS 통신 서버, 실시간 VMS 제공정보 저장 */
-	public static final int INT_OP_VMS_IMAGE_SYMBOL         = 0x2B;        /* VMS image symbol update */
-	public static final int INT_OP_VMS_IMAGE_TRAFFIC        = 0x2C;        /* VMS image traffic update */
-	public static final int INT_OP_VMS_FORM_UPDATE          = 0x2D;        /* VMS form update */
-	public static final int INT_OP_VMS_IFSC_UPDATE          = 0x2E;        /* VMS ifsc update */
-
-	public static final int INT_OP_VMS_PARAM_RES            = 0x2F;        /* VMS 통신 서버, VMS 시설물 파라미터정보 전송 ==> 목포시 싸인텔레콤 추가 */
-
-	public static final int INT_OP_VMS_COMMON               = 0x30;        /* 신규로 생성될 명령어를 처리하기 위한 OP Code */
-	public static final int INT_OP_VMS_COMMON_EXT           = 0x31;        /* 신규로 생성될 명령어를 처리하기 위한 OP Code */
-	public static final int INT_OP_VMS_IMMEDIATE_SCN_DNLD   = 0x32;        /* 폼 즉시 다운로드 OP Code */
-	public static final int INT_OP_VMS_PARAM_REQ            = 0x33;        /* VMS 파라미터 요청 */
-	public static final int INT_OP_VMS_DIRECT               = 0x34;        /* VMS Direct command */
-
-
-	/*******************************************************************************
-	 * VDS Protocol OP Code
-	 *******************************************************************************/
-	public static final int INT_OP_VDS_STOP_IMAGE_REQ       = 0x50;        /* VDS 통신 서버, VDS 정지영상 요청 */
-	public static final int INT_OP_VDS_STOP_IMAGE_RES       = 0x51;        /* VDS 통신 서버, VDS 정지영상 요청 응답 */
-	public static final int INT_OP_VDS_STATE_RES            = 0x52;        /* VDS 통신 서버, VDS 시설물 상태정보 전송 */
-	public static final int INT_OP_VDS_FAN_CONTROL          = 0x54;        /* VDS 통신 서버, VDS FAN 제어 */
-	public static final int INT_OP_VDS_RESET                = 0x59;        /* VDS 통신 서버, VDS 제어기 리셋 전송 */
-
-	public static final int INT_OP_VDS_PARAM_REQ            = 0x55;        /* VDS 통신 서버, VDS 파라미터 요청 */
-	public static final int INT_OP_VDS_PARAM_RES            = 0x56;        /* VDS 통신 서버, VDS 파라미터 요청 응답 */
-	public static final int INT_OP_VDS_PARAM_SET_REQ        = 0x57;        /* VDS 통신 서버, VDS 파라미터 설정 요청 */
-	public static final int INT_OP_VDS_PARAM_SET_RES        = 0x58;        /* VDS 통신 서버, VDS 파라미터 설정 요청 응답 */
-
-	/*******************************************************************************
-	 * DSRC Protocol OP Code
-	 *******************************************************************************/
-	public static final int INT_OP_DSRC_CONTROL_REQ         = 0x60;        /* DSRC 통신 서버, DSRC 제어 요청 */
-	public static final int INT_OP_DSRC_CONTROL_RES         = 0x61;        /* DSRC 통신 서버, DSRC 제어 요청 응답 */
-	public static final int INT_OP_DSRC_STATE_RES           = 0x62;        /* DSRC 통신 서버, DSRC 시설물 상태정보 전송 */
-
-
-	/*******************************************************************************
-	 * WCAM Protocol OP Code
-	 *******************************************************************************/
-	public static final int INT_OP_WCAM_STATE_RES           = 0x70;        /* WCAM 통신 서버, WCAM 시설물 상태정보 전송 */
-
-	/*******************************************************************************
-	 * CCAM Protocol OP Code
-	 *******************************************************************************/
-	public static final int INT_OP_CCAM_STATE_RES           = 0x71;        /* CCAM 통신 서버, CCAM 시설물 상태정보 전송 */
-
-	/*******************************************************************************
-	 * PARK Protocol OP Code
-	 *******************************************************************************/
-	public static final int INT_OP_PARK_STATE_RES           = 0x81;        /* PARK 통신 서버, PARK 시설물 상태정보 전송 */
-
-	/*******************************************************************************
-	 *  프로세스 상태정보 요청/응답
-	 *******************************************************************************/
-	public static final int INT_MAX_PG_STATE                = 146;        /* 최대 프로그램 상태정보 */
-
-	/*******************************************************************************
-	 *  돌발 발생 통보
-	 *******************************************************************************/
-	public static final int INT_INC_TIME_SIZE           = 14;        /* 'YYYYMMDDHH24MISS' */
-	public static final int INT_INC_ID_SIZE             = 12;        /* 돌발 ID */
-
-	/*******************************************************************************
-	 *  VMS
-	 *******************************************************************************/
-	public static final int INT_VMS_MAX_ID              = 15;       /* VMS 제어기 ID */
-	public static final int INT_VMS_MAX_MODULE          = 100;      /* 최대 VMS 모듈 */
-	public static final int INT_VMS_MAX_POWER           = 10;       /* 최대 VMS 전원 */
-	public static final int INT_VMS_MAX_MODULE_BIT      = 100;      /* 최대 VMS 모듈 비트*/
-	public static final int INT_VMS_MAX_POWER_BIT       = 10;       /* 최대 VMS 전원 비트 */
-
-	public static final int INT_VMS_MAX_DATETIME        = 14;       /* YYYYMMDDHHMMSS */
-	public static final int INT_VMS_MAX_OPER_ID         = 20;
-
-	public static final int INT_VMS_MAX_STATE           = 80;       /* 최대 VMS 시설물 상태정보 */
-	public static final int INT_VMS_MAX_PARAM           = 100;      /* 최대 VMS 파라미터 */
-	public static final int INT_VMS_MAX_PREP            = 93;       /* 최대 VMS 폼 갯수 정보 */
-	public static final int INT_VMS_MAX_FORM            = 40;       /* 최대 VMS 폼 */
-	public static final int INT_VMS_MAX_OBJECT          = 64;       /* 최대 VMS 오브젝트 */
-	public static final int INT_VMS_MAX_STRING_BUF      = 64;       /* 최대 VMS 문자열 데이터 버퍼 */
-	public static final int INT_VMS_MAX_FORM_DOWNLOAD   = 100;      /* 최대 VMS 제공정보 저장 (256개 까지 증가 가능) */
-	public static final int INT_VMS_MAX_MODE            = 100;      /* 최대 VMS 모드변경 갯수 */
-
-	/*******************************************************************************
-	 *  VDS
-	 *******************************************************************************/
-	public static final int INT_VDS_MAX_DATETIME        = 14;       /* YYYYMMDDHHMMSS */
-	public static final int INT_VDS_MAX_OPER_ID         = 20;
-	public static final int INT_VDS_MAX_STATE           = 200;      /* 최대 VDS 시설물 상태정보 */
-	public static final int INT_VDS_MAX_STOP_IMAGE      = 65535;    /* 정지영상 패킷 최대크기 */
-	/* VDS 정지영상 요청 응답 */
-	public static final int ERR_VDS_STOP_IMAGE_NORMAL           = 0x00;
-	public static final int ERR_VDS_STOP_IMAGE_NOT_CONNECT      = 0x01;
-	public static final int ERR_VDS_STOP_IMAGE_BUSY             = 0x02;
-	public static final int ERR_VDS_STOP_IMAGE_UNKNOWN_ID       = 0x03;
-	public static final int ERR_VDS_STOP_IMAGE_SIZE             = 0x04;
-
-	/*******************************************************************************
-	 *  DSRC
-	 *******************************************************************************/
-	public static final int INT_DSRC_MAX_DATETIME        = 14;      /* YYYYMMDDHHMMSS */
-	public static final int INT_DSRC_MAX_OPER_ID         = 20;
-	public static final int INT_DSRC_MAX_STATE           = 200;     /* 최대 DSRC 시설물 상태정보 */
-}

+ 0 - 137
src/main/java/com/its/vds/xnetudp/protocol/CENTER_COMM_MESSAGE.java

@@ -1,137 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-public class CENTER_COMM_MESSAGE {
-
-	public static int CENTER_HEADER_SIZE = 8; 
-	
-	private InetSocketAddress sender;
-	
-	private byte sendId;
-	private byte recvId;
-	private byte totalFrame;
-	private byte currentFrame;
-	private byte msgSeq;
-	private byte opCode;
-	private int  length;		// 2byte unsigned short
-	
-	private byte[] body;
-
-	public CENTER_COMM_MESSAGE() {
-
-	}
-	public CENTER_COMM_MESSAGE(int senderId, int opCode, int length, byte msgSeq) {
-		this.sendId       = (byte)senderId;
-		this.recvId       = (byte) CENTER_COMM_DEFINE.INT_ID_MAIN_OPER;
-		this.totalFrame   = 1;
-		this.currentFrame = 1;
-		this.msgSeq       = msgSeq;
-		this.opCode       = (byte)opCode;
-		this.length       = length;
-	}
-	public CENTER_COMM_MESSAGE(byte[] buffer, InetSocketAddress inetSocketAddress) {
-
-		this.sender = inetSocketAddress;
-
-		ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
-		byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
-
-		this.sendId       = byteBuffer.get();
-		this.recvId       = byteBuffer.get();
-		this.totalFrame   = byteBuffer.get();
-		this.currentFrame = byteBuffer.get();
-		this.msgSeq       = byteBuffer.get();
-		this.opCode       = byteBuffer.get();
-		this.length       = (int)byteBuffer.getShort();
-
-		if (this.length > 0) {
-			this.body = new byte[this.length];
-			byteBuffer.get(this.body);
-		}
-	}
-
-	public String getSenderIp() {
-		return this.sender.getAddress().getHostAddress();
-	}
-	public int getSenderPort() {
-		return this.sender.getPort();
-	}
-	
-	public byte getOpCode() {
-		return this.opCode;
-	}
-	public void setOpCode(byte opCode) {
-		this.opCode = opCode;
-	}
-	
-	public int getLength() {
-		return this.length;
-	}
-	public void setLength(int length) {
-		this.length = length;
-	}
-	public InetSocketAddress getSender() {
-		return sender;
-	}
-
-	public void setSender(InetSocketAddress sender) {
-		this.sender = sender;
-	}
-
-	public byte getSendId() {
-		return sendId;
-	}
-
-	public void setSendId(byte sendId) {
-		this.sendId = sendId;
-	}
-
-	public byte getRecvId() {
-		return recvId;
-	}
-
-	public void setRecvId(byte recvId) {
-		this.recvId = recvId;
-	}
-
-	public byte getTotalFrame() {
-		return totalFrame;
-	}
-
-	public void setTotalFrame(byte totalFrame) {
-		this.totalFrame = totalFrame;
-	}
-
-	public byte getCurrentFrame() {
-		return currentFrame;
-	}
-
-	public void setCurrentFrame(byte currentFrame) {
-		this.currentFrame = currentFrame;
-	}
-
-	public byte getMsgSeq() {
-		return msgSeq;
-	}
-
-	public void setMsgSeq(byte msgSeq) {
-		this.msgSeq = msgSeq;
-	}
-
-	public byte[] getBody() {
-		return this.body;
-	}
-	public void setBody(byte[] body) {
-		this.body = body;
-	}
-	public byte[] getMessage() {
-		return null;
-	}
-
-	public ByteBuffer getBuffer() {
-		return null;
-	}
-}

+ 0 - 61
src/main/java/com/its/vds/xnetudp/protocol/CENTER_PG_STATE_RES.java

@@ -1,61 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-import lombok.Data;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-@Data
-@ToString
-public class CENTER_PG_STATE_RES extends CENTER_COMM_MESSAGE {
-
-	public static int STATE_RES_HEAD_SIZE = 5;
-	public static byte STATE_NORMAL = 0x00;
-	public static byte STATE_ERROR = 0x01;
-
-	private byte count;
-	private byte type;
-	private byte db;
-	private byte comm;
-	private byte action;
-
-	public CENTER_PG_STATE_RES(int senderId, byte db, byte comm, byte action) {
-
-		super(senderId, CENTER_COMM_DEFINE.INT_OP_PG_STATE_RES, 0, (byte)0x00);
-
-		this.count  = 0x01;
-		this.type   = (byte)senderId;
-		this.db     = db;
-		this.comm   = comm;
-		this.action = action;
-	}
-
-	@Override
-	public ByteBuffer getBuffer() {
-		int pktSize = STATE_RES_HEAD_SIZE;
-		setLength(pktSize);
-
-		ByteBuffer byteBuffer = ByteBuffer.allocate(CENTER_HEADER_SIZE + getLength());
-		byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
-
-		byteBuffer.put(getSendId());
-		byteBuffer.put(getRecvId());
-		byteBuffer.put(getTotalFrame());
-		byteBuffer.put(getCurrentFrame());
-		byteBuffer.put(getMsgSeq());
-		byteBuffer.put(getOpCode());
-		byteBuffer.putShort((short)getLength());
-
-		byteBuffer.put(this.count);
-		byteBuffer.put(this.type);
-		byteBuffer.put(this.db);
-		byteBuffer.put(this.comm);
-		byteBuffer.put(this.action);
-
-		return byteBuffer;
-	}
-
-}

+ 0 - 69
src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_REQ_COMMON.java

@@ -1,69 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-import com.its.app.utils.SysUtils;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-public class CENTER_VDS_REQ_COMMON {
-
-	private String cmdTime;
-	private String operId;
-	private String vdsCtlrNmbr;
-	private byte[] body;
-
-	public CENTER_VDS_REQ_COMMON(byte buffer[]) {
-		ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
-		byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
-
-		byte[] cmdTime = new byte[CENTER_COMM_DEFINE.INT_VDS_MAX_DATETIME];
-		byte[] operId  = new byte[CENTER_COMM_DEFINE.INT_VDS_MAX_OPER_ID];
-		int  nmbr;
-		
-		byteBuffer.get(cmdTime);
-		byteBuffer.get(operId);
-		nmbr = byteBuffer.getInt();
-
-		this.cmdTime     = new String(cmdTime).trim();
-		this.operId      = SysUtils.byteArrayToString(operId);
-		this.vdsCtlrNmbr = Integer.toString(nmbr);
-		
-		if (byteBuffer.remaining() > 0) {
-			body = new byte[byteBuffer.remaining()];
-			byteBuffer.get(body);
-		}
-		else {
-			body = null;
-		}
-	}
-	public String getCmdTime() {
-		return cmdTime;
-	}
-
-	public void setCmdTime(String cmdTime) {
-		this.cmdTime = cmdTime;
-	}
-
-	public String getOperId() {
-		return operId;
-	}
-
-	public void setOperId(String operId) {
-		this.operId = operId;
-	}
-
-	public String getVdsCtlrNmbr() {
-		return vdsCtlrNmbr;
-	}
-
-	public void setVdsCtlrNmbr(String vdsCtlrNmbr) {
-		this.vdsCtlrNmbr = vdsCtlrNmbr;
-	}
-	public byte[] getBody() {
-		return body;
-	}
-	public void setBody(byte[] body) {
-		this.body = body;
-	}
-
-}

+ 0 - 9
src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_REQ_RESET.java

@@ -1,9 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-public class CENTER_VDS_REQ_RESET extends CENTER_VDS_REQ_COMMON {
-
-	public CENTER_VDS_REQ_RESET(byte buffer[]) {
-		super(buffer);
-	}
-
-}

+ 0 - 24
src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_REQ_STOPIMAGE.java

@@ -1,24 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-public class CENTER_VDS_REQ_STOPIMAGE extends CENTER_VDS_REQ_COMMON {
-
-	private byte   cameraNo;
-
-	public CENTER_VDS_REQ_STOPIMAGE(byte buffer[]) {
-		super(buffer);
-
-		if (getBody() != null) {
-			this.cameraNo = getBody()[0];
-		}
-		else {
-			this.cameraNo = 0;
-		}
-	}
-
-	public byte getCameraNo() {
-		return this.cameraNo;
-	}
-	public void setCameraNo(byte cameraNo) {
-		this.cameraNo = cameraNo;
-	}
-}

+ 0 - 85
src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_RES_STATE.java

@@ -1,85 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.List;
-
-@Getter
-@Setter
-@ToString
-public class CENTER_VDS_RES_STATE extends CENTER_COMM_MESSAGE {
-
-	public static int STATE_RES_HEAD_SIZE = 9;
-
-	private short   total;                        /* 전체 갯수 */
-	private short   error;                        /* 통신오류 갯수 */
-	private short   normal;                       /* 정상 갯수 */
-	private short   module;                       /* 모듈이상 갯수 */
-	//private byte	count;                        /* 대상 갯수 */
-	private List<voVdsState> objList = null;
-
-	public CENTER_VDS_RES_STATE(byte msgSeq) {
-
-		super(CENTER_COMM_DEFINE.INT_ID_VDS_SERVER, CENTER_COMM_DEFINE.INT_OP_VDS_STATE_RES, 0, msgSeq);
-
-		if (objList == null) {
-			objList = new ArrayList<voVdsState>();
-		}
-	}
-
-	@Override
-	public ByteBuffer getBuffer() {
-		int total = objList.size();
-		if (total > CENTER_COMM_DEFINE.INT_VDS_MAX_STATE) {
-			total = CENTER_COMM_DEFINE.INT_VDS_MAX_STATE;
-		}
-		int pktSize = (total*voVdsState.STATE_SIZE)+STATE_RES_HEAD_SIZE;
-		setLength(pktSize);
-
-		ByteBuffer byteBuffer = ByteBuffer.allocate(CENTER_HEADER_SIZE + getLength());
-		byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
-
-		byteBuffer.put(getSendId());
-		byteBuffer.put(getRecvId());
-		byteBuffer.put(getTotalFrame());
-		byteBuffer.put(getCurrentFrame());
-		byteBuffer.put(getMsgSeq());
-		byteBuffer.put(getOpCode());
-		byteBuffer.putShort((short)getLength());
-
-		byteBuffer.putShort(this.total);
-		byteBuffer.putShort(this.error);
-		byteBuffer.putShort(this.normal);
-		byteBuffer.putShort(this.module);
-		byteBuffer.put((byte)this.objList.size());
-
-		int cnt = 0;
-		for (voVdsState vo : this.objList) {
-			byteBuffer.putInt(Integer.parseInt(vo.getCTLR_NMBR()));
-			byteBuffer.put(vo.getComm());
-
-			byteBuffer.put(vo.getVideoInput());
-			byteBuffer.put(vo.getHeater());
-			byteBuffer.put(vo.getFan());
-			byteBuffer.put(vo.getBackDoorOpen());
-			byteBuffer.put(vo.getFrontDoorOpen());
-			byteBuffer.putShort(vo.getTemperature());
-			byteBuffer.put(vo.getFanMode());
-			byteBuffer.put(vo.getFanRunTemp());
-			byteBuffer.put(vo.getHetrMode());
-			byteBuffer.put(vo.getHetrRunTemp());
-			cnt++;
-			if (cnt >= CENTER_COMM_DEFINE.INT_DSRC_MAX_STATE) {
-				break;
-			}
-		}
-
-		return byteBuffer;
-	}
-
-}

+ 0 - 63
src/main/java/com/its/vds/xnetudp/protocol/CENTER_VDS_RES_STOPIMAGE.java

@@ -1,63 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-public class CENTER_VDS_RES_STOPIMAGE extends CENTER_COMM_MESSAGE {
-
-	public static int STOP_IMAGE_RES_HEAD_SIZE = 14;
-
-	private int    VDS_CTLR_NMBR;                      /* VDS 제어기 ID */
-	private byte   cameraNo;                           /* 카메라 번호 */
-	private byte   error;                              /* 오류코드 : 0x00 이 아니면 오류 */
-	private short  total;
-	private short  current;
-	private int    size;
-	private byte[] data;
-
-	public CENTER_VDS_RES_STOPIMAGE(int vdsCtlrNmbr, int cameraNo, int error, int total, int current, int size) {
-		int pktLen = (STOP_IMAGE_RES_HEAD_SIZE + size);
-		setSendId((byte) CENTER_COMM_DEFINE.INT_ID_VDS_SERVER);
-		setRecvId((byte) CENTER_COMM_DEFINE.INT_ID_MAIN_OPER);
-		setTotalFrame((byte)1);
-		setCurrentFrame((byte)1);
-		setMsgSeq((byte)0x00);
-		setOpCode((byte) CENTER_COMM_DEFINE.INT_OP_VDS_STOP_IMAGE_RES);
-		setLength(pktLen);
-
-		this.VDS_CTLR_NMBR = vdsCtlrNmbr;
-		this.cameraNo = (byte)cameraNo;
-		this.error = (byte)error;
-		this.total = (short)total;
-		this.current = (short)current;
-		this.size = size;
-	}
-
-	public void setData(byte[] data) {
-		this.data = data;
-	}
-	@Override
-	public ByteBuffer getBuffer() {
-		ByteBuffer byteBuffer = ByteBuffer.allocate(CENTER_COMM_MESSAGE.CENTER_HEADER_SIZE + getLength());
-		byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
-
-		byteBuffer.put(getSendId());
-		byteBuffer.put(getRecvId());
-		byteBuffer.put(getTotalFrame());
-		byteBuffer.put(getCurrentFrame());
-		byteBuffer.put(getMsgSeq());
-		byteBuffer.put(getOpCode());
-		byteBuffer.putShort((short)getLength());
-
-		byteBuffer.putInt(this.VDS_CTLR_NMBR);
-		byteBuffer.put(this.cameraNo);
-		byteBuffer.put(this.error);
-		byteBuffer.putShort(this.total);
-		byteBuffer.putShort(this.current);
-		byteBuffer.putInt(this.size);
-		byteBuffer.put(this.data);
-
-		return byteBuffer;
-	}
-
-}

+ 0 - 29
src/main/java/com/its/vds/xnetudp/protocol/voVdsState.java

@@ -1,29 +0,0 @@
-package com.its.vds.xnetudp.protocol;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class voVdsState {
-
-    public static byte normal = 0x00;
-    public static byte error = 0x01;
-    public static int STATE_SIZE = 16;
-
-    private String  CTLR_NMBR;
-    private byte Comm;                 /* 유선통신상태, 0:정상 1:장애 */
-
-    private byte VideoInput;           // O-[D07] Video Input 여부, 영상검지기 제어기로 카메라 영상입력이 없을 때 : 1
-    private byte Heater;               // O-[D04] 히터 작동, 히터가 작동하는 경우 (작동시 : 1)
-    private byte Fan;                  // O-[D03] 팬 작동, 펜이 작동하는 경우 (작동시 : 1)
-    private byte BackDoorOpen;         // O-[D02] 뒷문 개방, 뒷문이 개방된 경우 (개방시 : 1)
-    private byte FrontDoorOpen;        // O-[D01] 앞문 개방, 앞문이 개방된 경우 (개방시 : 1)
-    private short Temperature;         // 온도
-
-    private byte FanMode;              // Fan 동작모드 설정 - 0x00: 자동모드, 0x01: 수동모드[Default : 0x00]
-    private byte FanRunTemp;           // Fan 동작모드가 자동모드 일경우만 동작 온도 설정값 이상 시 ON[Default : 25°C]-0x19
-    private byte HetrMode;             // Hetr 동작모드 설정 - 0x00: 자동모드, 0x01: 수동모드[Default : 0x00]
-    private byte HetrRunTemp;          // Hetr 동작모드가 자동모드 일경우만 동작 온도 설정값 이상 시 ON[Default : 25°C]-0x19
-
-}

+ 0 - 48
src/main/java/com/its/vds/xnetudp/service/CenterCommResponseService.java

@@ -1,48 +0,0 @@
-package com.its.vds.xnetudp.service;
-
-import com.its.app.AppUtils;
-import com.its.vds.entity.TbVdsCtlr;
-import com.its.vds.entity.TbVdsCtlrStts;
-import com.its.vds.process.DbmsData;
-import com.its.vds.process.DbmsDataProcess;
-import com.its.vds.process.DbmsDataType;
-import com.its.vds.xnetudp.protocol.CENTER_VDS_RES_STATE;
-import com.its.vds.xnetudp.protocol.voVdsState;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-@Slf4j
-@Service
-public class CenterCommResponseService {
-
-    public void notifyStatus(TbVdsCtlr vds, boolean isConnect) {
-
-        CENTER_VDS_RES_STATE stts = new CENTER_VDS_RES_STATE((byte)0x00);
-        stts.setTotal((short)1);
-        stts.setError((short)(isConnect ? 0 : 1));
-        stts.setNormal((short)(isConnect ? 1 : 0));
-        stts.setModule((short)0);
-
-        List<TbVdsCtlrStts> ctlrSttsList = Collections.synchronizedList(new ArrayList<>());
-
-        voVdsState ss = vds.getVdsStts();
-        stts.getObjList().add(ss);
-
-        ctlrSttsList.add(vds.getStts());
-
-        // 제어기 상태정보 DB 업데이트
-        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
-        if (ctlrSttsList.size() > 0) {
-            dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_CTLR_STTS, false, ctlrSttsList));
-        }
-
-        // 제어기상태정보 UDP 전송(모든 운영단말로 전송)
-//        CenterCommClientSender notify = (CenterCommClientSender) AppUtils.getBean(CenterCommClientSender.class);
-//        notify.run(null, 0, stts.getBuffer());
-    }
-
-}

+ 0 - 10
src/main/java/com/its/vds/xnetudp/thread/AbstractCenterCommServerReceiver.java

@@ -1,10 +0,0 @@
-package com.its.vds.xnetudp.thread;
-
-import com.its.vds.xnetudp.protocol.CENTER_COMM_MESSAGE;
-import org.springframework.scheduling.annotation.Async;
-
-public abstract class AbstractCenterCommServerReceiver {
-
-    @Async("centerCommExecutor")
-    public abstract void run(CENTER_COMM_MESSAGE data);
-}

+ 0 - 54
src/main/java/com/its/vds/xnetudp/thread/CenterCommClientSender.java

@@ -1,54 +0,0 @@
-package com.its.vds.xnetudp.thread;
-
-import com.its.vds.xnetudp.codec.CenterCommClientEncoder;
-import io.netty.bootstrap.Bootstrap;
-import io.netty.channel.*;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.channel.socket.nio.NioDatagramChannel;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.nio.ByteBuffer;
-
-@Slf4j
-@Service
-public class CenterCommClientSender {
-
-    @Async("centerCommExecutor")
-    public void run(String ip, int port, ByteBuffer sendBuffer) {
-        if (sendBuffer == null) {
-            log.error("CenterCommClientSender.run: Notify Data NULL");
-            return;
-        }
-
-        EventLoopGroup nioEventLoopGroup = new NioEventLoopGroup();
-        try {
-            Bootstrap bootstrap = new Bootstrap();
-            bootstrap.channel(NioDatagramChannel.class);
-            bootstrap.group(nioEventLoopGroup);
-            bootstrap.option(ChannelOption.SO_BROADCAST, false);
-            bootstrap.handler(new ChannelInitializer<Channel>() {
-                @Override
-                protected void initChannel(Channel channel) throws Exception
-                {
-                    channel.pipeline().addLast(new CenterCommClientEncoder(ip, port));
-                }
-            });
-
-            Channel channel = bootstrap.bind(0).sync().channel();
-            ChannelFuture f = channel.writeAndFlush(sendBuffer).sync();
-            if (!f.isDone() || !f.isSuccess()) {
-                log.error("CenterCommClientSender.run: Send Failed. isDone: {}, isSuccess: {}", f.isDone(), f.isSuccess());
-            }
-        }
-        catch(Exception e) {
-            log.error("CenterCommClientSender.run: Exception: {}", e.toString());
-            e.printStackTrace();
-        }
-        finally {
-            nioEventLoopGroup.shutdownGracefully();
-            log.info("CenterCommClientSender.run: {} Bytes, ip: {}, port: {}", sendBuffer.array().length, ip, port);
-        }
-    }
-}

+ 0 - 107
src/main/java/com/its/vds/xnetudp/thread/CenterCommServerReceiver.java

@@ -1,107 +0,0 @@
-package com.its.vds.xnetudp.thread;
-
-import com.its.app.AppUtils;
-import com.its.vds.domain.NET;
-import com.its.vds.entity.TbUnitSyst;
-import com.its.vds.entity.TbVdsCtlr;
-import com.its.vds.global.AppRepository;
-import com.its.vds.service.UnitSystService;
-import com.its.vds.xnetudp.protocol.CENTER_COMM_DEFINE;
-import com.its.vds.xnetudp.protocol.CENTER_COMM_MESSAGE;
-import com.its.vds.xnetudp.protocol.CENTER_VDS_REQ_RESET;
-import com.its.vds.xnetudp.protocol.CENTER_VDS_REQ_STOPIMAGE;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@Slf4j
-@Service
-public class CenterCommServerReceiver extends AbstractCenterCommServerReceiver {
-
-    @Async("centerCommExecutor")
-    public void run(CENTER_COMM_MESSAGE data) {
-        if (data == null) {
-            log.error("CenterCommServerReceiver: RECV Data Packet NULL");
-            return;
-        }
-        if (data.getRecvId() != CENTER_COMM_DEFINE.INT_ID_VDS_SERVER) {
-            log.error("CenterCommServerReceiver: UDP RECV UNKNOWN SERVER ID: {}", data.getRecvId());
-            return;
-        }
-
-        String reqIpAddr = data.getSenderIp();
-        int reqPort = 4603;
-        UnitSystService unitSystService = (UnitSystService) AppUtils.getBean(UnitSystService.class);
-        ConcurrentHashMap<String, TbUnitSyst> untiSystMap = unitSystService.getUnitSystMap();
-        for (Map.Entry<String, TbUnitSyst> e : untiSystMap.entrySet()) {
-            if (reqIpAddr.equals(e.getValue().getSYST_IP_1())) {
-                reqPort = e.getValue().getPRGM_PORT();
-                break;
-            }
-        }
-
-        byte opCode = data.getOpCode();
-        if (opCode == CENTER_COMM_DEFINE.INT_OP_VDS_RESET) {
-            CENTER_VDS_REQ_RESET req = new CENTER_VDS_REQ_RESET(data.getBody());
-            log.info("CenterCommServerReceiver: VDS REQ RESET: [{}] [{}] [{}]", req.getCmdTime(), req.getOperId(), req.getVdsCtlrNmbr());
-
-            TbVdsCtlr vds = AppRepository.getInstance().getCtlrMap().get(req.getVdsCtlrNmbr());
-            if (vds == null) {
-                log.error("CenterCommServerReceiver: VDS REQ RESET Unknown VDS: [{}]", req.getVdsCtlrNmbr());
-                return;
-            }
-            if (vds.getChannel() == null || vds.getNetState() == NET.CLOSED) {
-                log.error("CenterCommServerReceiver: VDS REQ RESET Not Connect: [{}]", vds);
-                return;
-            }
-
-//            vds.setCliReq(new InetSocketAddress(reqIpAddr, reqPort));
-//            VDS_REQ_HEAD reqHdr = new VDS_REQ_HEAD();
-//            byte[] headBytes = reqHdr.makeHead(VDS_HEAD.evds_Reset, vds, 9);
-//            ByteBuffer sendBuff = ByteBuffer.allocate(VDS_REQ_HEAD.VDS_REQ_HEADER_SIZE + reqHdr.getLength());
-//            log.info("CenterCommServerReceiver: [{}], SEND-evds_Reset: {}, {}, {}", vds.getVDS_CTLR_NMBR(), reqHdr.getLength(), headBytes.length, sendBuff.capacity());
-//            sendBuff.order(ByteOrder.BIG_ENDIAN);
-//            sendBuff.put(headBytes);
-//            ChannelFuture f = vds.getChannel().writeAndFlush(sendBuff);
-//            f.awaitUninterruptibly();
-//            if (f.isDone() || f.isSuccess()) {
-//                log.info("SEND_0: [{}], evds_Reset: {} headBytes, {} sendBytes. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//            } else {
-//                log.error("SEND_0: [{}], evds_Reset: {} headBytes, {} sendBytes, Failed. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//            }
-        } else if (opCode == CENTER_COMM_DEFINE.INT_OP_VDS_STOP_IMAGE_REQ) {
-            CENTER_VDS_REQ_STOPIMAGE req = new CENTER_VDS_REQ_STOPIMAGE(data.getBody());
-            log.info("CenterCommServerReceiver: VDS REQ STOP IMAGE: [{}] [{}] [{}] [{}]", req.getCmdTime(), req.getOperId(), req.getVdsCtlrNmbr(), req.getCameraNo());
-
-            TbVdsCtlr vds = AppRepository.getInstance().getCtlrMap().get(req.getVdsCtlrNmbr());
-            if (vds == null) {
-                log.error("CenterCommServerReceiver: VDS REQ STOP IMAGE Unknown VDS: [{}]", req.getVdsCtlrNmbr());
-                return;
-            }
-            if (vds.getChannel() == null || vds.getNetState() == NET.CLOSED) {
-                log.error("CenterCommServerReceiver: VDS REQ STOP IMAGE Not Connect: [{}]", vds);
-                return;
-            }
-
-//            vds.setCliReq(new InetSocketAddress(reqIpAddr, reqPort));
-//            VDS_REQ_HEAD reqHdr = new VDS_REQ_HEAD();
-//            byte[] headBytes = reqHdr.makeHead(VDS_HEAD.evds_StopImage, vds, 10);
-//            ByteBuffer sendBuff = ByteBuffer.allocate(VDS_REQ_HEAD.VDS_REQ_HEADER_SIZE + reqHdr.getLength());
-//            sendBuff.order(ByteOrder.BIG_ENDIAN);
-//            sendBuff.put(headBytes);
-//            sendBuff.put(req.getCameraNo());
-//            ChannelFuture f = vds.getChannel().writeAndFlush(sendBuff);
-//            f.awaitUninterruptibly();
-//            if (f.isDone() || f.isSuccess()) {
-//                log.info("SEND_0: [{}], evds_StopImage: {} headBytes, {} sendBytes. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//            } else {
-//                log.error("SEND_0: [{}], evds_StopImage: {} headBytes, {} sendBytes, Failed. [{}]", vds.getVDS_CTLR_IP(), headBytes.length, sendBuff.array().length, vds.getVDS_CTLR_ID());
-//            }
-        } else {
-            log.error("CenterCommServerReceiver: UDP RECV UNKNOWN MESSAGE: {}", opCode);
-        }
-    }
-}

+ 12 - 21
src/main/resources/application.yml

@@ -1,26 +1,15 @@
 application:
-  process:
-    id: VDS01
-    name: VDS Communication Server
-    history: true
-    user-id: admin
-    user-pswd: 1234
+  id: VDS01
+  name: VDS Communication Server
+  history: true
+  user-id: admin
+  user-pswd: 1234
+  listen-port: 9902
 
-  thread-pool:
-
-  facility-manager:
-    enabled: true
-    ip-addr: 172.16.12.25
-    send-port: 5701
-    recv-port: 5202
-
-  controller-comm:
-    comm-logging: true
-    retry-seconds: 20
-    connect-timeout: 5
-
-  center-comm:
-    listen-port: 9901
+running:
+  comm-logging: true
+  retry-seconds: 20
+  connect-timeout: 5
 
 server:
   port: 9874
@@ -40,6 +29,8 @@ spring:
   profiles:
     active: dev
   main:
+    web-application-type: none
+    log-startup-info: true
     banner-mode: off
   mvc:
     view: