shjung 3 anni fa
parent
commit
ffe014b383
39 ha cambiato i file con 415 aggiunte e 1415 eliminazioni
  1. 0 1
      conf/cctv-comm-server.pid
  2. 6 0
      pom.xml
  3. 51 42
      src/main/java/com/its/cctv/CctvCommServerApplication.java
  4. 21 17
      src/main/java/com/its/cctv/config/ApplicationConfig.java
  5. 0 32
      src/main/java/com/its/cctv/config/FacilityManagerConfig.java
  6. 0 55
      src/main/java/com/its/cctv/config/ProcessConfig.java
  7. 2 2
      src/main/java/com/its/cctv/config/RunningConfig.java
  8. 0 92
      src/main/java/com/its/cctv/config/SystemInfo.java
  9. 1 5
      src/main/java/com/its/cctv/config/ThreadPoolInitializer.java
  10. 4 4
      src/main/java/com/its/cctv/scheduler/SchedulerTask.java
  11. 3 3
      src/main/java/com/its/cctv/service/UnitSystService.java
  12. 89 17
      src/main/java/com/its/cctv/ui/MainUI.java
  13. 10 3
      src/main/java/com/its/cctv/ui/SubUIController.java
  14. 5 5
      src/main/java/com/its/cctv/webapp/controller/WebAppCommonController.java
  15. 3 3
      src/main/java/com/its/cctv/webapp/controller/WebAppController.java
  16. 2 8
      src/main/java/com/its/cctv/xnettcp/TcpServerAbstract.java
  17. 3 3
      src/main/java/com/its/cctv/xnettcp/TcpServerCtlrComm.java
  18. 14 6
      src/main/java/com/its/cctv/xnettcp/cctv/CctvTcpClient.java
  19. 2 2
      src/main/java/com/its/cctv/xnettcp/cctv/CctvTcpClientCommService.java
  20. 2 2
      src/main/java/com/its/cctv/xnettcp/center/CenterTcpServerService.java
  21. 187 0
      src/main/java/com/its/cctv/xnettcp/center/protocol/CenterProtocol.java
  22. 0 14
      src/main/java/com/its/cctv/xnetudp/UdpServerAbstract.java
  23. 0 78
      src/main/java/com/its/cctv/xnetudp/UdpServerCenterComm.java
  24. 0 88
      src/main/java/com/its/cctv/xnetudp/codec/CenterCommClientEncoder.java
  25. 0 47
      src/main/java/com/its/cctv/xnetudp/codec/CenterCommServerDecoder.java
  26. 0 44
      src/main/java/com/its/cctv/xnetudp/handler/CenterCommServerPacketHandler.java
  27. 0 174
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_COMM_DEFINE.java
  28. 0 137
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_COMM_MESSAGE.java
  29. 0 59
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_PG_STATE_RES.java
  30. 0 69
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_VDS_REQ_COMMON.java
  31. 0 9
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_VDS_REQ_RESET.java
  32. 0 24
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_VDS_REQ_STOPIMAGE.java
  33. 0 82
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_VDS_RES_STATE.java
  34. 0 63
      src/main/java/com/its/cctv/xnetudp/protocol/CENTER_VDS_RES_STOPIMAGE.java
  35. 0 33
      src/main/java/com/its/cctv/xnetudp/service/CenterCommResponseService.java
  36. 0 10
      src/main/java/com/its/cctv/xnetudp/thread/AbstractCenterCommServerReceiver.java
  37. 0 54
      src/main/java/com/its/cctv/xnetudp/thread/CenterCommClientSender.java
  38. 0 107
      src/main/java/com/its/cctv/xnetudp/thread/CenterCommServerReceiver.java
  39. 10 21
      src/main/resources/application.yml

+ 0 - 1
conf/cctv-comm-server.pid

@@ -1 +0,0 @@
-4496

+ 6 - 0
pom.xml

@@ -44,6 +44,12 @@
             <version>1.8</version>
         </dependency>
 
+<!--        <dependency>-->
+<!--            <groupId>org.gstreamer</groupId>-->
+<!--            <artifactId>gstreamer-java</artifactId>-->
+<!--            <version>1.3</version>-->
+<!--        </dependency>-->
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>

+ 51 - 42
src/main/java/com/its/cctv/CctvCommServerApplication.java

@@ -3,15 +3,16 @@ package com.its.cctv;
 import com.its.app.AppUtils;
 import com.its.app.utils.OS;
 import com.its.app.utils.SysUtils;
-import com.its.cctv.config.ProcessConfig;
+import com.its.cctv.config.ApplicationConfig;
+import com.its.cctv.entity.TbUnitSyst;
 import com.its.cctv.process.DbmsDataProcess;
 import com.its.cctv.service.CctvCtlrService;
 import com.its.cctv.service.UnitSystService;
 import com.its.cctv.ui.JTextAreaOutputStream;
 import com.its.cctv.ui.MainUI;
-import com.its.cctv.xnettcp.center.CenterTcpServerService;
 import com.its.cctv.xnettcp.cctv.CctvTcpClientCommService;
 import com.its.cctv.xnettcp.cctv.process.CctvDataProcess;
+import com.its.cctv.xnettcp.center.CenterTcpServerService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.InitializingBean;
@@ -74,45 +75,6 @@ public class CctvCommServerApplication implements CommandLineRunner, Application
 
     @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("**                     CCTV 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();
-
-        CctvDataProcess tcpServerDataProcess = (CctvDataProcess)AppUtils.getBean(CctvDataProcess.class);
-        tcpServerDataProcess.run();
-
-        UnitSystService unitSystService = (UnitSystService)AppUtils.getBean(UnitSystService.class);
-        unitSystService.loadMaster();
-        unitSystService.updateUnitSystStts(true);
-
-        CctvCtlrService ctlrService = (CctvCtlrService)AppUtils.getBean(CctvCtlrService.class);
-        ctlrService.loadDb();
-        ctlrService.updateCtlrStts(true);
-
-        CctvTcpClientCommService ctlrCommClientService = (CctvTcpClientCommService)AppUtils.getBean(CctvTcpClientCommService.class);
-        ctlrCommClientService.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 CctvCommServerApplication implements CommandLineRunner, Application
                 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("**                     CCTV 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();
+
+        CctvDataProcess tcpServerDataProcess = (CctvDataProcess)AppUtils.getBean(CctvDataProcess.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());
+        }
+
+        CctvCtlrService ctlrService = (CctvCtlrService)AppUtils.getBean(CctvCtlrService.class);
+        ctlrService.loadDb();
+        ctlrService.updateCtlrStts(true);
+
+        CctvTcpClientCommService ctlrCommClientService = (CctvTcpClientCommService)AppUtils.getBean(CctvTcpClientCommService.class);
+        ctlrCommClientService.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/cctv/config/CenterCommConfig.java → src/main/java/com/its/cctv/config/ApplicationConfig.java

@@ -1,5 +1,6 @@
 package com.its.cctv.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 = "CTV01";
+    private String name = "CCTV 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 = 9903;
     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/cctv/config/FacilityManagerConfig.java

@@ -1,32 +0,0 @@
-package com.its.cctv.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/cctv/config/ProcessConfig.java

@@ -1,55 +0,0 @@
-package com.its.cctv.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 = "CTV01";
-    private String name = "CCTV 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/cctv/config/ControllerCommConfig.java → src/main/java/com/its/cctv/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/cctv/config/SystemInfo.java

@@ -1,92 +0,0 @@
-package com.its.cctv.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/cctv/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;
         }

+ 4 - 4
src/main/java/com/its/cctv/scheduler/SchedulerTask.java

@@ -1,7 +1,7 @@
 package com.its.cctv.scheduler;
 
 import com.its.app.utils.Elapsed;
-import com.its.cctv.config.ProcessConfig;
+import com.its.cctv.config.ApplicationConfig;
 import com.its.cctv.service.CctvCtlrService;
 import com.its.cctv.service.UnitSystService;
 import lombok.AllArgsConstructor;
@@ -18,13 +18,13 @@ import javax.annotation.PreDestroy;
 @Component
 public class SchedulerTask {
 
-    private final ProcessConfig processConfig;
+    private final ApplicationConfig applicationConfig;
     private final UnitSystService unitSystService;
     private final CctvCtlrService cctvCtlrService;
 
     @Scheduled(cron = "6 * * * * *")  // 1분주기 작업 실행(매분 6초)
     public void UnitSystSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();
@@ -38,7 +38,7 @@ public class SchedulerTask {
 
     @Scheduled(cron = "1/30 * * * * *")    // 30초마다 요청(4초, 34초)
     public void CctvStateReqSchedule() {
-        if (!this.processConfig.isStartSchedule()) {
+        if (!this.applicationConfig.isStartSchedule()) {
             return;
         }
         Elapsed elapsed = new Elapsed();

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

@@ -2,7 +2,7 @@ package com.its.cctv.service;
 
 import com.its.app.AppUtils;
 import com.its.app.utils.SysUtils;
-import com.its.cctv.config.ProcessConfig;
+import com.its.cctv.config.ApplicationConfig;
 import com.its.cctv.dao.mapper.UnitSystMapper;
 import com.its.cctv.entity.TbUnitSyst;
 import com.its.cctv.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 {

+ 89 - 17
src/main/java/com/its/cctv/ui/MainUI.java

@@ -4,6 +4,7 @@ import com.intellij.uiDesigner.core.GridConstraints;
 import com.intellij.uiDesigner.core.GridLayoutManager;
 import com.intellij.uiDesigner.core.Spacer;
 import com.its.app.utils.SysUtils;
+import com.its.cctv.domain.NET;
 import com.its.cctv.entity.TbCctvCtlr;
 import com.its.cctv.global.AppRepository;
 import com.sun.management.OperatingSystemMXBean;
@@ -71,6 +72,7 @@ public class MainUI {
     private JButton btnDisconnect;
     private JTextField txtName;
     private JTextField txtId;
+    private boolean isUpdatable;
 
     public static MainUI getInstance() {
         return _instance;
@@ -95,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;
@@ -102,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();
@@ -110,22 +112,11 @@ public class MainUI {
         } catch (FontFormatException e) {
         } catch (IOException e) {
         }
-
         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() {
@@ -216,6 +207,81 @@ public class MainUI {
         });
     }
 
+//    private void showStream() {
+//        String streamUrl = "rtsp://118.40.176.110:1935/live/CCAM0020.stream";
+//        System.setProperty("apple.awt.graphics.UseQuartz", "false");
+//
+//
+//        pipe = new Pipeline("pipeline");
+//        pipe.getBus().connect(new Bus.ERROR() {
+//            public void errorMessage(GstObject source, int code, String message) {
+//                System.out.println("Error occurred: " + message);
+//                Gst.quit();
+//            }
+//        });
+//        pipe.getBus().connect(new Bus.STATE_CHANGED() {
+//            public void stateChanged(GstObject source, State old, State current, State pending) {
+//                if (source == pipe) {
+//                    System.out.println("Pipeline state changed from " + old + " to " + current);
+//                }
+//            }
+//        });
+//        pipe.getBus().connect(new Bus.EOS() {
+//            public void endOfStream(GstObject source) {
+//                System.out.println("Finished playing file");
+//                Gst.quit();
+//            }
+//        });
+//
+//        pipe.getBus().connect(new Bus.TAG() {
+//            public void tagsFound(GstObject source, TagList tagList) {
+//                for (String tag : tagList.getTagNames()) {
+//                    System.out.println("Found tag " + tag + " = "
+//                            + tagList.getValue(tag, 0));
+//                }
+//            }
+//        });
+//
+//        final Element source = ElementFactory.make("rtspsrc", "Source");
+//        final Element demux = ElementFactory.make("rtpmp4vdepay", "Depay");
+//        final Element decoder = ElementFactory.make("ffdec_mpeg4", "Decoder");
+//        final Element colorspace = ElementFactory.make("ffmpegcolorspace", "Colorspace");
+//        //final Element sink = ElementFactory.make ("autovideosink", "Output");
+//
+//        SwingUtilities.invokeLater(new Runnable() {
+//            public void run() {
+//                // Create the video component and link it in
+//                VideoComponent videoComponent = new VideoComponent();
+//                Element videosink = videoComponent.getElement();
+//
+//                source.connect(new Element.PAD_ADDED() {
+//                    public void padAdded(Element element, Pad pad) {
+//                        pad.link(demux.getStaticPad("sink"));
+//                    }
+//                });
+//
+//                Pad p = new Pad(null, PadDirection.SRC);
+//                source.addPad(p);
+//
+//                source.set("location", streamUrl);  //replace this with your source
+//
+//                pipe.addMany(source, demux, decoder, colorspace, videosink);
+//                Element.linkMany(demux, decoder, colorspace, videosink);
+//
+//                // Now create a JFrame to display the video output
+//                JFrame frame = new JFrame("Swing Video Test");
+//                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+//                frame.add(videoComponent, BorderLayout.CENTER);
+//                videoComponent.setPreferredSize(new Dimension(720, 576));
+//                frame.pack();
+//                frame.setVisible(true);
+//
+//                // Start the pipeline processing
+//                pipe.play();
+//            }
+//        });
+//    }
+
     /**
      * 제어기 명령 처리
      *
@@ -226,10 +292,10 @@ public class MainUI {
             JOptionPane.showMessageDialog(getRootPanel(), "제어기가 선택되지 않았습니다. 목록을 더블클릭하여 제어기를 선택하세요.", "제어기 선택", JOptionPane.ERROR_MESSAGE);
             return;
         }
-//        if (this.selObj.getNetState() == NET.CLOSED) {
-//            JOptionPane.showMessageDialog(getRootPanel(), "제어기가 현재 연결이 되어 있지 않습니다.", "제어기 연결 상태", JOptionPane.ERROR_MESSAGE);
-//            return;
-//        }
+        if (this.selObj.getNetState() == NET.CLOSED) {
+            JOptionPane.showMessageDialog(getRootPanel(), "제어기가 현재 연결이 되어 있지 않습니다.", "제어기 연결 상태", JOptionPane.ERROR_MESSAGE);
+            return;
+        }
 
         boolean isDirectCmd = true;
         String message = "", title = "";
@@ -288,7 +354,9 @@ public class MainUI {
         if (subUIController.isVisible()) {
             //subUIController.setVisible(false);
         }
-
+        if (!this.isUpdatable) {
+            return false;
+        }
         int row = tblCtlrList.getSelectedRow();
         if (row < 0) {
             JOptionPane.showMessageDialog(getRootPanel(), "목록에서 CCTV 를 선택해주세요.", "CCTV 제어", JOptionPane.ERROR_MESSAGE);
@@ -364,6 +432,7 @@ public class MainUI {
         for (int ii = 0; ii < getColumnModel.getColumnCount(); ii++) {
             getColumnModel.getColumn(ii).setCellRenderer(cellRenderer);
         }
+        this.isUpdatable = true;
     }
 
     public void updateCommSttsTotal() {
@@ -396,6 +465,9 @@ public class MainUI {
     }
 
     public void updateCtlrStts(TbCctvCtlr obj) {
+        if (!this.isUpdatable) {
+            return;
+        }
         if (this.ctlrSttsTableModel == null) {
             return;
         }

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

@@ -1,9 +1,11 @@
 package com.its.cctv.ui;
 
 import com.its.cctv.entity.TbCctvCtlr;
+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("CCTV 제어");
-        String pathOfImage = "C:\\DEV\\ITS\\01.WINDOWS\\22.07.PyeongTaek\\JAVA\\cctv-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/cctv/webapp/controller/WebAppCommonController.java

@@ -2,7 +2,7 @@ package com.its.cctv.webapp.controller;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.its.app.utils.Ping;
-import com.its.cctv.config.ProcessConfig;
+import com.its.cctv.config.ApplicationConfig;
 import com.its.cctv.webapp.service.FileService;
 import com.its.cctv.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/cctv/webapp/controller/WebAppController.java

@@ -1,6 +1,6 @@
 package com.its.cctv.webapp.controller;
 
-import com.its.cctv.config.ProcessConfig;
+import com.its.cctv.config.ApplicationConfig;
 import com.its.cctv.domain.NET;
 import com.its.cctv.entity.TbCctvCtlr;
 import com.its.cctv.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.getCCTV_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/cctv/xnettcp/TcpServerAbstract.java

@@ -1,6 +1,5 @@
 package com.its.cctv.xnettcp;
 
-import com.its.cctv.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/cctv/xnettcp/TcpServerCtlrComm.java

@@ -1,7 +1,7 @@
 package com.its.cctv.xnettcp;
 
 import com.its.app.AppUtils;
-import com.its.cctv.config.ProcessConfig;
+import com.its.cctv.config.ApplicationConfig;
 import lombok.ToString;
 import lombok.extern.slf4j.Slf4j;
 
@@ -12,14 +12,14 @@ import javax.annotation.PostConstruct;
 //@Component
 public class TcpServerCtlrComm extends TcpServerAbstract {
 
-    private ProcessConfig processConfig;
+    private ApplicationConfig applicationConfig;
 
     @PostConstruct
     private void init() {
     }
     public void run() {
         log.info("TcpServerCtlrComm.init: Start.");
-        this.processConfig = (ProcessConfig) AppUtils.getBean(ProcessConfig.class);
+        this.applicationConfig = (ApplicationConfig) AppUtils.getBean(ApplicationConfig.class);
         log.info("TcpServerCtlrComm.init. ..End. {}", toString());
     }
 

+ 14 - 6
src/main/java/com/its/cctv/xnettcp/cctv/CctvTcpClient.java

@@ -1,15 +1,18 @@
 package com.its.cctv.xnettcp.cctv;
 
 import com.its.app.AppUtils;
+import com.its.cctv.entity.TbCctvCtlrStts;
+import com.its.cctv.process.DbmsData;
+import com.its.cctv.process.DbmsDataProcess;
+import com.its.cctv.process.DbmsDataType;
 import com.its.cctv.ui.MainUI;
-import com.its.cctv.config.ControllerCommConfig;
+import com.its.cctv.config.RunningConfig;
 import com.its.cctv.entity.TbCctvCtlr;
 import com.its.cctv.xnettcp.cctv.codec.CctvTcpClientDecoder;
 import com.its.cctv.xnettcp.cctv.codec.CctvTcpClientEncoder;
 import com.its.cctv.xnettcp.cctv.handler.CctvTcpClientIdleHandler;
 import com.its.cctv.xnettcp.cctv.handler.CctvTcpClientInboundHandler;
 import com.its.cctv.xnettcp.cctv.process.CctvDataProcess;
-import com.its.cctv.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 CctvTcpClient implements Callable<Object> {
 
     private final TbCctvCtlr controller;
-    private final ControllerCommConfig commConfig;
+    private final RunningConfig commConfig;
     private final CctvDataProcess cctvDataProcess;
     private final CctvTcpClientBootstrapFactory bootstrapFactory;
 
@@ -127,9 +133,11 @@ public class CctvTcpClient implements Callable<Object> {
         if (obj.getChannel() != null) {
             log.error("[{}]. Controller closed: channel {}", this.controller.getCCTV_CTLR_ID(), channel);
             // 연결 되어 있다가 종료 된 경우임....
-            // 클라이언트 연결 종료정보를 운영단말로 전송한다.
-            CenterCommResponseService centerCommResponseService = (CenterCommResponseService) AppUtils.getBean(CenterCommResponseService.class);
-            centerCommResponseService.notifyStatus(obj, false);
+            // 제어기 상태정보 DB 업데이트
+            DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+            List<TbCctvCtlrStts> ctlrSttsList = Collections.synchronizedList(new ArrayList<>());
+            ctlrSttsList.add(obj.getStts());
+            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/cctv/xnettcp/cctv/CctvTcpClientCommService.java

@@ -1,6 +1,6 @@
 package com.its.cctv.xnettcp.cctv;
 
-import com.its.cctv.config.ControllerCommConfig;
+import com.its.cctv.config.RunningConfig;
 import com.its.cctv.entity.TbCctvCtlr;
 import com.its.cctv.global.AppRepository;
 import com.its.cctv.xnettcp.cctv.process.CctvDataProcess;
@@ -25,7 +25,7 @@ import java.util.concurrent.Future;
 @Service
 public class CctvTcpClientCommService {
 
-    private final ControllerCommConfig commConfig;
+    private final RunningConfig commConfig;
     private final CctvDataProcess cctvDataProcess;
 
     private CctvTcpClientBootstrapFactory bootstrapFactory;

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

@@ -2,7 +2,7 @@ package com.its.cctv.xnettcp.center;
 
 import com.its.app.utils.NettyUtils;
 import com.its.app.utils.OS;
-import com.its.cctv.config.CenterCommConfig;
+import com.its.cctv.config.ApplicationConfig;
 import com.its.cctv.xnettcp.center.codec.CenterTcpServerEncoder;
 import com.its.cctv.xnettcp.center.handler.CenterTcpServerInboundHandler;
 import com.its.cctv.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/cctv/xnettcp/center/protocol/CenterProtocol.java

@@ -1,5 +1,6 @@
 package com.its.cctv.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();
+    }
+
 }

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

@@ -1,14 +0,0 @@
-package com.its.cctv.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/cctv/xnetudp/UdpServerCenterComm.java

@@ -1,78 +0,0 @@
-package com.its.cctv.xnetudp;
-
-import com.its.app.AppUtils;
-import com.its.cctv.config.ProcessConfig;
-import com.its.cctv.xnetudp.codec.CenterCommServerDecoder;
-import com.its.cctv.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/cctv/xnetudp/codec/CenterCommClientEncoder.java

@@ -1,88 +0,0 @@
-package com.its.cctv.xnetudp.codec;
-
-import com.its.app.AppUtils;
-import com.its.app.utils.SysUtils;
-import com.its.cctv.config.ProcessConfig;
-import com.its.cctv.entity.TbUnitSyst;
-import com.its.cctv.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/cctv/xnetudp/codec/CenterCommServerDecoder.java

@@ -1,47 +0,0 @@
-package com.its.cctv.xnetudp.codec;
-
-import com.its.app.AppUtils;
-import com.its.app.utils.SysUtils;
-import com.its.cctv.config.ProcessConfig;
-import com.its.cctv.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/cctv/xnetudp/handler/CenterCommServerPacketHandler.java

@@ -1,44 +0,0 @@
-package com.its.cctv.xnetudp.handler;
-
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.cctv.xnetudp.protocol.CENTER_COMM_MESSAGE;
-import com.its.cctv.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/cctv/xnetudp/protocol/CENTER_COMM_DEFINE.java

@@ -1,174 +0,0 @@
-package com.its.cctv.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/cctv/xnetudp/protocol/CENTER_COMM_MESSAGE.java

@@ -1,137 +0,0 @@
-package com.its.cctv.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 - 59
src/main/java/com/its/cctv/xnetudp/protocol/CENTER_PG_STATE_RES.java

@@ -1,59 +0,0 @@
-package com.its.cctv.xnetudp.protocol;
-
-import lombok.Data;
-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/cctv/xnetudp/protocol/CENTER_VDS_REQ_COMMON.java

@@ -1,69 +0,0 @@
-package com.its.cctv.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/cctv/xnetudp/protocol/CENTER_VDS_REQ_RESET.java

@@ -1,9 +0,0 @@
-package com.its.cctv.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/cctv/xnetudp/protocol/CENTER_VDS_REQ_STOPIMAGE.java

@@ -1,24 +0,0 @@
-package com.its.cctv.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 - 82
src/main/java/com/its/cctv/xnetudp/protocol/CENTER_VDS_RES_STATE.java

@@ -1,82 +0,0 @@
-package com.its.cctv.xnetudp.protocol;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-
-import java.nio.ByteBuffer;
-
-@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 null;//byteBuffer;
-	}
-
-}

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

@@ -1,63 +0,0 @@
-package com.its.cctv.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 - 33
src/main/java/com/its/cctv/xnetudp/service/CenterCommResponseService.java

@@ -1,33 +0,0 @@
-package com.its.cctv.xnetudp.service;
-
-import com.its.app.AppUtils;
-import com.its.cctv.entity.TbCctvCtlr;
-import com.its.cctv.entity.TbCctvCtlrStts;
-import com.its.cctv.process.DbmsData;
-import com.its.cctv.process.DbmsDataProcess;
-import com.its.cctv.process.DbmsDataType;
-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(TbCctvCtlr obj, boolean isConnect) {
-
-        List<TbCctvCtlrStts> ctlrSttsList = Collections.synchronizedList(new ArrayList<>());
-
-        ctlrSttsList.add(obj.getStts());
-
-        // 제어기 상태정보 DB 업데이트
-        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
-        if (ctlrSttsList.size() > 0) {
-            dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_CTLR_STTS, false, ctlrSttsList));
-        }
-    }
-
-}

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

@@ -1,10 +0,0 @@
-package com.its.cctv.xnetudp.thread;
-
-import com.its.cctv.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/cctv/xnetudp/thread/CenterCommClientSender.java

@@ -1,54 +0,0 @@
-package com.its.cctv.xnetudp.thread;
-
-import com.its.cctv.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/cctv/xnetudp/thread/CenterCommServerReceiver.java

@@ -1,107 +0,0 @@
-package com.its.cctv.xnetudp.thread;
-
-import com.its.app.AppUtils;
-import com.its.cctv.domain.NET;
-import com.its.cctv.entity.TbUnitSyst;
-import com.its.cctv.entity.TbCctvCtlr;
-import com.its.cctv.global.AppRepository;
-import com.its.cctv.service.UnitSystService;
-import com.its.cctv.xnetudp.protocol.CENTER_COMM_DEFINE;
-import com.its.cctv.xnetudp.protocol.CENTER_COMM_MESSAGE;
-import com.its.cctv.xnetudp.protocol.CENTER_VDS_REQ_RESET;
-import com.its.cctv.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());
-
-            TbCctvCtlr 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());
-
-            TbCctvCtlr 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);
-        }
-    }
-}

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

@@ -1,26 +1,15 @@
 application:
-  process:
-    id: CTV01
-    name: CCTV Communication Server
-    history: true
-    user-id: admin
-    user-pswd: 1234
+  id: CTV01
+  name: CCTV Communication Server
+  history: true
+  user-id: admin
+  user-pswd: 1234
+  listen-port: 9903
 
-  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: 9879