shjung 1 سال پیش
والد
کامیت
a253f2c14e
66فایلهای تغییر یافته به همراه2508 افزوده شده و 3459 حذف شده
  1. 4 4
      src/main/java/com/its/rota/server/ItsRotaServerApplication.java
  2. 0 11
      src/main/java/com/its/rota/server/dao/mapper/CommHistMapper.java
  3. 0 13
      src/main/java/com/its/rota/server/dao/mapper/DeleteMapper.java
  4. 16 0
      src/main/java/com/its/rota/server/dao/mapper/IncidentMapper.java
  5. 0 1
      src/main/java/com/its/rota/server/dao/mapper/IntEventHistMapper.java
  6. 0 39
      src/main/java/com/its/rota/server/dao/mapper/IntMapper.java
  7. 0 19
      src/main/java/com/its/rota/server/dao/mapper/RegionCenterMapper.java
  8. 14 0
      src/main/java/com/its/rota/server/dao/mapper/TrafficMapper.java
  9. 70 0
      src/main/java/com/its/rota/server/dao/mapper/batch/ItsRotaDao.java
  10. 0 74
      src/main/java/com/its/rota/server/dao/mapper/batch/SigIntDao.java
  11. 4 7
      src/main/java/com/its/rota/server/entity/TbCheckIncident.java
  12. 16 0
      src/main/java/com/its/rota/server/entity/TbCheckTraffic.java
  13. 0 21
      src/main/java/com/its/rota/server/entity/TbCommHist.java
  14. 0 72
      src/main/java/com/its/rota/server/entity/TbCurrTod.java
  15. 0 40
      src/main/java/com/its/rota/server/entity/TbCurrTrans.java
  16. 0 43
      src/main/java/com/its/rota/server/entity/TbInt.java
  17. 0 25
      src/main/java/com/its/rota/server/entity/TbIntUnknown.java
  18. 0 60
      src/main/java/com/its/rota/server/entity/TbRegionCenter.java
  19. 0 22
      src/main/java/com/its/rota/server/entity/TbRegionCenterComm.java
  20. 0 28
      src/main/java/com/its/rota/server/entity/TbRegionGgits.java
  21. 26 0
      src/main/java/com/its/rota/server/entity/TbSndIncident.java
  22. 3 2
      src/main/java/com/its/rota/server/process/dbms/DbmsData.java
  23. 43 47
      src/main/java/com/its/rota/server/process/dbms/DbmsDataProcess.java
  24. 3 2
      src/main/java/com/its/rota/server/process/work/DataPacketProcess.java
  25. 3 2
      src/main/java/com/its/rota/server/process/work/DataPacketWorker.java
  26. 23 29
      src/main/java/com/its/rota/server/scheduler/ApplicationScheduler.java
  27. 0 62
      src/main/java/com/its/rota/server/service/DeleteService.java
  28. 33 0
      src/main/java/com/its/rota/server/service/IncidentService.java
  29. 45 0
      src/main/java/com/its/rota/server/service/ItsRotaServerService.java
  30. 33 0
      src/main/java/com/its/rota/server/service/TrafficService.java
  31. 14 16
      src/main/java/com/its/rota/server/service/UnitSystService.java
  32. 5 5
      src/main/java/com/its/rota/server/xnet/server/ItsAsnCommServerInitializer.java
  33. 23 25
      src/main/java/com/its/rota/server/xnet/server/codec/ItsAsnServerEncoder.java
  34. 1 2
      src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerIdleStateConnectionHandler.java
  35. 34 36
      src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerIdleStatePacketHandler.java
  36. 26 34
      src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerLoginInboundHandler.java
  37. 5 6
      src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerPacketInboundHandler.java
  38. 92 100
      src/main/java/com/its/rota/server/xnet/server/process/response/AcceptResponse.java
  39. 82 89
      src/main/java/com/its/rota/server/xnet/server/process/response/DsrcAsn1Accept.java
  40. 38 48
      src/main/java/com/its/rota/server/xnet/server/process/response/DsrcAsn1Reject.java
  41. 29 36
      src/main/java/com/its/rota/server/xnet/server/process/response/FredResponse.java
  42. 7 9
      src/main/java/com/its/rota/server/xnet/server/process/response/InitiateResponse.java
  43. 1 1
      src/main/java/com/its/rota/server/xnet/server/process/response/ItsAsnResponse.java
  44. 140 148
      src/main/java/com/its/rota/server/xnet/server/process/response/LoginResponse.java
  45. 12 16
      src/main/java/com/its/rota/server/xnet/server/process/response/LogoutResponse.java
  46. 3 5
      src/main/java/com/its/rota/server/xnet/server/process/response/NullResponse.java
  47. 43 51
      src/main/java/com/its/rota/server/xnet/server/process/response/PublicationResponse.java
  48. 24 28
      src/main/java/com/its/rota/server/xnet/server/process/response/RejectResponse.java
  49. 60 62
      src/main/java/com/its/rota/server/xnet/server/process/response/SubscriptionResponse.java
  50. 2 3
      src/main/java/com/its/rota/server/xnet/server/process/response/TerminateResponse.java
  51. 1 1
      src/main/java/com/its/rota/server/xnet/server/process/response/TransferDoneResponse.java
  52. 647 660
      src/main/java/com/its/rota/server/xnet/server/process/service/ControlDeviceService.java
  53. 382 395
      src/main/java/com/its/rota/server/xnet/server/process/service/LoginDeviceService.java
  54. 176 204
      src/main/java/com/its/rota/server/xnet/server/process/service/MultiMediaDataService.java
  55. 110 121
      src/main/java/com/its/rota/server/xnet/server/process/service/OBUGatherInfoService.java
  56. 1 0
      src/main/java/com/its/rota/server/xnet/server/process/service/SubscriptionService.java
  57. 45 48
      src/main/java/com/its/rota/server/xnet/server/process/service/impl/SubscriptionRegisterService.java
  58. 61 72
      src/main/java/com/its/rota/server/xnet/server/process/service/impl/SubscriptionSingleService.java
  59. 0 20
      src/main/resources/mybatis/mapper/CommHistMapper.xml
  60. 0 42
      src/main/resources/mybatis/mapper/DeleteMapper.xml
  61. 75 0
      src/main/resources/mybatis/mapper/IncidentMapper.xml
  62. 0 14
      src/main/resources/mybatis/mapper/IntEventHistMapper.xml
  63. 0 451
      src/main/resources/mybatis/mapper/IntMapper.xml
  64. 1 1
      src/main/resources/mybatis/mapper/ProcessMapper.xml
  65. 0 87
      src/main/resources/mybatis/mapper/RegionCenterMapper.xml
  66. 32 0
      src/main/resources/mybatis/mapper/TrafficMapper.xml

+ 4 - 4
src/main/java/com/its/rota/server/ItsRotaServerApplication.java

@@ -2,7 +2,7 @@ package com.its.rota.server;
 
 import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.process.dbms.DbmsDataProcess;
-import com.its.rota.server.process.work.GgitsPacketProcess;
+import com.its.rota.server.process.work.DataPacketProcess;
 import com.its.rota.server.repository.ApplicationRepository;
 import com.its.rota.server.service.UnitSystService;
 import com.its.rota.server.xnet.server.ItsAsnCommServerService;
@@ -48,7 +48,7 @@ public class ItsRotaServerApplication implements CommandLineRunner, ApplicationL
         log.info("************************************************************************************");
         log.info("**                                                                                **");
         log.info("**                            UTIC ITS ROTA System                                **");
-        log.info("**                UTIC ITS ROTA  Communication Server Program.                    **");
+        log.info("**                UTIC ITS ROTA Communication Server Program.                    **");
         log.info("**                                                                                **");
         log.info("**                                                                   [ver.1.0]    **");
         log.info("** startup: {}", sdfDate.format(new Date()));
@@ -61,8 +61,8 @@ public class ItsRotaServerApplication implements CommandLineRunner, ApplicationL
         ApplicationRepository applicationRepository = SpringUtils.getBean(ApplicationRepository.class);
         applicationRepository.loadDb();
 
-        GgitsPacketProcess ggitsPacketProcess = SpringUtils.getBean(GgitsPacketProcess.class);
-        ggitsPacketProcess.run();
+        DataPacketProcess dataPacketProcess = SpringUtils.getBean(DataPacketProcess.class);
+        dataPacketProcess.run();
 
         ItsAsnCommServerService itsAsnCommServerService = SpringUtils.getBean(ItsAsnCommServerService.class);
         itsAsnCommServerService.run();

+ 0 - 11
src/main/java/com/its/rota/server/dao/mapper/CommHistMapper.java

@@ -1,11 +0,0 @@
-package com.its.rota.server.dao.mapper;
-
-import com.its.rota.server.entity.TbCommHist;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-@Mapper
-public interface CommHistMapper {
-    int insertCommHist(@Param("obj") TbCommHist obj);
-    int insertCommLoginOut(@Param("obj") TbCommHist obj);
-}

+ 0 - 13
src/main/java/com/its/rota/server/dao/mapper/DeleteMapper.java

@@ -1,13 +0,0 @@
-package com.its.rota.server.dao.mapper;
-
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface DeleteMapper {
-
-    int deleteRcvLinkTraffic();
-    int deleteSndIncident();
-    int deleteRcvLog();
-    int deleteSndLog();
-    int deleteRcvIncident();
-}

+ 16 - 0
src/main/java/com/its/rota/server/dao/mapper/IncidentMapper.java

@@ -0,0 +1,16 @@
+package com.its.rota.server.dao.mapper;
+
+import com.its.rota.server.entity.TbCheckIncident;
+import com.its.rota.server.entity.TbSndIncident;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface IncidentMapper {
+
+    int delCheckIncident();
+    int insSndIncident(@Param("obj") TbCheckIncident obj);
+    List<TbSndIncident> selSndIncident(@Param("obj") TbCheckIncident obj);
+}

+ 0 - 1
src/main/java/com/its/rota/server/dao/mapper/IntEventHistMapper.java

@@ -1,6 +1,5 @@
 package com.its.rota.server.dao.mapper;
 
-import com.its.rota.server.entity.TbIntEventHist;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 

+ 0 - 39
src/main/java/com/its/rota/server/dao/mapper/IntMapper.java

@@ -1,39 +0,0 @@
-package com.its.rota.server.dao.mapper;
-
-import com.its.rota.server.entity.TbCurrTod;
-import com.its.rota.server.entity.TbCurrTrans;
-import com.its.rota.server.entity.TbInt;
-import com.its.rota.server.entity.TbIntUnknown;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface IntMapper {
-
-    List<TbInt> selectGgitsIntAll();
-    List<TbInt> selectAll(@Param("regionCd") String regionCd);
-    List<TbCurrTrans> selectCurrTransAll(@Param("regionCd") String regionCd);
-    List<TbCurrTod> selectCurrTodAll(@Param("regionCd") String regionCd);
-    int insertIntUnknown(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownPhase(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownStatus(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownResrvPlan(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownPlan(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownOperPlan(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownHolyDdPlan(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownDyPlan(@Param("obj") TbIntUnknown obj);
-    int insertIntUnknownSignalMap(@Param("obj") TbIntUnknown obj);
-
-    int initIntStts();
-    int initIntPlan();
-    int initIntOperPlan();
-    int initIntDyPlan();
-    int initIntResrvPlan();
-    int initIntHolyDdPlan();
-    int initIntSignalMap();
-//    int updateIntPhaseStts(Map<String, Object> obj);
-    int updateIntStaticCycle(Map<String, Object> obj);
-}

+ 0 - 19
src/main/java/com/its/rota/server/dao/mapper/RegionCenterMapper.java

@@ -1,19 +0,0 @@
-package com.its.rota.server.dao.mapper;
-
-import com.its.rota.server.entity.TbRegionCenter;
-import com.its.rota.server.entity.TbRegionGgits;
-import com.its.rota.server.entity.TbRegionCenterComm;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-@Mapper
-public interface RegionCenterMapper {
-
-    List<TbRegionCenter> selectRegionCenter();
-    List<TbRegionGgits> selectRegionGgits();
-    int updateCommState(@Param("obj") TbRegionCenterComm obj);
-    int updateCommStateConnect(@Param("obj") TbRegionCenterComm obj);
-    int updateCommStateDisconnect(@Param("obj") TbRegionCenterComm obj);
-}

+ 14 - 0
src/main/java/com/its/rota/server/dao/mapper/TrafficMapper.java

@@ -0,0 +1,14 @@
+package com.its.rota.server.dao.mapper;
+
+import com.its.rota.server.entity.TbCenter;
+import com.its.rota.server.entity.TbCheckTraffic;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface TrafficMapper {
+
+    List<TbCheckTraffic> selCheckTraffic();
+    List<TbCenter> selectRegionCenter();
+}

+ 70 - 0
src/main/java/com/its/rota/server/dao/mapper/batch/ItsRotaDao.java

@@ -0,0 +1,70 @@
+package com.its.rota.server.dao.mapper.batch;
+
+import com.its.rota.server.dao.mapper.BatchDaoService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.session.SqlSessionFactory;
+import org.springframework.stereotype.Repository;
+
+@Slf4j
+@Repository
+public class ItsRotaDao extends BatchDaoService {
+
+    public ItsRotaDao(SqlSessionFactory sqlSessionFactory) {
+        super(sqlSessionFactory);
+        this.serviceName = "ItsRotaDao";//this.getClass().getName();
+    }
+
+//    public List<HashMap<String, Object>> getSttsList(List<IntStatusDto> req) {
+//        List<HashMap<String, Object>> lists = new ArrayList<>();
+//        req.forEach(obj -> {
+//            HashMap<String, Object> param = new HashMap<>();
+//
+//            param.put("REGION_CD",                  obj.REGION_CD);
+//            param.put("INT_NO",                     obj.INT_NO);
+//            param.put("COLLCT_DTIME",               obj.COLLCT_DTIME);
+//            param.put("SYS_COLLCT_DTIME",           obj.SYS_COLLCT_DTIME);
+//            param.put("COMM_ON_OFF_FLAG",           obj.COMM_ON_OFF_FLAG);
+//            param.put("CONTRLR_OPER_MODE_CD",       obj.CONTRLR_OPER_MODE_CD);
+//            param.put("A_RING_PHASE_VAL",           obj.A_RING_PHASE_VAL);
+//            param.put("B_RING_PHASE_VAL",           obj.B_RING_PHASE_VAL);
+//            param.put("SIGLIGHT_TURNOFF_FLAG",      obj.SIGLIGHT_TURNOFF_FLAG);
+//            param.put("SIGLIGHT_BLINK_FLAG",        obj.SIGLIGHT_BLINK_FLAG);
+//            param.put("CONTRLR_MANUAL_FLAG",        obj.CONTRLR_MANUAL_FLAG);
+//            param.put("CONTRLR_TMDIFF_CONTRL_FLAG", obj.CONTRLR_TMDIFF_CONTRL_FLAG);
+//            param.put("MAP_NO",                     obj.MAP_NO);
+//            param.put("INT_SIG_CYCLE_CNT",          obj.INT_SIG_CYCLE_CNT);
+//            param.put("INT_SIG_CYCLE_LEN",          obj.INT_SIG_CYCLE_LEN);
+//            param.put("A_RING_1_PHASE_VAL",         obj.A_RING_1_PHASE_VAL);
+//            param.put("A_RING_2_PHASE_VAL",         obj.A_RING_2_PHASE_VAL);
+//            param.put("A_RING_3_PHASE_VAL",         obj.A_RING_3_PHASE_VAL);
+//            param.put("A_RING_4_PHASE_VAL",         obj.A_RING_4_PHASE_VAL);
+//            param.put("A_RING_5_PHASE_VAL",         obj.A_RING_5_PHASE_VAL);
+//            param.put("A_RING_6_PHASE_VAL",         obj.A_RING_6_PHASE_VAL);
+//            param.put("A_RING_7_PHASE_VAL",         obj.A_RING_7_PHASE_VAL);
+//            param.put("A_RING_8_PHASE_VAL",         obj.A_RING_8_PHASE_VAL);
+//            param.put("B_RING_1_PHASE_VAL",         obj.B_RING_1_PHASE_VAL);
+//            param.put("B_RING_2_PHASE_VAL",         obj.B_RING_2_PHASE_VAL);
+//            param.put("B_RING_3_PHASE_VAL",         obj.B_RING_3_PHASE_VAL);
+//            param.put("B_RING_4_PHASE_VAL",         obj.B_RING_4_PHASE_VAL);
+//            param.put("B_RING_5_PHASE_VAL",         obj.B_RING_5_PHASE_VAL);
+//            param.put("B_RING_6_PHASE_VAL",         obj.B_RING_6_PHASE_VAL);
+//            param.put("B_RING_7_PHASE_VAL",         obj.B_RING_7_PHASE_VAL);
+//            param.put("B_RING_8_PHASE_VAL",         obj.B_RING_8_PHASE_VAL);
+//            param.put("SIMULFLAG",                  obj.SIMULFLAG);
+//            param.put("GROUP_NO",                   obj.GROUP_NO);
+//            param.put("PPC_CONTRL_FLAG",            obj.PPC_CONTRL_FLAG);
+//
+//            lists.add(param);
+//        });
+//        return lists;
+//    }
+//
+//    public int updateStatus(List<IntStatusDto> req) {
+////        log.info("{}.updateStatus: START. {} EA", this.serviceName, req.size());
+////        Elapsed elapsed = new Elapsed();
+//        int total = updateBatch("updateIntPhaseStts", getSttsList(req));
+////        log.info("{}.updateStatus: ..END. {} EA. {} ms.", this.serviceName, total, elapsed.milliSeconds());
+//        return total;
+//    }
+
+}

+ 0 - 74
src/main/java/com/its/rota/server/dao/mapper/batch/SigIntDao.java

@@ -1,74 +0,0 @@
-package com.its.rota.server.dao.mapper.batch;
-
-import com.its.rota.server.dao.mapper.BatchDaoService;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.session.SqlSessionFactory;
-import org.springframework.stereotype.Repository;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-@Slf4j
-@Repository
-public class SigIntDao extends BatchDaoService {
-
-    public SigIntDao(SqlSessionFactory sqlSessionFactory) {
-        super(sqlSessionFactory);
-        this.serviceName = "SigIntDao";//this.getClass().getName();
-    }
-
-    public List<HashMap<String, Object>> getSttsList(List<IntStatusDto> req) {
-        List<HashMap<String, Object>> lists = new ArrayList<>();
-        req.forEach(obj -> {
-            HashMap<String, Object> param = new HashMap<>();
-
-            param.put("REGION_CD",                  obj.REGION_CD);
-            param.put("INT_NO",                     obj.INT_NO);
-            param.put("COLLCT_DTIME",               obj.COLLCT_DTIME);
-            param.put("SYS_COLLCT_DTIME",           obj.SYS_COLLCT_DTIME);
-            param.put("COMM_ON_OFF_FLAG",           obj.COMM_ON_OFF_FLAG);
-            param.put("CONTRLR_OPER_MODE_CD",       obj.CONTRLR_OPER_MODE_CD);
-            param.put("A_RING_PHASE_VAL",           obj.A_RING_PHASE_VAL);
-            param.put("B_RING_PHASE_VAL",           obj.B_RING_PHASE_VAL);
-            param.put("SIGLIGHT_TURNOFF_FLAG",      obj.SIGLIGHT_TURNOFF_FLAG);
-            param.put("SIGLIGHT_BLINK_FLAG",        obj.SIGLIGHT_BLINK_FLAG);
-            param.put("CONTRLR_MANUAL_FLAG",        obj.CONTRLR_MANUAL_FLAG);
-            param.put("CONTRLR_TMDIFF_CONTRL_FLAG", obj.CONTRLR_TMDIFF_CONTRL_FLAG);
-            param.put("MAP_NO",                     obj.MAP_NO);
-            param.put("INT_SIG_CYCLE_CNT",          obj.INT_SIG_CYCLE_CNT);
-            param.put("INT_SIG_CYCLE_LEN",          obj.INT_SIG_CYCLE_LEN);
-            param.put("A_RING_1_PHASE_VAL",         obj.A_RING_1_PHASE_VAL);
-            param.put("A_RING_2_PHASE_VAL",         obj.A_RING_2_PHASE_VAL);
-            param.put("A_RING_3_PHASE_VAL",         obj.A_RING_3_PHASE_VAL);
-            param.put("A_RING_4_PHASE_VAL",         obj.A_RING_4_PHASE_VAL);
-            param.put("A_RING_5_PHASE_VAL",         obj.A_RING_5_PHASE_VAL);
-            param.put("A_RING_6_PHASE_VAL",         obj.A_RING_6_PHASE_VAL);
-            param.put("A_RING_7_PHASE_VAL",         obj.A_RING_7_PHASE_VAL);
-            param.put("A_RING_8_PHASE_VAL",         obj.A_RING_8_PHASE_VAL);
-            param.put("B_RING_1_PHASE_VAL",         obj.B_RING_1_PHASE_VAL);
-            param.put("B_RING_2_PHASE_VAL",         obj.B_RING_2_PHASE_VAL);
-            param.put("B_RING_3_PHASE_VAL",         obj.B_RING_3_PHASE_VAL);
-            param.put("B_RING_4_PHASE_VAL",         obj.B_RING_4_PHASE_VAL);
-            param.put("B_RING_5_PHASE_VAL",         obj.B_RING_5_PHASE_VAL);
-            param.put("B_RING_6_PHASE_VAL",         obj.B_RING_6_PHASE_VAL);
-            param.put("B_RING_7_PHASE_VAL",         obj.B_RING_7_PHASE_VAL);
-            param.put("B_RING_8_PHASE_VAL",         obj.B_RING_8_PHASE_VAL);
-            param.put("SIMULFLAG",                  obj.SIMULFLAG);
-            param.put("GROUP_NO",                   obj.GROUP_NO);
-            param.put("PPC_CONTRL_FLAG",            obj.PPC_CONTRL_FLAG);
-
-            lists.add(param);
-        });
-        return lists;
-    }
-
-    public int updateStatus(List<IntStatusDto> req) {
-//        log.info("{}.updateStatus: START. {} EA", this.serviceName, req.size());
-//        Elapsed elapsed = new Elapsed();
-        int total = updateBatch("updateIntPhaseStts", getSttsList(req));
-//        log.info("{}.updateStatus: ..END. {} EA. {} ms.", this.serviceName, total, elapsed.milliSeconds());
-        return total;
-    }
-
-}

+ 4 - 7
src/main/java/com/its/rota/server/entity/TbIntEventHist.java → src/main/java/com/its/rota/server/entity/TbCheckIncident.java

@@ -5,16 +5,13 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.io.Serializable;
-
 @Data
 @Builder
 @NoArgsConstructor//(access = AccessLevel.PROTECTED)
 @AllArgsConstructor
-public class TbIntEventHist implements Serializable {
-    private static final long serialVersionUID = 1L;
+public class TbCheckIncident {
+
+    private String toCenterId;
+    private String fromCenterId;
 
-    private String regionCd;    /* 지역 코드 */
-    private int intNo;
-    private String eventCd;
 }

+ 16 - 0
src/main/java/com/its/rota/server/entity/TbCheckTraffic.java

@@ -0,0 +1,16 @@
+package com.its.rota.server.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@Builder
+@NoArgsConstructor//(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+public class TbCheckTraffic {
+
+    private String regDate;
+
+}

+ 0 - 21
src/main/java/com/its/rota/server/entity/TbCommHist.java

@@ -1,21 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbCommHist implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;    /* 지역 코드 */
-    private long collSn;
-    private long opCode;
-    private long sysCd;
-}

+ 0 - 72
src/main/java/com/its/rota/server/entity/TbCurrTod.java

@@ -1,72 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbCurrTod implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;    /* 지역 코드 */
-    private int intNo;
-    private int planNo;
-    private int idxNo;
-    private int hour;           /* 소속 교차로그룹의 정보와 동일 */
-    private int minute;         /* 소속 교차로그룹의 정보와 동일 */
-    private int cycle;          /* 소속 교차로그룹의 정보와 동일 */
-    private int offset;
-
-    private int splitA1;
-    private int splitA2;
-    private int splitA3;
-    private int splitA4;
-    private int splitA5;
-    private int splitA6;
-    private int splitA7;
-    private int splitA8;
-
-    private int splitB1;
-    private int splitB2;
-    private int splitB3;
-    private int splitB4;
-    private int splitB5;
-    private int splitB6;
-    private int splitB7;
-    private int splitB8;
-
-    public CurrTodDto toDto() {
-        return CurrTodDto.builder()
-                .regionCd(this.regionCd)
-                .intNo(this.intNo)
-                .planNo(this.planNo)
-                .idxNo(this.idxNo)
-                .hour(this.hour)
-                .minute(this.minute)
-                .cycle(this.cycle)
-                .offset(this.offset)
-                .splitA1(this.splitA1)
-                .splitA2(this.splitA2)
-                .splitA3(this.splitA3)
-                .splitA4(this.splitA4)
-                .splitA5(this.splitA5)
-                .splitA6(this.splitA6)
-                .splitA7(this.splitA7)
-                .splitA8(this.splitA8)
-                .splitB1(this.splitB1)
-                .splitB2(this.splitB2)
-                .splitB3(this.splitB3)
-                .splitB4(this.splitB4)
-                .splitB5(this.splitB5)
-                .splitB6(this.splitB6)
-                .splitB7(this.splitB7)
-                .splitB8(this.splitB8)
-                .build();
-    }
-}

+ 0 - 40
src/main/java/com/its/rota/server/entity/TbCurrTrans.java

@@ -1,40 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbCurrTrans implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;    /* 지역 코드 */
-    private int intNo;          /* 교차로번호 */
-    private int ringNo;
-    private int planTp;
-    private int stepNo;
-    private int minTm;
-    private int maxTm;
-    private int eop;
-    private int intMainPhase;
-
-    public CurrTransDto toDto() {
-        return CurrTransDto.builder()
-                .regionCd(this.regionCd)
-                .intNo(this.intNo)
-                .ringNo(this.ringNo)
-                .planTp(this.planTp)
-                .stepNo(this.stepNo)
-                .minTm(this.minTm)
-                .maxTm(this.maxTm)
-                .eop(this.eop)
-                .intMainPhase(this.intMainPhase)
-                .build();
-    }
-}

+ 0 - 43
src/main/java/com/its/rota/server/entity/TbInt.java

@@ -1,43 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbInt implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;    /* 지역 코드 */
-    private int intLcNo;        /* 경기도 교차로 번호 */
-    private int intNo;          /* 교차로번호 */
-    private String intNm;       /* 교차로 명칭 */
-    private int intType;        /* 교차로유형(0:주교차로, 1:연등교차로) */
-    private int intLcType;      /* 제어기유형(1:2004년형, 2:2010년형) */
-    private int intLampType;    /* 등화기유형(3:3색등화기, 4:4색등화기) */
-    private int mainIntNo;      /* 교차로유형이 연등교차로인 경우 주교차로 번호 */
-    private int groupNo;        /* 그룹번호 */
-    private long nodeId;        /* Node ID */
-
-    public IntDto toDto() {
-        return IntDto.builder()
-                .intLcNo(this.intLcNo)
-                .regionCd(this.regionCd)
-                .intNo(this.intNo)
-                .intNm(this.intNm)
-                .intType(this.intType)
-                .intLcType(this.intLcType)
-                .intLampType(this.intLampType)
-                .mainIntNo(this.mainIntNo)
-                .groupNo(this.groupNo)
-                .nodeId(this.nodeId)
-                .status(new IntStatusDto(this.regionCd, this.intNo))
-                .build();
-    }
-}

+ 0 - 25
src/main/java/com/its/rota/server/entity/TbIntUnknown.java

@@ -1,25 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbIntUnknown implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;    /* 지역 코드 */
-    private int intNo;          /* 교차로번호 */
-    private String intNm;       /* 그룹번호 */
-
-    private int pNum;
-    private int iNum;
-    private int oNum;
-
-}

+ 0 - 60
src/main/java/com/its/rota/server/entity/TbRegionCenter.java

@@ -1,60 +0,0 @@
-package com.its.rota.server.entity;
-
-import io.netty.channel.Channel;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbRegionCenter implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;        /* 지역 코드 */
-    private String regionNm;        /* 지역 명 */
-    private String ipAddress;       /* IP Address */
-    private String loginId;         /* 지역센터 아이디 */
-    private String loginPswd;       /* 지역센터 비밀번호 */
-    private String fileUpdDt;       /* 파일 수정일자 */
-    private String simulateFlag;    /* 시뮬레이터 여부 */
-    private int regionId;           /* 지역 ID */
-
-    private String extYn;           /* 민간 연계여부(N;연계안함,Y:연계) */
-    private String realtimeYn;      /* 실시간정보 연계여부(N;연계안함,Y:연계) */
-    private String dbaseYn;         /* TOD기반정보 연계여부(N;연계안함,Y:연계) */
-    private String commHistYn;      /* TB_COMM_HIST 저장여부(N;저장안함,Y:저장) */
-
-    private int minIntNo;
-    private int maxIntNo;
-    private int intCount;
-    private Channel channel = null;
-    private Channel dupChannel = null;
-    private int  netState;
-    public RegionCenter toDto() {
-        return RegionCenter.builder()
-                .regionCd(this.regionCd.trim())
-                .regionNm(this.regionNm.trim())
-                .ipAddress(this.ipAddress.trim())
-                .loginId(this.loginId.trim())
-                .loginPswd(this.loginPswd.trim())
-                .fileUpdDt(this.fileUpdDt.trim())
-                .simulateFlag(this.simulateFlag.trim())
-                .regionId(this.regionId)
-                .ggitsRegionNo(0)
-                .extYn(this.extYn)
-                .realtimeYn(this.realtimeYn)
-                .dbaseYn(this.dbaseYn)
-                .commHistYn(this.commHistYn)
-                .minIntNo(this.minIntNo)
-                .maxIntNo(this.maxIntNo)
-                .intCount(this.intCount)
-                .qSeq(0)
-                .recvSeqNo(0)
-                .build();
-    }
-}

+ 0 - 22
src/main/java/com/its/rota/server/entity/TbRegionCenterComm.java

@@ -1,22 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbRegionCenterComm implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    public static final String CENTER_COMM_START = "0";
-    public static final String CENTER_COMM_STOP = "1";
-
-    private String regionCd;        /* 지역 센터 코드 */
-    private String commState;       /* 통신상태(0:정상, 1:종료, 2:오류발생) */
-}

+ 0 - 28
src/main/java/com/its/rota/server/entity/TbRegionGgits.java

@@ -1,28 +0,0 @@
-package com.its.rota.server.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-
-@Data
-@Builder
-@NoArgsConstructor//(access = AccessLevel.PROTECTED)
-@AllArgsConstructor
-public class TbRegionGgits implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String regionCd;        /* 지역 코드 */
-    private Integer ggitsRegionNo;  /* 경기도 지역 번호 */
-    private Integer regionId;       /* 지역 아이디 */
-
-    public RegionGgits toDto() {
-        return RegionGgits.builder()
-                .regionCd(this.regionCd.trim())
-                .ggitsRegionNo(this.ggitsRegionNo)
-                .regionId(regionId)
-                .build();
-    }
-}

+ 26 - 0
src/main/java/com/its/rota/server/entity/TbSndIncident.java

@@ -0,0 +1,26 @@
+package com.its.rota.server.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@Builder
+@NoArgsConstructor//(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+public class TbSndIncident {
+
+    private String linkId;
+    private String nodeId;
+    private String contactOrganizationNameText;
+    private int descriptionTypeIncidentCode;
+    private String descriptionTypeIncidentOther;
+    private int incidentVehiclesInvolvedCode;
+    private String incidentVehiclesInvolvedOther;
+    private int incidentStatusCode;
+    private String incidentStatusOther;
+    private int updateTypeCode;
+    private String updateTypeOther;
+
+}

+ 3 - 2
src/main/java/com/its/rota/server/process/dbms/DbmsData.java

@@ -1,5 +1,6 @@
 package com.its.rota.server.process.dbms;
 
+import com.its.rota.server.dto.CenterDto;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -7,7 +8,7 @@ import lombok.Setter;
 @Setter
 public class DbmsData {
 
-    private RegionCenter center;
+    private CenterDto center;
     private int          qIdx;
     private long         timestamp;
     private long         popTimestamp;
@@ -18,7 +19,7 @@ public class DbmsData {
     private boolean      isHistory;
     private Object       data;
 
-    public DbmsData(RegionCenter center, int qIdx, long timestamp, long popTimestamp, long parseTimestamp, String regionCd, int regionId, DbmsDataType type, boolean isHistory, Object data) {
+    public DbmsData(CenterDto center, int qIdx, long timestamp, long popTimestamp, long parseTimestamp, String regionCd, int regionId, DbmsDataType type, boolean isHistory, Object data) {
         this.center = center;
         this.qIdx = qIdx;
         this.timestamp = timestamp;

+ 43 - 47
src/main/java/com/its/rota/server/process/dbms/DbmsDataProcess.java

@@ -3,15 +3,12 @@ package com.its.rota.server.process.dbms;
 import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.config.ThreadPoolInitializer;
 import com.its.rota.server.dao.mapper.ProcessMapper;
-import com.its.rota.server.dao.mapper.RegionCenterMapper;
-import com.its.rota.server.dao.mapper.batch.SigIntDao;
+import com.its.rota.server.dao.mapper.batch.ItsRotaDao;
 import com.its.rota.server.entity.TbProcessState;
-import com.its.rota.server.entity.TbRegionCenterComm;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
 import java.util.concurrent.Executors;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
@@ -26,8 +23,7 @@ public class DbmsDataProcess {
 
     private final DbmsDataAsyncTask asyncTask;
     private final ProcessMapper processMapper;
-    private final RegionCenterMapper centerMapper;
-    private final SigIntDao sigIntDao;
+    private final ItsRotaDao itsRotaDao;
 
     private int maxCore = Runtime.getRuntime().availableProcessors();
 
@@ -82,47 +78,47 @@ public class DbmsDataProcess {
     public void process(DbmsData data) {
         int cnt = 0;
         long start = System.currentTimeMillis();
-        try {
-            DbmsDataType type = data.getType();
-            switch(type) {
-                case DBMS_DATA_INT_STATUS_UPDATE:
-                    RegionCenter center = data.getCenter();
-                    if (center == null) {
-                        log.error("RegionCenter is null");
-                        return;
-                    }
-                    List<IntStatusDto> intStatusLists = (List<IntStatusDto>)data.getData();
-                    cnt = this.sigIntDao.updateStatus(intStatusLists);
-                    log.info("INT_STATUS_UPDATE: [{}, {}], {}",
-                            data.getRegionCd(), data.getRegionId(),
-                            String.format("%4d/%4d EA. Pop(%5d)/Parsing(%5d)/Dbms(%5d)/Total(%5d) ms.",
-                                    intStatusLists.size(), cnt,
-                                    data.getPopTimestamp(), data.getParsingTimestamp(),
-                                    System.currentTimeMillis() - start,
-                                    System.currentTimeMillis() - data.getTimestamp()));
-
-                    intStatusLists.clear();
-                    break;
-                case DBMS_DATA_CENTER_STTS:
-                    TbRegionCenterComm stts = (TbRegionCenterComm) data.getData();
-                    if (TbRegionCenterComm.CENTER_COMM_START.equals(stts.getCommState())) {
-                        this.centerMapper.updateCommStateConnect(stts);
-                    }
-                    else if (TbRegionCenterComm.CENTER_COMM_STOP.equals(stts.getCommState())) {
-                        this.centerMapper.updateCommStateDisconnect(stts);
-                    }
-                    else {
-                        this.centerMapper.updateCommState(stts);
-                    }
-                    stts = null;
-                    break;
-                default:
-                    log.error("DbmsDataProcess.process: Unknown Request {}.", type);
-                    break;
-            }
-        } catch (Exception e) {
-            log.error("DbmsDataProcess.process: Exception: {}", e.toString());
-        }
+//        try {
+//            DbmsDataType type = data.getType();
+//            switch(type) {
+//                case DBMS_DATA_INT_STATUS_UPDATE:
+//                    RegionCenter center = data.getCenter();
+//                    if (center == null) {
+//                        log.error("RegionCenter is null");
+//                        return;
+//                    }
+//                    List<IntStatusDto> intStatusLists = (List<IntStatusDto>)data.getData();
+//                    cnt = this.sigIntDao.updateStatus(intStatusLists);
+//                    log.info("INT_STATUS_UPDATE: [{}, {}], {}",
+//                            data.getRegionCd(), data.getRegionId(),
+//                            String.format("%4d/%4d EA. Pop(%5d)/Parsing(%5d)/Dbms(%5d)/Total(%5d) ms.",
+//                                    intStatusLists.size(), cnt,
+//                                    data.getPopTimestamp(), data.getParsingTimestamp(),
+//                                    System.currentTimeMillis() - start,
+//                                    System.currentTimeMillis() - data.getTimestamp()));
+//
+//                    intStatusLists.clear();
+//                    break;
+//                case DBMS_DATA_CENTER_STTS:
+//                    TbRegionCenterComm stts = (TbRegionCenterComm) data.getData();
+//                    if (TbRegionCenterComm.CENTER_COMM_START.equals(stts.getCommState())) {
+//                        this.centerMapper.updateCommStateConnect(stts);
+//                    }
+//                    else if (TbRegionCenterComm.CENTER_COMM_STOP.equals(stts.getCommState())) {
+//                        this.centerMapper.updateCommStateDisconnect(stts);
+//                    }
+//                    else {
+//                        this.centerMapper.updateCommState(stts);
+//                    }
+//                    stts = null;
+//                    break;
+//                default:
+//                    log.error("DbmsDataProcess.process: Unknown Request {}.", type);
+//                    break;
+//            }
+//        } catch (Exception e) {
+//            log.error("DbmsDataProcess.process: Exception: {}", e.toString());
+//        }
     }
 
     /*

+ 3 - 2
src/main/java/com/its/rota/server/process/work/GgitsPacketProcess.java → src/main/java/com/its/rota/server/process/work/DataPacketProcess.java

@@ -1,6 +1,7 @@
 package com.its.rota.server.process.work;
 
 import com.its.rota.server.config.ApplicationConfig;
+import com.its.rota.server.dto.SigGgitsTsinfoDto;
 import com.its.rota.server.process.AbstractAppProcess;
 import com.its.rota.server.process.AbstractAppWorker;
 import com.its.rota.server.process.dbms.DbmsDataProcess;
@@ -17,7 +18,7 @@ import javax.annotation.PostConstruct;
 @Getter
 @AllArgsConstructor
 @Service
-public class GgitsPacketProcess extends AbstractAppProcess {
+public class DataPacketProcess extends AbstractAppProcess {
 
     private final ApplicationConfig config;
     private final DbmsDataProcess dbmsDataProcess;
@@ -56,7 +57,7 @@ public class GgitsPacketProcess extends AbstractAppProcess {
         qSize *= 4;
         qSize /= this.workers;
         for (int ii = 0; ii < this.workers; ii++) {
-            GgitsPacketWorker packetWorker = new GgitsPacketWorker(ii, qSize, this.repo, this.dbmsDataProcess);
+            DataPacketWorker packetWorker = new DataPacketWorker(ii, qSize, this.repo, this.dbmsDataProcess);
             this.workerList.add(packetWorker);
             Thread worker = new Thread(workerGroup, packetWorker);
             worker.setName(String.format("PacketWorker-%03d.%03d", this.workers, ii+1));

+ 3 - 2
src/main/java/com/its/rota/server/process/work/GgitsPacketWorker.java → src/main/java/com/its/rota/server/process/work/DataPacketWorker.java

@@ -1,6 +1,7 @@
 package com.its.rota.server.process.work;
 
 import com.its.app.common.utils.Elapsed;
+import com.its.rota.server.dto.SigGgitsTsinfoDto;
 import com.its.rota.server.process.AbstractAppWorker;
 import com.its.rota.server.process.dbms.DbmsDataProcess;
 import com.its.rota.server.repository.ApplicationRepository;
@@ -10,14 +11,14 @@ import org.slf4j.MDC;
 import java.util.concurrent.LinkedBlockingQueue;
 
 @Slf4j
-public class GgitsPacketWorker extends AbstractAppWorker implements Runnable {
+public class DataPacketWorker extends AbstractAppWorker implements Runnable {
 
     private final ApplicationRepository repo;
     private final DbmsDataProcess dbmsDataProcess;
 
     private final LinkedBlockingQueue<SigGgitsTsinfoDto> DATA_QUEUE;
 
-    public GgitsPacketWorker(int idx, int qSize, ApplicationRepository repo, DbmsDataProcess dbmsDataProcess) {
+    public DataPacketWorker(int idx, int qSize, ApplicationRepository repo, DbmsDataProcess dbmsDataProcess) {
         this.idx = idx;
         this.qSize = qSize;
         this.repo = repo;

+ 23 - 29
src/main/java/com/its/rota/server/scheduler/ApplicationScheduler.java

@@ -1,7 +1,8 @@
 package com.its.rota.server.scheduler;
 
 import com.its.app.common.utils.Elapsed;
-import com.its.rota.server.service.DeleteService;
+import com.its.rota.server.service.ItsRotaServerService;
+import com.its.rota.server.service.UnitSystService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
@@ -17,47 +18,40 @@ import javax.annotation.PreDestroy;
 @Component
 public class ApplicationScheduler {
 
-    private final DeleteService deleteService;
+    private final UnitSystService unitSystService;
+    private final ItsRotaServerService itsRotaServerService;
 
     @PreDestroy
     public void onShutDown() {
     }
     // 초(0-59) 분(0-59) 시간(0-23) 일(1-31) 월(1-12) 요일(0-6) (0: 일, 1: 월, 2:화, 3:수, 4:목, 5:금, 6:토)
 
-    @Async
-    @Scheduled(cron = "0/5 * * * * *")  // 5초 주기 작업 실행
-    public void checkSessionTimeout() {
-//        if (!TsiAlarmManager.getInstance().checkAlarm(TsiAlarmConfigVo.COMM_02)) {
-//            return;
-//        }
-//        Elapsed elapsed = new Elapsed();
-//        long timeout = 0;
-//        TsiAlarmConfigVo vo = TsiAlarmManager.getInstance().get(TsiAlarmConfigVo.COMM_02);
-//        if (vo == null) return; // 이거면 안됌.
-//        timeout = vo.getValue() * 1000;
-//        if (timeout <= 0) {
-//            log.error("checkSessionTimeout: timeout value error: {}", timeout);
-//            return;
-//        }
-//        TsiNodeManager.getInstance().checkSessionTimeout(timeout);
-//        log.info("{}", String.format("%25s: %s", "checkSessionTimeout", Elapsed.elapsedTimeStr(elapsed.nanoSeconds())));
-    }
-
     @Async
     @Scheduled(cron = "0 * * * * *")  // 1분 주기 작업 실행
-    public void staticsForPacketMinute() {
+    public void unitSystSchedule() {
         Elapsed elapsed = new Elapsed();
-        //TsiTpmsManager.getInstance().resetMinute();
-        //log.info("{}", String.format("%25s: %s", "staticsForPacketMinute", Elapsed.elapsedTimeStr(elapsed.nanoSeconds())));
+        log.info("{}", String.format("%20s: START.", "unitSystSchedule"));
+        try {
+            this.unitSystService.updateUnitSystStts(true);
+            log.info("{}: {}", String.format("%20s", "unitSystSchedule"), Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
+        }
+        catch(Exception e) {
+            log.error("{}: {}", String.format("%20s", "unitSystSchedule"), e.getMessage());
+        }
     }
 
     @Async
-    @Scheduled(cron = "0/40 3 * * * *")  // 1시간 주기 작업 실행
-    public void deleteJobOnHour() {
+    @Scheduled(cron = "0/10 * * * * *")  // 10초 주기 작업 실행
+    public void itsRotaServerService() {
         Elapsed elapsed = new Elapsed();
-        this.deleteService.deleteJobOnHour();
-        log.info("{}", String.format("%25s: %s", "deleteJobOnHour", Elapsed.elapsedTimeStr(elapsed.nanoSeconds())));
+        log.info("{}", String.format("%20s: START.", "itsRotaServerService"));
+        try {
+            int result = this.itsRotaServerService.run();
+            log.info("{}: result: {}, {}", String.format("%20s", "itsRotaServerService"), result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
+        }
+        catch(Exception e) {
+            log.error("{}: {}", String.format("%20s", "itsRotaServerService"), e.getMessage());
+        }
     }
 
-
 }

+ 0 - 62
src/main/java/com/its/rota/server/service/DeleteService.java

@@ -1,62 +0,0 @@
-package com.its.rota.server.service;
-
-import com.its.app.common.utils.Elapsed;
-import com.its.app.common.utils.TimeUtils;
-import com.its.rota.server.dao.mapper.DeleteMapper;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.PostConstruct;
-
-@Slf4j
-@Service
-@RequiredArgsConstructor
-public class DeleteService {
-
-//    private final DbmsDataProcess dbmsDataProcess;
-    private final DeleteMapper mapper;
-
-    @PostConstruct
-    private void init() {
-        log.info("DeleteService.init: start.");
-        log.info("DeleteService.init: ..end.");
-    }
-
-    public void deleteJobOnHour() {
-        log.info("DeleteService.deleteJobOnHour: START.");
-        Elapsed elapsed = new Elapsed();
-        deleteRcvLinkTraffic();        
-        deleteSndIncident();
-        deleteRcvLog();
-        deleteSndLog();
-        deleteRcvIncident();
-        log.info("DeleteService.deleteJobOnHour: END... {} ms.", Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-    }
-    public void deleteRcvLinkTraffic() {
-        Elapsed elapsed = new Elapsed();
-        int result = this.mapper.deleteRcvLinkTraffic();
-        log.info("DeleteService.deleteJobOnHour: TB_RCV_LINK_TRAFFIC. {} EA, {} ms.", result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-    }
-    public void deleteSndIncident() {
-        Elapsed elapsed = new Elapsed();
-        int result = this.mapper.deleteSndIncident();
-        log.info("DeleteService.deleteJobOnHour: ----TB_SND_INCIDENT. {} EA, {} ms.", result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-    }
-    public void deleteRcvLog() {
-        Elapsed elapsed = new Elapsed();
-        int result = this.mapper.deleteRcvLog();
-        log.info("DeleteService.deleteJobOnHour: ---------TB_RCV_LOG. {} EA, {} ms.", result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-    }
-
-    public void deleteSndLog() {
-        Elapsed elapsed = new Elapsed();
-        int result = this.mapper.deleteSndLog();
-        log.info("DeleteService.deleteJobOnHour: ---------TB_SND_LOG. {} EA, {} ms.", result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-    }
-    public void deleteRcvIncident() {
-        Elapsed elapsed = new Elapsed();
-        int result = this.mapper.deleteRcvIncident();
-        log.info("DeleteService.deleteJobOnHour: ----TB_RCV_INCIDENT. {} EA, {} ms.", result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-    }
-}

+ 33 - 0
src/main/java/com/its/rota/server/service/IncidentService.java

@@ -0,0 +1,33 @@
+package com.its.rota.server.service;
+
+import com.its.rota.server.dao.mapper.IncidentMapper;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+@Slf4j
+@Getter
+@Service
+@RequiredArgsConstructor
+@Transactional(rollbackFor = {Exception.class})
+public class IncidentService {
+
+    private final IncidentMapper mapper;
+
+    @PostConstruct
+    private void init() {
+        log.info("IncidentService.init: start.");
+        log.info("IncidentService.init: ..end.");
+    }
+
+    @PreDestroy
+    public void destroyService() {
+        log.error("IncidentService.destroy. system terminated.......");
+    }
+
+}

+ 45 - 0
src/main/java/com/its/rota/server/service/ItsRotaServerService.java

@@ -0,0 +1,45 @@
+package com.its.rota.server.service;
+
+import com.its.rota.server.dao.mapper.IncidentMapper;
+import com.its.rota.server.dao.mapper.TrafficMapper;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+@Slf4j
+@Getter
+@Service
+@RequiredArgsConstructor
+@Transactional(rollbackFor = {Exception.class})
+public class ItsRotaServerService {
+
+    private final IncidentMapper incidentMapper;
+    private final TrafficMapper mapper;
+    private boolean isRunning = false;
+
+    @PostConstruct
+    private void init() {
+        log.info("ItsRotaServerService.init: start.");
+        log.info("ItsRotaServerService.init: ..end.");
+    }
+
+    @PreDestroy
+    public void destroyService() {
+        log.error("ItsRotaServerService.destroy. system terminated.......");
+    }
+
+    public int run() {
+        if (this.isRunning) {
+            log.warn("ItsRotaServerService.run: Already running");
+            return 1;
+        }
+        this.isRunning = true;
+        return 0;
+    }
+
+}

+ 33 - 0
src/main/java/com/its/rota/server/service/TrafficService.java

@@ -0,0 +1,33 @@
+package com.its.rota.server.service;
+
+import com.its.rota.server.dao.mapper.TrafficMapper;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+@Slf4j
+@Getter
+@Service
+@RequiredArgsConstructor
+@Transactional(rollbackFor = {Exception.class})
+public class TrafficService {
+
+    private final TrafficMapper mapper;
+
+    @PostConstruct
+    private void init() {
+        log.info("TrafficService.init: start.");
+        log.info("TrafficService.init: ..end.");
+    }
+
+    @PreDestroy
+    public void destroyService() {
+        log.error("TrafficService.destroy. system terminated.......");
+    }
+
+}

+ 14 - 16
src/main/java/com/its/rota/server/service/UnitSystService.java

@@ -4,8 +4,6 @@ import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dao.mapper.ProcessMapper;
 import com.its.rota.server.entity.TbProcessState;
-import com.its.rota.server.process.dbms.DbmsData;
-import com.its.rota.server.process.dbms.DbmsDataType;
 import com.its.rota.server.process.dbms.DbmsDataProcess;
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
@@ -50,20 +48,20 @@ public class UnitSystService {
         String keyData = "unit";
         MDC.put("id", keyData);
 
-        String SYST_STTS_CD = isRun ? TbProcessState.PROCESS_START : TbProcessState.PROCESS_STOP;
-        this.unitSystStts.setProcessId(this.processId);
-        this.unitSystStts.setRunState(SYST_STTS_CD);
-
-        if (!isRun) {
-           this.mapper.updateProcessStateStop(this.unitSystStts);
-        }
-        else {
-            TbProcessState processState = TbProcessState.builder()
-                    .processId(this.processId)
-                    .runState("1")
-                    .build();
-            this.dbmsDataProcess.add(new DbmsData(null, 0, System.currentTimeMillis(), System.currentTimeMillis(), System.currentTimeMillis(), "L00", 1, DbmsDataType.DBMS_DATA_PROCESS_STTS, false, processState));
-        }
+//        String SYST_STTS_CD = isRun ? TbProcessState.PROCESS_START : TbProcessState.PROCESS_STOP;
+//        this.unitSystStts.setProcessId(this.processId);
+//        this.unitSystStts.setRunState(SYST_STTS_CD);
+//
+//        if (!isRun) {
+//           this.mapper.updateProcessStateStop(this.unitSystStts);
+//        }
+//        else {
+//            TbProcessState processState = TbProcessState.builder()
+//                    .processId(this.processId)
+//                    .runState("1")
+//                    .build();
+//            this.dbmsDataProcess.add(new DbmsData(null, 0, System.currentTimeMillis(), System.currentTimeMillis(), System.currentTimeMillis(), "L00", 1, DbmsDataType.DBMS_DATA_PROCESS_STTS, false, processState));
+//        }
         MDC.remove(keyData);
         MDC.clear();
     }

+ 5 - 5
src/main/java/com/its/rota/server/xnet/server/ItsAsnCommServerInitializer.java

@@ -34,11 +34,11 @@ public class ItsAsnCommServerInitializer extends ChannelInitializer<Channel> {
 
         ChannelPipeline pipeline = channel.pipeline();
         //pipeline.addLast(new LoggingHandler(LogLevel.INFO));
-        pipeline.addLast("dsrcAsn1ServerConnectionIdleStateHandler", idleStateHandler);
-        pipeline.addLast("dsrcAsn1ServerConnectionHandler", connectionHandler);
-        pipeline.addLast("dsrcAsn1ServerDecoder", new ItsAsnServerDecoder(this.config));  // Decoding handler
-        pipeline.addLast("dsrcAsn1ServerPacketInboundHandler", this.itsAsnServerPacketInboundHandler); // packet distribute handler add
-        pipeline.addLast("dsrcAsn1ServerEncoder", this.itsAsnServerEncoder);  // Encoding handler
+        pipeline.addLast("itsAsnServerConnectionIdleStateHandler", idleStateHandler);
+        pipeline.addLast("itsAsnServerConnectionHandler", connectionHandler);
+        pipeline.addLast("itsAsnServerDecoder", new ItsAsnServerDecoder(this.config));  // Decoding handler
+        pipeline.addLast("itsAsnServerPacketInboundHandler", this.itsAsnServerPacketInboundHandler); // packet distribute handler add
+        pipeline.addLast("itsAsnServerEncoder", this.itsAsnServerEncoder);  // Encoding handler
     }
 
 }

+ 23 - 25
src/main/java/com/its/rota/server/xnet/server/codec/ItsAsnServerEncoder.java

@@ -2,16 +2,13 @@ package com.its.rota.server.xnet.server.codec;
 
 import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
 import com.beanit.asn1bean.ber.types.BerEnum;
-import com.beanit.asn1bean.ber.types.BerOctetString;
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.dsrc.DatexDataPacket;
-import com.beanit.asn1dsrc.util.DsrcAsn1Crc16;
-import com.its.app.utils.NettyUtils;
-import com.its.app.utils.SysUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.global.AppRepository;
-import com.its.dsrc.xnettcp.dsrc.handler.DsrcAsn1ServerIdleStatePacketHandler;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.DatexDataPacket;
+import com.its.app.common.utils.NettyUtils;
+import com.its.rota.server.config.ApplicationConfig;
+import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.repository.ApplicationRepository;
+import com.its.rota.server.xnet.server.handler.ItsAsnServerIdleStatePacketHandler;
 import io.netty.buffer.ByteBuf;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandler;
@@ -28,17 +25,18 @@ import org.springframework.stereotype.Component;
 @ChannelHandler.Sharable
 public class ItsAsnServerEncoder extends MessageToByteEncoder<Object> {
 
-    private final RunningConfig runningConfig;
+    private final ApplicationConfig config;
+    private final ApplicationRepository repo;
 
      @Override
     protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf byteBuf) throws Exception {
 
         String ipAddress = NettyUtils.getRemoteIpAddress(ctx.channel());
         Channel channel = ctx.channel();
-        TbRseCtlr obj = AppRepository.getInstance().getCtlrIpMap().get(ipAddress);
+        CenterDto obj = this.repo.getIpAddressMap().get(ipAddress);
         if (obj == null) {
             log.error("DsrcTcpServerEncoder.encode: Unknown Controller IP: {}. will be close.", ipAddress);
-            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(null, channel);
+            ItsAsnServerIdleStatePacketHandler.disconnectChannel(null, channel);
             return;
         }
 
@@ -46,19 +44,19 @@ public class ItsAsnServerEncoder extends MessageToByteEncoder<Object> {
 
         if (obj.getChannel() != null && (channel != obj.getChannel())) {
             log.error("DsrcTcpServerEncoder.encode: {}, channel error, curr: {}, old: {}", ipAddress, channel.toString(), obj.getChannel().toString());
-            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(obj, channel);
+            ItsAsnServerIdleStatePacketHandler.disconnectChannel(obj, channel);
             return;
         }
 
         if (!channel.isOpen() || !channel.isActive()) {
             log.error("DsrcTcpServerEncoder.encode: {}, isOpen: {}, isActive: {}. [{}]", ipAddress, channel.isOpen(), channel.isActive(), obj.getLogKey());
-            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(obj, channel);
+            ItsAsnServerIdleStatePacketHandler.disconnectChannel(obj, channel);
             return;
         }
 
         if (!(msg instanceof C2CAuthenticatedMessage)) {
             log.error("DsrcTcpServerEncoder.encode: {}, msg is not ByteBuffer. [{}]", ipAddress, obj.getLogKey());
-            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(obj, channel);
+            ItsAsnServerIdleStatePacketHandler.disconnectChannel(obj, channel);
             return;
         }
 
@@ -70,25 +68,25 @@ public class ItsAsnServerEncoder extends MessageToByteEncoder<Object> {
             if (length > 0) {
                 DatexDataPacket dataPkt = new DatexDataPacket();
                 dataPkt.setDatexVersionNumber(new BerEnum(1));  // version == 1
-                dataPkt.setDatexData(new BerOctetString(c2cBuff.getArray()));
-                dataPkt.setDatexCrcNbr(new BerOctetString(DsrcAsn1Crc16.getCrc16ToByteArray(c2cBuff.getArray())));  // crc
+//                dataPkt.setDatexData(new BerOctetString(c2cBuff.getArray()));
+                //dataPkt.setDatexCrcNbr(new BerOctetString(DsrcAsn1Crc16.getCrc16ToByteArray(c2cBuff.getArray())));  // crc
 
                 int encodeLength = dataPkt.encode(pktBuff);
                 byteBuf.writeBytes(pktBuff.getArray());
                 //log.info("SEND: Encoder: {}. ASN1 PACKET: {} Bytes, encodeLength: {} Bytes", ipAddress, length, encodeLength);
                 //log.info("SEND: Encoder: {}, C2CAuth: {}", ipAddress, c2c);
-                if (this.runningConfig.isDumpSend()) {
-                    byte[] debugBytes = new byte[byteBuf.readableBytes()];
-                    byteBuf.getBytes(byteBuf.readerIndex(), debugBytes);
-                    log.info("SEND: [{}], {} Bytes. {}", ipAddress, debugBytes.length, SysUtils.byteArrayToHex(debugBytes));
-                }
+//                if (this.config.isC()) {
+//                    byte[] debugBytes = new byte[byteBuf.readableBytes()];
+//                    byteBuf.getBytes(byteBuf.readerIndex(), debugBytes);
+//                    log.info("SEND: [{}], {} Bytes. {}", ipAddress, debugBytes.length, SysUtils.byteArrayToHex(debugBytes));
+//                }
             } else {
                 log.error("SEND: {}. C2CAuthenticatedMessage encode buffer length zero: will be closed.", ipAddress);
-                DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(obj, channel);
+                ItsAsnServerIdleStatePacketHandler.disconnectChannel(obj, channel);
             }
         } catch (Exception e) {
             log.error("DsrcTcpServerEncoder.encode: SEND: {}. Exception Error: will be closed: {}. [{}]", ipAddress, e.toString(), obj.getLogKey());
-            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(obj, channel);
+            ItsAsnServerIdleStatePacketHandler.disconnectChannel(obj, channel);
         }
         //MDC.remove(obj.getLogKey());
         //MDC.clear();

+ 1 - 2
src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerIdleStateConnectionHandler.java

@@ -1,7 +1,6 @@
 package com.its.rota.server.xnet.server.handler;
 
 import com.its.app.common.utils.NettyUtils;
-import com.its.app.common.utils.SysUtils;
 import com.its.rota.server.dto.CenterDto;
 import com.its.rota.server.repository.ApplicationRepository;
 import io.netty.channel.Channel;
@@ -162,7 +161,7 @@ public class ItsAsnServerIdleStateConnectionHandler extends ChannelDuplexHandler
     public static void disconnectChannel(Channel channel) {
         // 로그인 하지 않은 또는 비정상 접속 네트워크 세션 종료(로그인 처리를 수행하지 않은 세션에 대한 종료)
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
-        CenterDto obj = this.repo.getIpAddressMap().get(ipAddress);
+        CenterDto obj = null;//this.repo.getIpAddressMap().get(ipAddress);
         if (obj != null) {
             MDC.put("id", obj.getLogKey());
         }

+ 34 - 36
src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerIdleStatePacketHandler.java

@@ -1,17 +1,13 @@
 package com.its.rota.server.xnet.server.handler;
 
-import com.beanit.asn1dsrc.enums.eTerminate;
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.app.utils.SysUtils;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseCtlrCnncHs;
-import com.its.dsrc.global.AppRepository;
-import com.its.dsrc.process.DbmsData;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.process.DbmsDataType;
-import com.its.dsrc.xnettcp.dsrc.process.service.ControlDeviceService;
+import com.its.app.common.utils.NettyUtils;
+import com.its.app.common.utils.SysUtils;
+import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.process.dbms.DbmsData;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
+import com.its.rota.server.repository.ApplicationRepository;
+import com.its.rota.server.xnet.server.process.service.ControlDeviceService;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
@@ -26,11 +22,13 @@ import java.util.concurrent.TimeUnit;
 @Slf4j
 public class ItsAsnServerIdleStatePacketHandler extends IdleStateHandler {
 
+    private ApplicationRepository repo;
     private DbmsDataProcess dbmsDataProcess;
 
     public ItsAsnServerIdleStatePacketHandler(long readerIdleTime, long writerIdleTime, long allIdleTime, TimeUnit unit) {
         super(readerIdleTime, writerIdleTime, allIdleTime, unit);
-        this.dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+        this.dbmsDataProcess = SpringUtils.getBean(DbmsDataProcess.class);
+        this.repo = SpringUtils.getBean(ApplicationRepository.class);
     }
 
     @Override
@@ -41,7 +39,7 @@ public class ItsAsnServerIdleStatePacketHandler extends IdleStateHandler {
     @Override
     protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) throws Exception {
         String ipAddress = NettyUtils.getRemoteIpAddress(ctx.channel());
-        TbRseCtlr obj = AppRepository.getInstance().getCtlrIpMap().get(ipAddress);
+        CenterDto obj = this.repo.getIpAddressMap().get(ipAddress);
         if (obj == null) {
             log.error("DsrcAsn1ServerIdleStatePacketHandler.-------channelIdle: ALL_IDLE, {}, Unknown ip address, will be closed.", ipAddress);
             ItsAsnServerIdleStatePacketHandler.disconnectChannel(null, ctx.channel());
@@ -53,7 +51,7 @@ public class ItsAsnServerIdleStatePacketHandler extends IdleStateHandler {
         if (evt.state() == IdleState.ALL_IDLE) {
             log.error("DsrcAsn1ServerIdleStatePacketHandler.-------channelIdle: ALL_IDLE, {}, ID: {}, {}, {}", ipAddress, obj.getID(), obj.getRSE_ID(), ctx.channel().toString());
             // 클라이언트로 종료 메시지를 전송한다.(AI_Terminate)
-            ControlDeviceService.getInstance().sendTerminate(obj, ctx.channel(), eTerminate.Terminate_ClientCommProblesm.getValue());
+//           ControlDeviceService.getInstance().sendTerminate(obj, ctx.channel(), eTerminate.Terminate_ClientCommProblesm.getValue());
             ItsAsnServerIdleStatePacketHandler.disconnectChannel(obj, ctx.channel());
         }
         else if (evt.state() == IdleState.READER_IDLE) {
@@ -69,7 +67,7 @@ public class ItsAsnServerIdleStatePacketHandler extends IdleStateHandler {
     @Override
     public void channelInactive(ChannelHandlerContext ctx) throws Exception {
         String ipAddress = NettyUtils.getRemoteIpAddress(ctx.channel());
-        TbRseCtlr obj = AppRepository.getInstance().getCtlrIpMap().get(ipAddress);
+        CenterDto obj = this.repo.getIpAddressMap().get(ipAddress);
         if (obj != null) {
             MDC.put("id", obj.getLogKey());
         }
@@ -80,26 +78,26 @@ public class ItsAsnServerIdleStatePacketHandler extends IdleStateHandler {
 
             oldChannel = obj.getChannel();
 
-            if (!obj.isDupCon()) {
-                // Duplication connection 인 경우 다른 채널이 통신을 대신하므로
-                // 네트워크 상태를 변경시키지 않기 위함.
-                obj.channelLogout();
-
-                String logId = obj.getLOG_ID();
-                if (logId == null || logId.equals("")) {
-                    logId = "Unknown";
-                }
-                TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
-                voLog.setRSE_CTLR_NMBR(obj.getID());
-                voLog.setLOG_ID(logId);
-                voLog.setLOG_ADDRESS(NettyUtils.getRemoteIpAddress(ctx.channel()));
-                voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_LOGOUT));
-                voLog.setCLCT_DT(SysUtils.getSysTime());
-
-                log.debug("DsrcAsn1ServerIdleStatePacketHandler.---channelInactive: {}. {}", ipAddress, voLog.toString());
-                this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS, false, voLog));
-            }
-            obj.setDupCon(false);
+//            if (!obj.isDupCon()) {
+//                // Duplication connection 인 경우 다른 채널이 통신을 대신하므로
+//                // 네트워크 상태를 변경시키지 않기 위함.
+//                obj.channelLogout();
+//
+//                String logId = obj.getLOG_ID();
+//                if (logId == null || logId.equals("")) {
+//                    logId = "Unknown";
+//                }
+//                TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
+//                voLog.setRSE_CTLR_NMBR(obj.getID());
+//                voLog.setLOG_ID(logId);
+//                voLog.setLOG_ADDRESS(NettyUtils.getRemoteIpAddress(ctx.channel()));
+//                voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_LOGOUT));
+//                voLog.setCLCT_DT(SysUtils.getSysTime());
+//
+//                log.debug("DsrcAsn1ServerIdleStatePacketHandler.---channelInactive: {}. {}", ipAddress, voLog.toString());
+//                this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS, false, voLog));
+//            }
+//            obj.setDupCon(false);
         }
         super.channelInactive(ctx);
         try {
@@ -151,7 +149,7 @@ public class ItsAsnServerIdleStatePacketHandler extends IdleStateHandler {
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
         String ipAddress = NettyUtils.getRemoteIpAddress(ctx.channel());
-        TbRseCtlr obj = AppRepository.getInstance().getCtlrIpMap().get(ipAddress);
+        CenterDto obj = this.repo.getIpAddressMap().get(ipAddress);
         if (obj != null) {
             MDC.put("id", obj.getLogKey());
         }

+ 26 - 34
src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerLoginInboundHandler.java

@@ -1,15 +1,9 @@
 package com.its.rota.server.xnet.server.handler;
 
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.global.AppRepository;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.xnettcp.dsrc.process.response.InitiateResponse;
-import com.its.dsrc.xnettcp.dsrc.process.response.LoginResponse;
-import com.its.dsrc.xnettcp.dsrc.process.service.LoginDeviceService;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.its.app.common.utils.NettyUtils;
+import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.repository.ApplicationRepository;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
 import lombok.RequiredArgsConstructor;
@@ -24,10 +18,8 @@ import java.util.concurrent.TimeUnit;
 //@ChannelHandler.Sharable
 public class ItsAsnServerLoginInboundHandler extends ChannelInboundHandlerAdapter {
 
-    private final RunningConfig config;
+    private final ApplicationRepository repo;
     private final ItsAsnServerPacketInboundHandler itsAsnServerPacketInboundHandler;
-    private final DbmsDataProcess dbmsDataProcess;
-    private final RunningConfig runningConfig;
 
     @Override
     public void channelActive(ChannelHandlerContext ctx) throws Exception {
@@ -46,7 +38,7 @@ public class ItsAsnServerLoginInboundHandler extends ChannelInboundHandlerAdapte
 
         //String tcpAddress = NettyUtils.getTcpAddress(ctx.channel());    // local/remote address 를 폼함한 문자열
         String ipAddress = NettyUtils.getRemoteIpAddress(ctx.channel());
-        TbRseCtlr obj = AppRepository.getInstance().getCtlrIpMap().get(ipAddress);
+        CenterDto obj = this.repo.getIpAddressMap().get(ipAddress);
         if (null == obj) {
             log.error("DsrcAsn1ServerLoginInboundHandler.-----------channelRead: {}. Unknown controller. will be closed.", ipAddress);
             ItsAsnServerIdleStateConnectionHandler.disconnectChannel(ctx.channel());
@@ -65,26 +57,26 @@ public class ItsAsnServerLoginInboundHandler extends ChannelInboundHandlerAdapte
 
         int allIdleTimeSec = 300;
         C2CAuthenticatedMessage c2c = (C2CAuthenticatedMessage)msg;
-        eAuthInfo cmd = eAuthInfo.getByValue(c2c.getDatexAuthenticationInfoText().value[0]);
-        if (cmd == eAuthInfo.AI_Initiate) {
-            InitiateResponse response = new InitiateResponse(obj, ctx, c2c);
-            if (!response.response(this.runningConfig)) {
-                log.error("DsrcAsn1ServerLoginInboundHandler.-----------channelRead: {}. AI_Initiate failed. will be closed.", ipAddress);
-                ItsAsnServerIdleStateConnectionHandler.disconnectChannel(ctx.channel());
-                return;
-            }
-            LoginDeviceService.getInstance().requestLogin(obj, ctx.channel(), this.runningConfig);
-        } else if (cmd == eAuthInfo.AI_Login)  {
-            LoginResponse response = new LoginResponse(obj, ctx, c2c);
-            if (!response.response(this.runningConfig)) {
-                log.error("DsrcAsn1ServerLoginInboundHandler.-----------channelRead: {}. AI_Login failed. will be closed.", ipAddress);
-                ItsAsnServerIdleStateConnectionHandler.disconnectChannel(ctx.channel());
-                return;
-            }
-            return;
-        } else {
-            log.warn("DsrcAsn1ServerLoginInboundHandler: {}", cmd);
-        }
+//        eAuthInfo cmd = eAuthInfo.getByValue(c2c.getDatexAuthenticationInfoText().value[0]);
+//        if (cmd == eAuthInfo.AI_Initiate) {
+//            InitiateResponse response = new InitiateResponse(obj, ctx, c2c);
+//            if (!response.response(this.runningConfig)) {
+//                log.error("DsrcAsn1ServerLoginInboundHandler.-----------channelRead: {}. AI_Initiate failed. will be closed.", ipAddress);
+//                ItsAsnServerIdleStateConnectionHandler.disconnectChannel(ctx.channel());
+//                return;
+//            }
+//            LoginDeviceService.getInstance().requestLogin(obj, ctx.channel(), this.runningConfig);
+//        } else if (cmd == eAuthInfo.AI_Login)  {
+//            LoginResponse response = new LoginResponse(obj, ctx, c2c);
+//            if (!response.response(this.runningConfig)) {
+//                log.error("DsrcAsn1ServerLoginInboundHandler.-----------channelRead: {}. AI_Login failed. will be closed.", ipAddress);
+//                ItsAsnServerIdleStateConnectionHandler.disconnectChannel(ctx.channel());
+//                return;
+//            }
+//            return;
+//        } else {
+//            log.warn("DsrcAsn1ServerLoginInboundHandler: {}", cmd);
+//        }
 
         // 로그인이 성공하면
         // 통신 IDLE 시 네트워크 체크 확인 패킷전송을 위한 핸들러를 추가한다.

+ 5 - 6
src/main/java/com/its/rota/server/xnet/server/handler/ItsAsnServerPacketInboundHandler.java

@@ -1,9 +1,8 @@
 package com.its.rota.server.xnet.server.handler;
 
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.xnettcp.dsrc.process.TcpServerData;
-import com.its.dsrc.xnettcp.dsrc.process.TcpServerDataProcess;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.its.app.common.utils.NettyUtils;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.ChannelInboundHandlerAdapter;
@@ -17,7 +16,7 @@ import org.springframework.stereotype.Component;
 @ChannelHandler.Sharable
 public class ItsAsnServerPacketInboundHandler extends ChannelInboundHandlerAdapter {
 
-    private final TcpServerDataProcess tcpServerDataProcess;
+    private final DbmsDataProcess dbmsDataProcess;
 
     public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
         if (!(msg instanceof C2CAuthenticatedMessage)) {
@@ -26,6 +25,6 @@ public class ItsAsnServerPacketInboundHandler extends ChannelInboundHandlerAdapt
         }
 //        C2CAuthenticatedMessage c2c = (C2CAuthenticatedMessage)msg;
 //        log.info("DsrcAsn1ServerPacketHandler: channelRead: {}, {}", NettyUtils.getRemoteAddress(ctx.channel()), c2c);
-        this.tcpServerDataProcess.add(new TcpServerData(TcpServerData.DATA_TYPE_PACKET, null, ctx, msg));
+//        this.dbmsDataProcess.add(new DbmsData(TcpServerData.DATA_TYPE_PACKET, null, ctx, msg));
     }
 }

+ 92 - 100
src/main/java/com/its/rota/server/xnet/server/process/response/AcceptResponse.java

@@ -1,27 +1,19 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1dsrc.dsrc.Accept;
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.dsrc.PDUs;
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.dao.mapper.RseCtlrMapper;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseCtlrCnncHs;
-import com.its.dsrc.entity.TbRseCtrlHs;
-import com.its.dsrc.process.DbmsData;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.process.DbmsDataType;
-import com.its.dsrc.vo.NET;
-import com.its.dsrc.xnettcp.dsrc.process.service.LoginDeviceService;
+import com.beanit.its.Accept;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.PDUs;
+import com.its.app.common.utils.NettyUtils;
+import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
+import com.its.rota.server.xnet.server.process.service.LoginDeviceService;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class AcceptResponse implements DsrcAsn1Response {
+public class AcceptResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -31,7 +23,7 @@ public class AcceptResponse implements DsrcAsn1Response {
         this.obj = obj;
         this.ctx = ctx;
         this.c2c = c2c;
-        this.dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+        this.dbmsDataProcess = SpringUtils.getBean(DbmsDataProcess.class);
     }
 
     @Override
@@ -46,62 +38,62 @@ public class AcceptResponse implements DsrcAsn1Response {
             return false;
         }
 
-        TbRseCtrlHs command = null;
-        long dataPacketNmbr = c2c.getDatexDataPacketNumber().value.longValue();
-        Long acceptPacketNmbr = accept.getDatexAcceptPacketNbr().value.longValue();
-        Accept.DatexAcceptType acceptType = accept.getDatexAcceptType();
-        if (acceptType.getLogIn() != null) {
-            // Login = 1, 여기는 들어오지 않는다.
-            log.info("AcceptResponse.response: {}. Login: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
-            loginAccept(runningConfig);
-        }
-        else if (acceptType.getSingleSubscription() != null) {
-            // SingleSubscription = 2
-            // Publication = 3
-            // 제어명령에 대한 응답, 제어목록에서 삭제하고 이력으로 저장한다.
-            this.obj.removeRegisteredCommands(acceptPacketNmbr, true);
-            command = this.obj.getUserCommands(acceptPacketNmbr);
-            log.info("AcceptResponse.response: {}. SingleSubscription: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
-        }
-        else if (acceptType.getPublication() != null) {
-            // SingleSubscription = 2
-            // Publication = 3
-            // 제어명령에 대한 응답, 제어목록에서 삭제하고 이력으로 저장한다.
-            this.obj.removeRegisteredCommands(acceptPacketNmbr, true);
-            command = this.obj.getUserCommands(acceptPacketNmbr);
-            log.info("AcceptResponse.response: {}. Publication: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
-        }
-        else if (acceptType.getRegisteredSubscription() != null) {
-            // RegisteredSubscription = 4
-            // 요청에 대한 응답, 제어목록에서 삭제한다.
-            // 상태정보요청: 269677936
-            if (269677936 == acceptType.getRegisteredSubscription().longValue()) {
-                if (acceptPacketNmbr == 1) {
-                    /**
-                     * requestObuGatherInfo 에 대한 Accept 응답
-                     */
-                    LoginDeviceService.getInstance().requestObuStatusInfo(this.obj, this.ctx.channel());
-                }
-                else if (acceptPacketNmbr == 2) {
-                    /**
-                     * requestObuStatusInfo 에 대한 Accept 응답
-                     */
-                    //LoginDeviceService.getInstance().requestObuStatusInfo(this.obj, this.ctx.channel());
-                }
-                //log.info("AcceptResponse.response: {}. 상태정보요청응답: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
-            }
-            this.obj.removeRegisteredCommands(acceptPacketNmbr, true);
-            log.info("AcceptResponse.response: {}. RegisteredSubscription: {}, {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr, acceptType.getRegisteredSubscription().longValue());
-        }
-
-        if (command != null) {
-            log.info("AcceptResponse.response: {}. Accept User Command: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
-            this.obj.removeUserCommands(acceptPacketNmbr);
-            // TODO: 제어명령 성공 전송(성공)
-            command.setRspsType("0");  // 명령 성공으로 설정
-            RseCtlrMapper mapper = (RseCtlrMapper) AppUtils.getBean(RseCtlrMapper.class);
-            mapper.updateRseCtrlHs(command);
-        }
+//        TbRseCtrlHs command = null;
+//        long dataPacketNmbr = c2c.getDatexDataPacketNumber().value.longValue();
+//        Long acceptPacketNmbr = accept.getDatexAcceptPacketNbr().value.longValue();
+//        Accept.DatexAcceptType acceptType = accept.getDatexAcceptType();
+//        if (acceptType.getLogIn() != null) {
+//            // Login = 1, 여기는 들어오지 않는다.
+//            log.info("AcceptResponse.response: {}. Login: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
+//            loginAccept(runningConfig);
+//        }
+//        else if (acceptType.getSingleSubscription() != null) {
+//            // SingleSubscription = 2
+//            // Publication = 3
+//            // 제어명령에 대한 응답, 제어목록에서 삭제하고 이력으로 저장한다.
+//            this.obj.removeRegisteredCommands(acceptPacketNmbr, true);
+//            command = this.obj.getUserCommands(acceptPacketNmbr);
+//            log.info("AcceptResponse.response: {}. SingleSubscription: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
+//        }
+//        else if (acceptType.getPublication() != null) {
+//            // SingleSubscription = 2
+//            // Publication = 3
+//            // 제어명령에 대한 응답, 제어목록에서 삭제하고 이력으로 저장한다.
+//            this.obj.removeRegisteredCommands(acceptPacketNmbr, true);
+//            command = this.obj.getUserCommands(acceptPacketNmbr);
+//            log.info("AcceptResponse.response: {}. Publication: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
+//        }
+//        else if (acceptType.getRegisteredSubscription() != null) {
+//            // RegisteredSubscription = 4
+//            // 요청에 대한 응답, 제어목록에서 삭제한다.
+//            // 상태정보요청: 269677936
+//            if (269677936 == acceptType.getRegisteredSubscription().longValue()) {
+//                if (acceptPacketNmbr == 1) {
+//                    /**
+//                     * requestObuGatherInfo 에 대한 Accept 응답
+//                     */
+//                    LoginDeviceService.getInstance().requestObuStatusInfo(this.obj, this.ctx.channel());
+//                }
+//                else if (acceptPacketNmbr == 2) {
+//                    /**
+//                     * requestObuStatusInfo 에 대한 Accept 응답
+//                     */
+//                    //LoginDeviceService.getInstance().requestObuStatusInfo(this.obj, this.ctx.channel());
+//                }
+//                //log.info("AcceptResponse.response: {}. 상태정보요청응답: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
+//            }
+//            this.obj.removeRegisteredCommands(acceptPacketNmbr, true);
+//            log.info("AcceptResponse.response: {}. RegisteredSubscription: {}, {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr, acceptType.getRegisteredSubscription().longValue());
+//        }
+//
+//        if (command != null) {
+//            log.info("AcceptResponse.response: {}. Accept User Command: {}, {}", ipAddress, dataPacketNmbr, acceptPacketNmbr);
+//            this.obj.removeUserCommands(acceptPacketNmbr);
+//            // TODO: 제어명령 성공 전송(성공)
+//            command.setRspsType("0");  // 명령 성공으로 설정
+//            RseCtlrMapper mapper = (RseCtlrMapper) AppUtils.getBean(RseCtlrMapper.class);
+//            mapper.updateRseCtrlHs(command);
+//        }
         return true;
     }
 
@@ -110,33 +102,33 @@ public class AcceptResponse implements DsrcAsn1Response {
      * @param runningConfig
      */
     private void loginAccept(ApplicationConfig config) {
-        if (this.obj.getNetState() > NET.LOGIN_REQ && this.obj.getChannel() != null) {
-            log.warn("AcceptResponse.loginAccept: {}, already login. older channel will be closed.", this.obj.getMcuID());
-            this.obj.setDupLogin(true);
-            this.obj.setDupChannel(this.obj.getChannel());
-//            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(this.obj, this.obj.getDupChannel());
-        }
-
-        this.obj.channelLoginInit();
-        this.obj.getStts().initNormal();
-
-        TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
-        voLog.setRSE_CTLR_NMBR(this.obj.getID());
-        voLog.setLOG_ADDRESS(this.obj.getRSE_CTLR_IP());
-        voLog.setLoginInfo(c2c);
-        voLog.setLOG_ID(this.obj.getMcuID());
-        voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_LOGIN));
-        this.obj.setLOG_ID(voLog.getLOG_ID());
-        if (this.obj.isDupLogin()) {
-            // 중복 접속(이미 통신중인 세션이 존재함)
-            voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_DUP_LOGIN));
-        }
-        this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS, false, voLog));
-
-        this.obj.getSeq().resetValue();
-        //this.obj.setLogin(login);
-        // 로그인이 성공하면 제어기에 정보를 요청한다.
-        log.info("AcceptResponse.loginAccept: {}, Request Subscriptions", obj.getMcuID());
+//        if (this.obj.getNetState() > NET.LOGIN_REQ && this.obj.getChannel() != null) {
+//            log.warn("AcceptResponse.loginAccept: {}, already login. older channel will be closed.", this.obj.getMcuID());
+//            this.obj.setDupLogin(true);
+//            this.obj.setDupChannel(this.obj.getChannel());
+////            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(this.obj, this.obj.getDupChannel());
+//        }
+//
+//        this.obj.channelLoginInit();
+//        this.obj.getStts().initNormal();
+//
+//        TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
+//        voLog.setRSE_CTLR_NMBR(this.obj.getID());
+//        voLog.setLOG_ADDRESS(this.obj.getRSE_CTLR_IP());
+//        voLog.setLoginInfo(c2c);
+//        voLog.setLOG_ID(this.obj.getMcuID());
+//        voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_LOGIN));
+//        this.obj.setLOG_ID(voLog.getLOG_ID());
+//        if (this.obj.isDupLogin()) {
+//            // 중복 접속(이미 통신중인 세션이 존재함)
+//            voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_DUP_LOGIN));
+//        }
+//        this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS, false, voLog));
+//
+//        this.obj.getSeq().resetValue();
+//        //this.obj.setLogin(login);
+//        // 로그인이 성공하면 제어기에 정보를 요청한다.
+//        log.info("AcceptResponse.loginAccept: {}, Request Subscriptions", obj.getMcuID());
 
         /**
          * OBU Gather Info request

+ 82 - 89
src/main/java/com/its/rota/server/xnet/server/process/response/DsrcAsn1Accept.java

@@ -1,15 +1,8 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1bean.ber.types.BerEnum;
-import com.beanit.asn1bean.ber.types.BerInteger;
-import com.beanit.asn1bean.ber.types.BerNull;
-import com.beanit.asn1bean.ber.types.BerOctetString;
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.beanit.asn1dsrc.enums.ePdusPr;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.entity.TbRseCtlr;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.PDUs;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.Channel;
 import lombok.extern.slf4j.Slf4j;
@@ -26,85 +19,85 @@ public class DsrcAsn1Accept {
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
         C2CAuthenticatedMessage resC2c = null;
         PDUs pdus = c2c.getPdu();
-        ePdusPr pdu = DsrcAsn1Utils.getPduChoice(pdus);
-
-        byte[] accept = { (byte) eAuthInfo.AI_Accept.getValue() };
-        PDUs resPdus = new PDUs();
-        Accept acpt = new Accept();
-        Accept.DatexAcceptType acptType = new Accept.DatexAcceptType();
-
-        log.debug("DsrcAsn1Accept.makeC2CAuthenticatedMessage: {}, {}", ipAddress, pdu.toString());
-
-        switch(pdu) {
-        case PDUs_PR_login:
-            resC2c = new C2CAuthenticatedMessage();
-            Login login = pdus.getLogin();
-            acptType.setLogIn(login.getDatexLoginEncodingRulesId().getBerObjectIdentifier().get(0));
-            break;
-        case PDUs_PR_subscripiton:
-            resC2c = new C2CAuthenticatedMessage();
-            Subscription subscription = c2c.getPdu().getSubscription();
-            SubscriptionType subscriptionType = subscription.getDatexSubscribeType();
-            BerEnum cancelReasonCd = subscriptionType.getDatexSubscribeCancelReasonCd();
-            if (subscriptionType != null) {
-                // Subscription
-                SubscriptionData subscriptionData = subscriptionType.getSubscription();
-                SubscriptionMode subscriptionMode = subscriptionData.getDatexSubscribeMode();
-                BerNull single = subscriptionMode.getSingle();
-                Registered eventDriven = subscriptionMode.getEventDriven();
-                Registered periodic = subscriptionMode.getPeriodic();
-
-                if (single != null) {
-                    acptType.setSingleSubscription(new BerNull());
-                }
-                else if (eventDriven != null) {
-                    Registered.Continuous cont = eventDriven.getContinuous();
-                    if (cont != null) {
-                        acptType.setRegisteredSubscription(cont.getDatexRegisteredUpdateDelayQty());
-                    }
-                    else {
-                        acptType.setRegisteredSubscription(subscription.getDatexSubscribeSerialNbr());
-                    }
-                }
-                else if (periodic != null) {
-                    Registered.Continuous cont = periodic.getContinuous();
-                    if (cont != null) {
-                        acptType.setRegisteredSubscription(cont.getDatexRegisteredUpdateDelayQty());
-                    }
-                    else {
-                        acptType.setRegisteredSubscription(subscription.getDatexSubscribeSerialNbr());
-                    }
-                }
-                else {
-                    return null;
-                }
-            }
-            else if (cancelReasonCd != null) {
-                // Cancel
-                acptType.setRegisteredSubscription(subscription.getDatexSubscribeSerialNbr());
-            }
-            break;
-        case PDUs_PR_publication:
-            resC2c = new C2CAuthenticatedMessage();
-            BerNull berNull = new BerNull();
-            acptType.setPublication(berNull);
-            break;
-        default:
-            break;
-        }
-
-        if (resC2c != null) {
-            acpt.setDatexAcceptPacketNbr(c2c.getDatexDataPacketNumber());
-            acpt.setDatexAcceptType(acptType);
-            resPdus.setAccept(acpt);
-
-            resC2c.setDatexAuthenticationInfoText(new BerOctetString(accept));
-            resC2c.setDatexDataPacketNumber(new BerInteger(obj.getSeq().nextValue()));
-            resC2c.setDatexDataPacketPriorityNumber(new BerInteger(0));
-            //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(c2c.getOptions()));
-            resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
-            resC2c.setPdu(resPdus);
-        }
+//        ePdusPr pdu = DsrcAsn1Utils.getPduChoice(pdus);
+//
+//        byte[] accept = { (byte) eAuthInfo.AI_Accept.getValue() };
+//        PDUs resPdus = new PDUs();
+//        Accept acpt = new Accept();
+//        Accept.DatexAcceptType acptType = new Accept.DatexAcceptType();
+//
+//        log.debug("DsrcAsn1Accept.makeC2CAuthenticatedMessage: {}, {}", ipAddress, pdu.toString());
+//
+//        switch(pdu) {
+//        case PDUs_PR_login:
+//            resC2c = new C2CAuthenticatedMessage();
+//            Login login = pdus.getLogin();
+//            acptType.setLogIn(login.getDatexLoginEncodingRulesId().getBerObjectIdentifier().get(0));
+//            break;
+//        case PDUs_PR_subscripiton:
+//            resC2c = new C2CAuthenticatedMessage();
+//            Subscription subscription = c2c.getPdu().getSubscription();
+//            SubscriptionType subscriptionType = subscription.getDatexSubscribeType();
+//            BerEnum cancelReasonCd = subscriptionType.getDatexSubscribeCancelReasonCd();
+//            if (subscriptionType != null) {
+//                // Subscription
+//                SubscriptionData subscriptionData = subscriptionType.getSubscription();
+//                SubscriptionMode subscriptionMode = subscriptionData.getDatexSubscribeMode();
+//                BerNull single = subscriptionMode.getSingle();
+//                Registered eventDriven = subscriptionMode.getEventDriven();
+//                Registered periodic = subscriptionMode.getPeriodic();
+//
+//                if (single != null) {
+//                    acptType.setSingleSubscription(new BerNull());
+//                }
+//                else if (eventDriven != null) {
+//                    Registered.Continuous cont = eventDriven.getContinuous();
+//                    if (cont != null) {
+//                        acptType.setRegisteredSubscription(cont.getDatexRegisteredUpdateDelayQty());
+//                    }
+//                    else {
+//                        acptType.setRegisteredSubscription(subscription.getDatexSubscribeSerialNbr());
+//                    }
+//                }
+//                else if (periodic != null) {
+//                    Registered.Continuous cont = periodic.getContinuous();
+//                    if (cont != null) {
+//                        acptType.setRegisteredSubscription(cont.getDatexRegisteredUpdateDelayQty());
+//                    }
+//                    else {
+//                        acptType.setRegisteredSubscription(subscription.getDatexSubscribeSerialNbr());
+//                    }
+//                }
+//                else {
+//                    return null;
+//                }
+//            }
+//            else if (cancelReasonCd != null) {
+//                // Cancel
+//                acptType.setRegisteredSubscription(subscription.getDatexSubscribeSerialNbr());
+//            }
+//            break;
+//        case PDUs_PR_publication:
+//            resC2c = new C2CAuthenticatedMessage();
+//            BerNull berNull = new BerNull();
+//            acptType.setPublication(berNull);
+//            break;
+//        default:
+//            break;
+//        }
+//
+//        if (resC2c != null) {
+//            acpt.setDatexAcceptPacketNbr(c2c.getDatexDataPacketNumber());
+//            acpt.setDatexAcceptType(acptType);
+//            resPdus.setAccept(acpt);
+//
+//            resC2c.setDatexAuthenticationInfoText(new BerOctetString(accept));
+//            resC2c.setDatexDataPacketNumber(new BerInteger(obj.getSeq().nextValue()));
+//            resC2c.setDatexDataPacketPriorityNumber(new BerInteger(0));
+//            //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(c2c.getOptions()));
+//            resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
+//            resC2c.setPdu(resPdus);
+//        }
         return resC2c;
     }
 }

+ 38 - 48
src/main/java/com/its/rota/server/xnet/server/process/response/DsrcAsn1Reject.java

@@ -1,17 +1,7 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1bean.ber.types.BerEnum;
-import com.beanit.asn1bean.ber.types.BerInteger;
-import com.beanit.asn1bean.ber.types.BerOctetString;
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.dsrc.PDUs;
-import com.beanit.asn1dsrc.dsrc.Reject;
-import com.beanit.asn1dsrc.dsrc.RejectType;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.beanit.asn1dsrc.enums.ePdusPr;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.entity.TbRseCtlr;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.Channel;
 import lombok.extern.slf4j.Slf4j;
@@ -29,42 +19,42 @@ public class DsrcAsn1Reject {
         log.info("DsrcAsn1Reject.makeC2CAuthenticatedMessage: {}", ipAddress);
 
         C2CAuthenticatedMessage resC2c = null;
-        ePdusPr pdu = DsrcAsn1Utils.getPduChoice(c2c.getPdu());
-
-        byte[] reject = { (byte) eAuthInfo.AI_Reject.getValue() };
-        PDUs resPdus = new PDUs();
-        Reject rjt = new Reject();
-        RejectType rjtType = new RejectType();
-
-        switch(pdu) {
-            case PDUs_PR_login:
-                resC2c = new C2CAuthenticatedMessage();
-                rjtType.setDatexRejectLoginCd(new BerEnum(rejectType));
-               break;
-            case PDUs_PR_subscripiton:
-                resC2c = new C2CAuthenticatedMessage();
-                rjtType.setDatexRejectSubscriptionCd(new BerEnum(rejectType));
-                break;
-            case PDUs_PR_publication:
-                resC2c = new C2CAuthenticatedMessage();
-                rjtType.setDatexRejectPublicationCd(new BerEnum(rejectType));
-                break;
-            default:
-                break;
-        }
-
-        if (resC2c != null) {
-            rjt.setDatexRejectPacketNbr(c2c.getDatexDataPacketNumber());
-            rjt.setDatexRejectType(rjtType);
-            resPdus.setReject(rjt);
-
-            resC2c.setDatexAuthenticationInfoText(new BerOctetString(reject));
-            resC2c.setDatexDataPacketNumber(new BerInteger(obj.getSeq().nextValue()));
-            resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-            //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(c2c.getOptions()));
-            resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
-            resC2c.setPdu(resPdus);
-        }
+//        ePdusPr pdu = DsrcAsn1Utils.getPduChoice(c2c.getPdu());
+//
+//        byte[] reject = { (byte) eAuthInfo.AI_Reject.getValue() };
+//        PDUs resPdus = new PDUs();
+//        Reject rjt = new Reject();
+//        RejectType rjtType = new RejectType();
+//
+//        switch(pdu) {
+//            case PDUs_PR_login:
+//                resC2c = new C2CAuthenticatedMessage();
+//                rjtType.setDatexRejectLoginCd(new BerEnum(rejectType));
+//               break;
+//            case PDUs_PR_subscripiton:
+//                resC2c = new C2CAuthenticatedMessage();
+//                rjtType.setDatexRejectSubscriptionCd(new BerEnum(rejectType));
+//                break;
+//            case PDUs_PR_publication:
+//                resC2c = new C2CAuthenticatedMessage();
+//                rjtType.setDatexRejectPublicationCd(new BerEnum(rejectType));
+//                break;
+//            default:
+//                break;
+//        }
+//
+//        if (resC2c != null) {
+//            rjt.setDatexRejectPacketNbr(c2c.getDatexDataPacketNumber());
+//            rjt.setDatexRejectType(rjtType);
+//            resPdus.setReject(rjt);
+//
+//            resC2c.setDatexAuthenticationInfoText(new BerOctetString(reject));
+//            resC2c.setDatexDataPacketNumber(new BerInteger(obj.getSeq().nextValue()));
+//            resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
+//            //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(c2c.getOptions()));
+//            resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
+//            resC2c.setPdu(resPdus);
+//        }
         return resC2c;
     }
 }

+ 29 - 36
src/main/java/com/its/rota/server/xnet/server/process/response/FredResponse.java

@@ -1,26 +1,19 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1bean.ber.types.BerInteger;
-import com.beanit.asn1bean.ber.types.BerOctetString;
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.dsrc.FrED;
-import com.beanit.asn1dsrc.dsrc.PDUs;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.FrED;
+import com.beanit.its.PDUs;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 import java.math.BigInteger;
 
 @Slf4j
-public class FredResponse implements DsrcAsn1Response {
+public class FredResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -38,14 +31,14 @@ public class FredResponse implements DsrcAsn1Response {
 
         // 세션 연결 유지를 위해 Fred 메시지 전송
         PDUs pdus = this.c2c.getPdu();
-        byte[] auth = { (byte) eAuthInfo.AI_FrED.getValue() };
-        C2CAuthenticatedMessage resC2c = new C2CAuthenticatedMessage();
-        resC2c.setDatexDataPacketNumber(new BerInteger(this.obj.getSeq().nextValue()));
-        resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-        resC2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-        //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(this.obj.getHeaderOptions()));
-        resC2c.setOptions(DsrcAsn1Utils.getDefaultOptions());
-        resC2c.setPdu(pdus);
+//        byte[] auth = { (byte) eAuthInfo.AI_FrED.getValue() };
+//        C2CAuthenticatedMessage resC2c = new C2CAuthenticatedMessage();
+//        resC2c.setDatexDataPacketNumber(new BerInteger(this.obj.getSeq().nextValue()));
+//        resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
+//        resC2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//        //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(this.obj.getHeaderOptions()));
+//        resC2c.setOptions(DsrcAsn1Utils.getDefaultOptions());
+//        resC2c.setPdu(pdus);
 
         /**
          * TODO: 클라이언트 모드로 동작시 FrED를 다시 전송하지 않는다.
@@ -69,22 +62,22 @@ public class FredResponse implements DsrcAsn1Response {
         FrED fred = new FrED(new BigInteger(String.valueOf(9871)));
         pdus.setFred(fred);
 
-        byte[] auth = { (byte) eAuthInfo.AI_FrED.getValue() };
-        C2CAuthenticatedMessage resC2c = new C2CAuthenticatedMessage();
-        resC2c.setDatexDataPacketNumber(new BerInteger(obj.getSeq().nextValue()));
-        resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-        resC2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-        //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(this.obj.getHeaderOptions()));
-        resC2c.setOptions(DsrcAsn1Utils.getDefaultOptions());
-        resC2c.setPdu(pdus);
-
-        ChannelFuture f = channel.writeAndFlush(resC2c);
-        f.awaitUninterruptibly();
-        if (f.isDone() || f.isSuccess()) {
-            log.info("FredResponse.sendFrED: {}, Send OK", ipAddress);
-        } else {
-            log.error("FredResponse.sendFrED: {}, Send Failed", ipAddress);
-        }
+//        byte[] auth = { (byte) eAuthInfo.AI_FrED.getValue() };
+//        C2CAuthenticatedMessage resC2c = new C2CAuthenticatedMessage();
+//        resC2c.setDatexDataPacketNumber(new BerInteger(obj.getSeq().nextValue()));
+//        resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
+//        resC2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//        //resC2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(this.obj.getHeaderOptions()));
+//        resC2c.setOptions(DsrcAsn1Utils.getDefaultOptions());
+//        resC2c.setPdu(pdus);
+//
+//        ChannelFuture f = channel.writeAndFlush(resC2c);
+//        f.awaitUninterruptibly();
+//        if (f.isDone() || f.isSuccess()) {
+//            log.info("FredResponse.sendFrED: {}, Send OK", ipAddress);
+//        } else {
+//            log.error("FredResponse.sendFrED: {}, Send Failed", ipAddress);
+//        }
         return true;
     }
 

+ 7 - 9
src/main/java/com/its/rota/server/xnet/server/process/response/InitiateResponse.java

@@ -1,19 +1,17 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.dsrc.Initiate;
-import com.beanit.asn1dsrc.dsrc.PDUs;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.xnettcp.dsrc.process.service.LoginDeviceService;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.Initiate;
+import com.beanit.its.PDUs;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.xnet.server.process.service.LoginDeviceService;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class InitiateResponse implements DsrcAsn1Response {
+public class InitiateResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -36,7 +34,7 @@ public class InitiateResponse implements DsrcAsn1Response {
             /**
              * Login 요청에 대한 응답을 처리함
              */
-            return LoginDeviceService.getInstance().requestLogin(obj, this.ctx.channel(), runningConfig);
+            return LoginDeviceService.getInstance().requestLogin(obj, this.ctx.channel(), config);
         }
 
         return true;

+ 1 - 1
src/main/java/com/its/rota/server/xnet/server/process/response/DsrcAsn1Response.java → src/main/java/com/its/rota/server/xnet/server/process/response/ItsAsnResponse.java

@@ -2,6 +2,6 @@ package com.its.rota.server.xnet.server.process.response;
 
 import com.its.rota.server.config.ApplicationConfig;
 
-public interface DsrcAsn1Response {
+public interface ItsAsnResponse {
     boolean response(ApplicationConfig config);
 }

+ 140 - 148
src/main/java/com/its/rota/server/xnet/server/process/response/LoginResponse.java

@@ -4,23 +4,14 @@ import com.beanit.asn1bean.ber.types.BerEnum;
 import com.beanit.asn1bean.ber.types.BerInteger;
 import com.beanit.asn1bean.ber.types.BerOctetString;
 import com.beanit.asn1bean.ber.types.string.BerUTF8String;
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.beanit.asn1dsrc.enums.ePdusPr;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseCtlrCnncHs;
-import com.its.dsrc.process.DbmsData;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.process.DbmsDataType;
-import com.its.dsrc.vo.NET;
-import com.its.dsrc.xnettcp.dsrc.handler.DsrcAsn1ServerIdleStatePacketHandler;
-import com.its.dsrc.xnettcp.dsrc.process.service.LoginDeviceService;
+import com.beanit.its.*;
+import com.its.app.common.utils.NettyUtils;
+import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.process.dbms.DbmsData;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
+import com.its.rota.server.xnet.server.process.service.LoginDeviceService;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
@@ -28,19 +19,19 @@ import lombok.extern.slf4j.Slf4j;
 import java.math.BigInteger;
 
 @Slf4j
-public class LoginResponse implements DsrcAsn1Response {
+public class LoginResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
-    private RunningConfig runningConfig;
+    private ApplicationConfig config;
     private DbmsDataProcess dbmsDataProcess;
 
     public LoginResponse(CenterDto obj, ChannelHandlerContext ctx, C2CAuthenticatedMessage c2c) {
         this.obj = obj;
         this.ctx = ctx;
         this.c2c = c2c;
-        this.runningConfig = (RunningConfig) AppUtils.getBean(RunningConfig.class);
-        this.dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+        this.config = SpringUtils.getBean(ApplicationConfig.class);
+        this.dbmsDataProcess = SpringUtils.getBean(DbmsDataProcess.class);
     }
 
      @Override
@@ -49,18 +40,18 @@ public class LoginResponse implements DsrcAsn1Response {
         log.info("LoginResponse.response: {}", ipAddress);
 
         PDUs pdus = this.c2c.getPdu();
-        eAuthInfo cmd = eAuthInfo.getByValue(this.c2c.getDatexAuthenticationInfoText().value[0]);
-        ePdusPr pdu = DsrcAsn1Utils.getPduChoice(pdus);
-        if (cmd == null || pdu == null) {
-            log.error("LoginResponse.response: {}. AuthInfo: {}, PDUs: {}", ipAddress, cmd, pdu);
-            return false;
-        }
-
-        log.info("LoginResponse.response: {}. AuthInfo: {}, PDUs: {}", ipAddress, cmd.toString(), pdu.toString());
-        if (cmd != eAuthInfo.AI_Login || pdu != ePdusPr.PDUs_PR_login) {
-            log.error("LoginResponse.response: {}. LOGIN WAIT, Miss Matched Login Message. will be closed.v {}", ipAddress, cmd);
-            return false;
-        }
+//        eAuthInfo cmd = eAuthInfo.getByValue(this.c2c.getDatexAuthenticationInfoText().value[0]);
+//        ePdusPr pdu = DsrcAsn1Utils.getPduChoice(pdus);
+//        if (cmd == null || pdu == null) {
+//            log.error("LoginResponse.response: {}. AuthInfo: {}, PDUs: {}", ipAddress, cmd, pdu);
+//            return false;
+//        }
+//
+//        log.info("LoginResponse.response: {}. AuthInfo: {}, PDUs: {}", ipAddress, cmd.toString(), pdu.toString());
+//        if (cmd != eAuthInfo.AI_Login || pdu != ePdusPr.PDUs_PR_login) {
+//            log.error("LoginResponse.response: {}. LOGIN WAIT, Miss Matched Login Message. will be closed.v {}", ipAddress, cmd);
+//            return false;
+//        }
 
         boolean loginAccept = false;
         int loginResult = TbRseCtlrCnncHs.LOG_TYPE_OTHER;
@@ -68,80 +59,80 @@ public class LoginResponse implements DsrcAsn1Response {
         PDUs   resPdus = new PDUs();
         byte[] resAcks = new byte[1];
 
-         if (this.obj.getNetState() > NET.LOGIN_REQ && this.obj.getChannel() != null) {
-             log.warn("LoginResponse.response: {}. already login. older channel will be closed.", ipAddress);
-             this.obj.setDupLogin(true);
-             this.obj.setDupChannel(this.obj.getChannel());
-             DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(this.obj, this.obj.getDupChannel());
-         }
-
-        int heartbeatSec = login.getDatexLoginHeartbeatDurationMaxQty().value.intValue();
-        if (heartbeatSec == 0 || heartbeatSec > 120) {
-            heartbeatSec = 120;
-        }
-        if (heartbeatSec < 30) {
-            heartbeatSec = 30;
-        }
+//         if (this.obj.getNetState() > NET.LOGIN_REQ && this.obj.getChannel() != null) {
+//             log.warn("LoginResponse.response: {}. already login. older channel will be closed.", ipAddress);
+//             this.obj.setDupLogin(true);
+//             this.obj.setDupChannel(this.obj.getChannel());
+//             DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(this.obj, this.obj.getDupChannel());
+//         }
+//
+//        int heartbeatSec = login.getDatexLoginHeartbeatDurationMaxQty().value.intValue();
+//        if (heartbeatSec == 0 || heartbeatSec > 120) {
+//            heartbeatSec = 120;
+//        }
+//        if (heartbeatSec < 30) {
+//            heartbeatSec = 30;
+//        }
 
         //log.info("LoginResponse.response: {}. Login: {}", tcpAddress, login.toString());
         loginResult = checkValidLoginInfo(ipAddress, login);
-        if (loginResult == TbRseCtlrCnncHs.LOG_TYPE_LOGIN) {
-            loginAccept = true;
-            resAcks[0] = (byte)eAuthInfo.AI_Accept.getValue();
-            Accept acpt = new Accept();
-            Accept.DatexAcceptType acptType = new Accept.DatexAcceptType();
-            acptType.setLogIn(login.getDatexLoginEncodingRulesId().getBerObjectIdentifier().get(0));
-            acpt.setDatexAcceptPacketNbr(c2c.getDatexDataPacketNumber());
-            acpt.setDatexAcceptType(acptType);
-            resPdus.setAccept(acpt);
-            //log.info("LoginResponse.response: {}. Login Accept: {}, **** Pdus: {}", tcpAddress, acpt.toString(), resPdus.toString());
-        }
-
-        TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
-        voLog.setRSE_CTLR_NMBR(this.obj.getID());
-        voLog.setLOG_ADDRESS(ipAddress);
-        voLog.setLoginInfo(c2c);
-        voLog.setLOG_ID(new String(login.getDatexLoginUserNameTxt().value));
-        voLog.setLOG_TYPE(Integer.toString(loginResult));
-        this.obj.setLOG_ID(voLog.getLOG_ID());
-
-        if (loginAccept) {
-            //obj.channelLogin(c2c.getOptions(), login);
-            // 헤더옵션이 널값으로 수신됨
-            //HeaderOptions loginHdr = DsrcAsn1Utils.getHeaderOptions(
-            //        login.getDatexSenderTxt(),
-            //        login.getDatexSenderTxt(),
-            //        login.getDatexDestinationTxt(),
-            //        login.getDatexDestinationTxt());
-            HeaderOptions loginHdr = DsrcAsn1Utils.getHeaderOptions(
-                    new BerUTF8String("DSRC Main Control Unit"),
-                    new BerUTF8String("DSRC Main Control Unit"),
-                    new BerUTF8String("DSRC Center Unit"),
-                    new BerUTF8String("DSRC Center Unit"));
-            this.obj.channelLogin(this.ctx.channel(), loginHdr, login);
-        }
-        else {
-            resAcks[0] = (byte)eAuthInfo.AI_Reject.getValue();
-            Reject rjt = new Reject();
-            RejectType rjtType = new RejectType();
-            rjtType.setDatexRejectLoginCd(new BerEnum((long)0));
-            rjt.setDatexRejectPacketNbr(c2c.getDatexDataPacketNumber());
-            rjt.setDatexRejectType(rjtType);
-            resPdus.setAccept(null);
-            resPdus.setReject(rjt);
-            log.error("LoginResponse.response: {}. Login Reject: {}, **** Pdus: {}", ipAddress, rjt.toString(), resPdus.toString());
-        }
+//        if (loginResult == TbRseCtlrCnncHs.LOG_TYPE_LOGIN) {
+//            loginAccept = true;
+//            resAcks[0] = (byte)eAuthInfo.AI_Accept.getValue();
+//            Accept acpt = new Accept();
+//            Accept.DatexAcceptType acptType = new Accept.DatexAcceptType();
+//            acptType.setLogIn(login.getDatexLoginEncodingRulesId().getBerObjectIdentifier().get(0));
+//            acpt.setDatexAcceptPacketNbr(c2c.getDatexDataPacketNumber());
+//            acpt.setDatexAcceptType(acptType);
+//            resPdus.setAccept(acpt);
+//            //log.info("LoginResponse.response: {}. Login Accept: {}, **** Pdus: {}", tcpAddress, acpt.toString(), resPdus.toString());
+//        }
+
+//        TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
+//        voLog.setRSE_CTLR_NMBR(this.obj.getID());
+//        voLog.setLOG_ADDRESS(ipAddress);
+//        voLog.setLoginInfo(c2c);
+//        voLog.setLOG_ID(new String(login.getDatexLoginUserNameTxt().value));
+//        voLog.setLOG_TYPE(Integer.toString(loginResult));
+//        this.obj.setLOG_ID(voLog.getLOG_ID());
+//
+//        if (loginAccept) {
+//            //obj.channelLogin(c2c.getOptions(), login);
+//            // 헤더옵션이 널값으로 수신됨
+//            //HeaderOptions loginHdr = DsrcAsn1Utils.getHeaderOptions(
+//            //        login.getDatexSenderTxt(),
+//            //        login.getDatexSenderTxt(),
+//            //        login.getDatexDestinationTxt(),
+//            //        login.getDatexDestinationTxt());
+//            HeaderOptions loginHdr = DsrcAsn1Utils.getHeaderOptions(
+//                    new BerUTF8String("DSRC Main Control Unit"),
+//                    new BerUTF8String("DSRC Main Control Unit"),
+//                    new BerUTF8String("DSRC Center Unit"),
+//                    new BerUTF8String("DSRC Center Unit"));
+//            this.obj.channelLogin(this.ctx.channel(), loginHdr, login);
+//        }
+//        else {
+//            resAcks[0] = (byte)eAuthInfo.AI_Reject.getValue();
+//            Reject rjt = new Reject();
+//            RejectType rjtType = new RejectType();
+//            rjtType.setDatexRejectLoginCd(new BerEnum((long)0));
+//            rjt.setDatexRejectPacketNbr(c2c.getDatexDataPacketNumber());
+//            rjt.setDatexRejectType(rjtType);
+//            resPdus.setAccept(null);
+//            resPdus.setReject(rjt);
+//            log.error("LoginResponse.response: {}. Login Reject: {}, **** Pdus: {}", ipAddress, rjt.toString(), resPdus.toString());
+//        }
 
         //HeaderOptions hdrOpts = DsrcAsn1Utils.getHeaderOptions(
         //        login.getDatexDestinationTxt(), //this.dsrcServerConfig.getSenderText(),
         //        login.getDatexDestinationTxt(), //this.dsrcServerConfig.getSenderText(), //NettyUtils.getLocalIpAddress(ctx.channel()),
         //        login.getDatexSenderTxt(),// c2c.getOptions().getDatexSenderText(),
         //        login.getDatexSenderTxt());// c2c.getOptions().getDatexSenderAddressLocation());
-        HeaderOptions hdrOpts = DsrcAsn1Utils.getHeaderOptions(
-                new BerUTF8String("DSRC Center Unit"),
-                new BerUTF8String("DSRC Center Unit"),
-                new BerUTF8String("DSRC Main Control Unit"),
-                new BerUTF8String("DSRC Main Control Unit"));
+//        HeaderOptions hdrOpts = DsrcAsn1Utils.getHeaderOptions(
+//                new BerUTF8String("ITS ASN Center Unit"),
+//                new BerUTF8String("ITS ASN Center Unit"),
+//                new BerUTF8String("ITS ASN Main Control Unit"),
+//                new BerUTF8String("ITS ASN Main Control Unit"));
 
         //log.debug("LoginResponse.response: {}, hdrOpts: {}", tcpAddress, hdrOpts.toString());
 
@@ -149,7 +140,7 @@ public class LoginResponse implements DsrcAsn1Response {
         resC2c.setDatexAuthenticationInfoText(new BerOctetString(resAcks));
         resC2c.setDatexDataPacketNumber(new BerInteger(this.obj.getSeq().nextValue()));
         resC2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-        resC2c.setOptions(hdrOpts);
+//        resC2c.setOptions(hdrOpts);
         resC2c.setPdu(resPdus);
 
         //log.info("LoginResponse.response: {}. C2CAuth: {}", tcpAddress, resC2c.toString());
@@ -165,68 +156,69 @@ public class LoginResponse implements DsrcAsn1Response {
 
         if (loginAccept == false) {
             log.error("LoginResponse.response: {}, Remote: {}. Login Reject. tcp channel will be closed.", ipAddress, ipAddress);
-            voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_OTHER));
-            this.obj.channelLogout();
+//            voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_OTHER));
+//            this.obj.channelLogout();
             this.ctx.channel().disconnect();
             this.ctx.channel().close();
         }
 
-        if (this.obj.isDupLogin()) {
-            // 중복 접속(이미 통신중인 세션이 존재함)
-            voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_DUP_LOGIN));
-        }
-        this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS,false, voLog));
+//        if (this.obj.isDupLogin()) {
+//            // 중복 접속(이미 통신중인 세션이 존재함)
+//            voLog.setLOG_TYPE(Integer.toString(TbRseCtlrCnncHs.LOG_TYPE_DUP_LOGIN));
+//        }
+//        this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS,false, voLog));
 
         if (loginAccept) {
-            this.obj.getSeq().resetValue();
-            this.obj.setLogin(login);
-            // 로그인이 성공하면 제어기에 정보를 요청한다.
-            log.info("LoginResponse.response: {}, Request Subscriptions", ipAddress);
-            LoginDeviceService.getInstance().initLoginDevice(
-                    this.obj,
-                    this.ctx.channel(),
-                    this.runningConfig.isPublicationNonCryptObu(),
-                    this.runningConfig.isSubscriptionStatus(),
-                    this.runningConfig.isSubscriptionTraffic(),
-                    this.runningConfig.getSubscriptionStatusCycle(),
-                    this.runningConfig.getPublicationAntenna());
+//            this.obj.getSeq().resetValue();
+//            this.obj.setLogin(login);
+//            // 로그인이 성공하면 제어기에 정보를 요청한다.
+//            log.info("LoginResponse.response: {}, Request Subscriptions", ipAddress);
+//            LoginDeviceService.getInstance().initLoginDevice(
+//                    this.obj,
+//                    this.ctx.channel(),
+//                    this.config.isPublicationNonCryptObu(),
+//                    this.config.isSubscriptionStatus(),
+//                    this.config.isSubscriptionTraffic(),
+//                    this.config.getSubscriptionStatusCycle(),
+//                    this.config.getPublicationAntenna());
         }
         return loginAccept;
     }
 
     private int checkValidLoginInfo(String ipAddress, Login login) {
-        String senderTxt           = new String(login.getDatexSenderTxt().value);
-        String destinationTxt      = new String(login.getDatexDestinationTxt().value);
-        String loginUserName       = new String(login.getDatexLoginUserNameTxt().value);
-        String loginUserPswd       = new String(login.getDatexLoginPasswordTxt().value);
-        BigInteger durationMaxQty  = login.getDatexLoginHeartbeatDurationMaxQty().value;
-        BigInteger loginInitCd     = login.getDatexLoginInitiatorCd().value;
-        BigInteger responseTimeout = login.getDatexLoginResponseTimeOutQty().value;
-        BigInteger datagramSize    = login.getDatexLoginDatagramSizeQty().value;
-
-        /*
-       	datexSenderTxt: DSRC Main Control Unit,
-        datexDestinationTxt: DSRC Center Unit,
-        datexLoginUserNameTxt: 4150,
-        datexLoginPasswordTxt: 41544D535F525345,
-        datexLoginEncodingRulesId: {
-            2.1.1
-        },
-        datexLoginHeartbeatDurationMaxQty: 120,
-        datexLoginResponseTimeOutQty: 3,
-        datexLoginInitiatorCd: 1,
-        datexLoginDatagramSizeQty: 2048
-         */
-        /*
-        senderTxt: DSRC Main Control Unit,
-        destinationTxt: DSRC Center Unit,
-        loginUserName: AP,
-        loginUserPswd: ATMS_RSE, durationMaxQty: 120, loginInitCd: 1, responseTimeout: 3, datagramSize: 2048
-         */
-        log.info("LoginResponse.response: {}. senderTxt: {}, destinationTxt: {}, loginUserName: {}, loginUserPswd: {}, durationMaxQty: {}, loginInitCd: {}, responseTimeout: {}, datagramSize: {}",
-                ipAddress, senderTxt, destinationTxt, loginUserName, loginUserPswd, durationMaxQty, loginInitCd, responseTimeout, datagramSize);
-
-        return TbRseCtlrCnncHs.LOG_TYPE_LOGIN;
+//        String senderTxt           = new String(login.getDatexSenderTxt().value);
+//        String destinationTxt      = new String(login.getDatexDestinationTxt().value);
+//        String loginUserName       = new String(login.getDatexLoginUserNameTxt().value);
+//        String loginUserPswd       = new String(login.getDatexLoginPasswordTxt().value);
+//        BigInteger durationMaxQty  = login.getDatexLoginHeartbeatDurationMaxQty().value;
+//        BigInteger loginInitCd     = login.getDatexLoginInitiatorCd().value;
+//        BigInteger responseTimeout = login.getDatexLoginResponseTimeOutQty().value;
+//        BigInteger datagramSize    = login.getDatexLoginDatagramSizeQty().value;
+//
+//        /*
+//       	datexSenderTxt: DSRC Main Control Unit,
+//        datexDestinationTxt: DSRC Center Unit,
+//        datexLoginUserNameTxt: 4150,
+//        datexLoginPasswordTxt: 41544D535F525345,
+//        datexLoginEncodingRulesId: {
+//            2.1.1
+//        },
+//        datexLoginHeartbeatDurationMaxQty: 120,
+//        datexLoginResponseTimeOutQty: 3,
+//        datexLoginInitiatorCd: 1,
+//        datexLoginDatagramSizeQty: 2048
+//         */
+//        /*
+//        senderTxt: DSRC Main Control Unit,
+//        destinationTxt: DSRC Center Unit,
+//        loginUserName: AP,
+//        loginUserPswd: ATMS_RSE, durationMaxQty: 120, loginInitCd: 1, responseTimeout: 3, datagramSize: 2048
+//         */
+//        log.info("LoginResponse.response: {}. senderTxt: {}, destinationTxt: {}, loginUserName: {}, loginUserPswd: {}, durationMaxQty: {}, loginInitCd: {}, responseTimeout: {}, datagramSize: {}",
+//                ipAddress, senderTxt, destinationTxt, loginUserName, loginUserPswd, durationMaxQty, loginInitCd, responseTimeout, datagramSize);
+//
+//        return TbRseCtlrCnncHs.LOG_TYPE_LOGIN;
+        return 0;
     }
 
 }

+ 12 - 16
src/main/java/com/its/rota/server/xnet/server/process/response/LogoutResponse.java

@@ -1,21 +1,17 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseCtlrCnncHs;
-import com.its.dsrc.process.DbmsData;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.process.DbmsDataType;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.its.app.common.utils.NettyUtils;
+import com.its.app.common.utils.StringUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.process.dbms.DbmsData;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class LogoutResponse implements DsrcAsn1Response {
+public class LogoutResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -26,7 +22,7 @@ public class LogoutResponse implements DsrcAsn1Response {
         this.obj = obj;
         this.ctx = ctx;
         this.c2c = c2c;
-        this.dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+        this.dbmsDataProcess = StringUtils.getBean(DbmsDataProcess.class);
     }
 
     @Override
@@ -36,11 +32,11 @@ public class LogoutResponse implements DsrcAsn1Response {
 
         // 로그아웃 정보를 데이터베이스에 저장.
         if (this.dbmsDataProcess != null) {
-            TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
-            voLog.setRSE_CTLR_NMBR(this.obj.getID());
-            voLog.setLOG_ADDRESS(NettyUtils.getRemoteIpAddress(this.ctx.channel()));
-            voLog.setLoginInfo(this.c2c);
-            this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS, false, voLog));
+//            TbRseCtlrCnncHs voLog = new TbRseCtlrCnncHs();
+//            voLog.setRSE_CTLR_NMBR(this.obj.getID());
+//            voLog.setLOG_ADDRESS(NettyUtils.getRemoteIpAddress(this.ctx.channel()));
+//            voLog.setLoginInfo(this.c2c);
+//            this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_LOG_HS, false, voLog));
         }
         return true;
     }

+ 3 - 5
src/main/java/com/its/rota/server/xnet/server/process/response/NullResponse.java

@@ -1,16 +1,14 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class NullResponse implements DsrcAsn1Response {
+public class NullResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;

+ 43 - 51
src/main/java/com/its/rota/server/xnet/server/process/response/PublicationResponse.java

@@ -1,26 +1,18 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.eControlDevice;
-import com.beanit.asn1dsrc.enums.eObjectId;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.xnettcp.dsrc.process.service.ControlDeviceService;
-import com.its.dsrc.xnettcp.dsrc.process.service.OBUGatherInfoService;
+import com.beanit.its.*;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.List;
 
 @Slf4j
-public class PublicationResponse implements DsrcAsn1Response {
+public class PublicationResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -77,45 +69,45 @@ public class PublicationResponse implements DsrcAsn1Response {
     }
 
     private void responsePublicationData(EndApplicationMessage msg) throws IOException {
-        int objectId = DsrcAsn1Utils.getObjectId(msg.getEndApplicationMessageId().value);
-        if (objectId == eObjectId.OBJ_ControlDevice.getValue()) {
-            // RSE Status
-            ByteArrayInputStream berInputStream = new ByteArrayInputStream(msg.getEndApplicationMessageMsg().value);
-            ControlDeviceList devices = new ControlDeviceList();
-            devices.decode(berInputStream);
-            List<ControlDevice> list = devices.getControlDevice();
-            log.info("PublicationResponse.responsePublicationData: DSRC Status, objectId: {}, {} EA.", objectId, list.size());
-            for (ControlDevice controlDevice : list) {
-                if (controlDevice.getVpbdControlDeviceData() != null) {
-                    eControlDevice e = eControlDevice.getByValue(controlDevice.getVpbdControlID().value[0]);
-                    if (e == eControlDevice.Control_StatusRequest) {
-                        //TODO: DSRC Device Status
-                        log.info("PublicationResponse.responsePublicationData: {}, OBU Status {}", this.obj.getMcuID(), controlDevice);
-                        //ControlDeviceService.getInstance().decoding_ControlDevice_Status_AirPoint(this.obj, controlDevice);
-                        ControlDeviceService.getInstance().decoding_ControlDevice_Status_ITTelecom(this.obj, controlDevice);
-                    }
-                    else {
-                        log.error("PublicationResponse.responsePublicationData: Unknown: {}", e.toString());
-                    }
-                }
-                else {
-                    log.error("PublicationResponse.responsePublicationData: VpbdControlDeviceData Data Null");
-                }
-            }
-        }
-        else if (objectId == eObjectId.OBJ_OBUGatherInfo.getValue()) {
-            // OBE Traffic
-            //log.info("PublicationResponse.responsePublicationData: DSRC OBU Traffic");
-            ByteArrayInputStream berInputStream = new ByteArrayInputStream(msg.getEndApplicationMessageMsg().value);
-            OBUGatherInfoList obuInfos = new OBUGatherInfoList();
-            obuInfos.decode(berInputStream);
-            List<OBUGatherInfo> list = obuInfos.getOBUGatherInfo();
-            //TODO: OBU Gather Info
-            log.info("PublicationResponse.responsePublicationData: {}, OBU Traffic {} EA", this.obj.getMcuID(), list.size());
-            OBUGatherInfoService.getInstance().decoding_OBUGatherInfo(this.obj, list);
-        }
-        else {
-            log.error("responsePublicationData.responsePublicationData: Unknown ObjectId: {}", objectId);
-        }
+//        int objectId = DsrcAsn1Utils.getObjectId(msg.getEndApplicationMessageId().value);
+//        if (objectId == eObjectId.OBJ_ControlDevice.getValue()) {
+//            // RSE Status
+//            ByteArrayInputStream berInputStream = new ByteArrayInputStream(msg.getEndApplicationMessageMsg().value);
+//            ControlDeviceList devices = new ControlDeviceList();
+//            devices.decode(berInputStream);
+//            List<ControlDevice> list = devices.getControlDevice();
+//            log.info("PublicationResponse.responsePublicationData: DSRC Status, objectId: {}, {} EA.", objectId, list.size());
+//            for (ControlDevice controlDevice : list) {
+//                if (controlDevice.getVpbdControlDeviceData() != null) {
+//                    eControlDevice e = eControlDevice.getByValue(controlDevice.getVpbdControlID().value[0]);
+//                    if (e == eControlDevice.Control_StatusRequest) {
+//                        //TODO: DSRC Device Status
+//                        log.info("PublicationResponse.responsePublicationData: {}, OBU Status {}", this.obj.getMcuID(), controlDevice);
+//                        //ControlDeviceService.getInstance().decoding_ControlDevice_Status_AirPoint(this.obj, controlDevice);
+//                        ControlDeviceService.getInstance().decoding_ControlDevice_Status_ITTelecom(this.obj, controlDevice);
+//                    }
+//                    else {
+//                        log.error("PublicationResponse.responsePublicationData: Unknown: {}", e.toString());
+//                    }
+//                }
+//                else {
+//                    log.error("PublicationResponse.responsePublicationData: VpbdControlDeviceData Data Null");
+//                }
+//            }
+//        }
+//        else if (objectId == eObjectId.OBJ_OBUGatherInfo.getValue()) {
+//            // OBE Traffic
+//            //log.info("PublicationResponse.responsePublicationData: DSRC OBU Traffic");
+//            ByteArrayInputStream berInputStream = new ByteArrayInputStream(msg.getEndApplicationMessageMsg().value);
+//            OBUGatherInfoList obuInfos = new OBUGatherInfoList();
+//            obuInfos.decode(berInputStream);
+//            List<OBUGatherInfo> list = obuInfos.getOBUGatherInfo();
+//            //TODO: OBU Gather Info
+//            log.info("PublicationResponse.responsePublicationData: {}, OBU Traffic {} EA", this.obj.getMcuID(), list.size());
+//            OBUGatherInfoService.getInstance().decoding_OBUGatherInfo(this.obj, list);
+//        }
+//        else {
+//            log.error("responsePublicationData.responsePublicationData: Unknown ObjectId: {}", objectId);
+//        }
     }
 }

+ 24 - 28
src/main/java/com/its/rota/server/xnet/server/process/response/RejectResponse.java

@@ -1,24 +1,20 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1dsrc.dsrc.C2CAuthenticatedMessage;
-import com.beanit.asn1dsrc.dsrc.PDUs;
-import com.beanit.asn1dsrc.dsrc.Reject;
-import com.beanit.asn1dsrc.dsrc.RejectType;
-import com.its.app.AppUtils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.dao.mapper.RseCtlrMapper;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseCtrlHs;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.xnettcp.dsrc.handler.DsrcAsn1ServerIdleStatePacketHandler;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.PDUs;
+import com.beanit.its.Reject;
+import com.beanit.its.RejectType;
+import com.its.app.common.utils.NettyUtils;
+import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
+import com.its.rota.server.xnet.server.handler.ItsAsnServerIdleStatePacketHandler;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class RejectResponse implements DsrcAsn1Response {
+public class RejectResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -28,7 +24,7 @@ public class RejectResponse implements DsrcAsn1Response {
         this.obj = obj;
         this.ctx = ctx;
         this.c2c = c2c;
-        this.dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+        this.dbmsDataProcess = SpringUtils.getBean(DbmsDataProcess.class);
     }
 
     @Override
@@ -47,35 +43,35 @@ public class RejectResponse implements DsrcAsn1Response {
         Long  rejectPacketNmbr = reject.getDatexRejectPacketNbr().value.longValue();
         RejectType rejectType = reject.getDatexRejectType();
 
-        TbRseCtrlHs command = null;
+//        TbRseCtrlHs command = null;
         int rejectCode = 0;
         if (rejectType.getDatexRejectLoginCd() != null) {
             rejectCode = rejectType.getDatexRejectLoginCd().value.intValue();
             log.error("RejectResponse.response: {}. RejectLoginCd: dataPacketNmbr: {}, rejectPacketNmbr: {}, rejectCode: {}", ipAddress, dataPacketNmbr, rejectPacketNmbr, rejectCode);
             // TODO: 클라이언트와의 연결을 종료한다.
-            DsrcAsn1ServerIdleStatePacketHandler.disconnectChannel(this.obj, this.ctx.channel());
+            ItsAsnServerIdleStatePacketHandler.disconnectChannel(this.obj, this.ctx.channel());
         }
         else if (rejectType.getDatexRejectSubscriptionCd() != null) {
             rejectCode = rejectType.getDatexRejectSubscriptionCd().value.intValue();
             log.error("RejectResponse.response: {}. RejectSubscription: dataPacketNmbr: {}, rejectPacketNmbr: {}, rejectCode: {}", ipAddress, dataPacketNmbr, rejectPacketNmbr, rejectCode);
-            this.obj.removeRegisteredCommands(rejectPacketNmbr, true);
-            command = this.obj.getUserCommands(rejectPacketNmbr);
+//            this.obj.removeRegisteredCommands(rejectPacketNmbr, true);
+//            command = this.obj.getUserCommands(rejectPacketNmbr);
         }
         else if (rejectType.getDatexRejectPublicationCd() != null) {
             rejectCode = rejectType.getDatexRejectPublicationCd().value.intValue();
             log.error("RejectResponse.response: {}. RejectPublication: dataPacketNmbr: {}, rejectPacketNmbr: {}, rejectCode: {}", ipAddress, dataPacketNmbr, rejectPacketNmbr, rejectCode);
-            this.obj.removeRegisteredCommands(rejectPacketNmbr, true);
-            command = this.obj.getUserCommands(rejectPacketNmbr);
+//            this.obj.removeRegisteredCommands(rejectPacketNmbr, true);
+//            command = this.obj.getUserCommands(rejectPacketNmbr);
         }
 
-        if (command != null) {
-            log.error("RejectResponse.response: {}. Reject User Command: dataPacketNmbr: {}, rejectPacketNmbr: {}, rejectCode: {}", ipAddress, dataPacketNmbr, rejectPacketNmbr, rejectCode);
-            this.obj.removeUserCommands(rejectPacketNmbr);
-            // TODO: 제어명령 전송정보 전송(실패)
-            command.setRspsType("4");  // 명령 실패(REJECT)로 설정
-            RseCtlrMapper mapper = (RseCtlrMapper) AppUtils.getBean(RseCtlrMapper.class);
-            mapper.updateRseCtrlHs(command);
-        }
+//        if (command != null) {
+//            log.error("RejectResponse.response: {}. Reject User Command: dataPacketNmbr: {}, rejectPacketNmbr: {}, rejectCode: {}", ipAddress, dataPacketNmbr, rejectPacketNmbr, rejectCode);
+////            this.obj.removeUserCommands(rejectPacketNmbr);
+////            // TODO: 제어명령 전송정보 전송(실패)
+////            command.setRspsType("4");  // 명령 실패(REJECT)로 설정
+////            RseCtlrMapper mapper = (RseCtlrMapper) AppUtils.getBean(RseCtlrMapper.class);
+////            mapper.updateRseCtrlHs(command);
+//        }
         return true;
     }
 }

+ 60 - 62
src/main/java/com/its/rota/server/xnet/server/process/response/SubscriptionResponse.java

@@ -1,20 +1,18 @@
 package com.its.rota.server.xnet.server.process.response;
 
-import com.beanit.asn1bean.ber.types.BerEnum;
-import com.beanit.its.*;
+import com.beanit.its.C2CAuthenticatedMessage;
+import com.beanit.its.PDUs;
 import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
 import com.its.rota.server.xnet.server.process.service.SubscriptionService;
-import com.its.rota.server.xnet.server.process.service.impl.SubscriptionRegisterService;
-import com.its.rota.server.xnet.server.process.service.impl.SubscriptionSingleService;
 import io.netty.channel.ChannelFuture;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class SubscriptionResponse implements DsrcAsn1Response {
-    private TbRseCtlr obj;
+public class SubscriptionResponse implements ItsAsnResponse {
+    private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
 
@@ -34,63 +32,63 @@ public class SubscriptionResponse implements DsrcAsn1Response {
         SubscriptionService subscriptionService = null;
         C2CAuthenticatedMessage resC2c = null;
         PDUs pdus = this.c2c.getPdu();
-        Subscription subscription = pdus.getSubscription();
-        if (subscription != null) {
-            int subscribeSerialNbr = subscription.getDatexSubscribeSerialNbr().intValue();
-            SubscriptionType subscriptionType = subscription.getDatexSubscribeType();
-            BerEnum cancelReasonCd = subscriptionType.getDatexSubscribeCancelReasonCd();
-            if (subscriptionType != null) {
-                SubscriptionData subscriptionData = subscriptionType.getSubscription();
-                if (subscriptionData != null) {
-                    boolean persistentBool = subscriptionData.getDatexSubscribePersistentBool().value;
-                    int statusCd           = subscriptionData.getDatexSubscribeStatusCd().value.intValue();   // new, update
-                    int publishFormatCd    = subscriptionData.getDatexSubscribePublishFormatCd().value.intValue();
-                    int priorityNbr        = subscriptionData.getDatexSubscriptionPriorityNbr().value.intValue();
-                    boolean guaranteeBool  = subscriptionData.getDatexSubscribeGuaranteeBool().value;
+//        Subscription subscription = pdus.getSubscription();
+//        if (subscription != null) {
+//            int subscribeSerialNbr = subscription.getDatexSubscribeSerialNbr().intValue();
+//            SubscriptionType subscriptionType = subscription.getDatexSubscribeType();
+//            BerEnum cancelReasonCd = subscriptionType.getDatexSubscribeCancelReasonCd();
+//            if (subscriptionType != null) {
+//                SubscriptionData subscriptionData = subscriptionType.getSubscription();
+//                if (subscriptionData != null) {
+//                    boolean persistentBool = subscriptionData.getDatexSubscribePersistentBool().value;
+//                    int statusCd           = subscriptionData.getDatexSubscribeStatusCd().value.intValue();   // new, update
+//                    int publishFormatCd    = subscriptionData.getDatexSubscribePublishFormatCd().value.intValue();
+//                    int priorityNbr        = subscriptionData.getDatexSubscriptionPriorityNbr().value.intValue();
+//                    boolean guaranteeBool  = subscriptionData.getDatexSubscribeGuaranteeBool().value;
+//
+//                    objectId = DsrcAsn1Utils.getObjectId(subscriptionData.getDatexSubscribePdu().getEndApplicationMessageId().value);
+//                    //log.info("SubscriptionResponse.response: objectId: {}", objectId);
+//
+//                    if (objectId != eObjectId.OBJ_ProbeVehicleDetectionRoadSide.getValue() &&
+//                        objectId  > eObjectId.OBJ_DSRCRecentOBUTransactionInfo.getValue()) {
+//                        // Reject
+//                        resC2c = DsrcAsn1Reject.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c,
+//                                eRejectSubscription.Reject_Subscription_cd_invalidSubscriptionMsgId.getValue());
+//                        log.info("SubscriptionResponse.response: {}, Reject, objectId: {}", ipAddress, objectId);
+//                    }
+//                    else {
+//                        SubscriptionMode subscriptionMode = subscriptionData.getDatexSubscribeMode();
+//                        if (subscriptionMode != null) {
+//                            // subscriptionMode = single, event-driven, periodic
+//                            if (subscriptionMode.getSingle() != null) {
+//                                //log.info("SubscriptionResponse.response: {}, SubscriptionSingleService", ipAddress);
+//                                subscriptionService = SubscriptionSingleService.getInstance();
+//                            } else if (subscriptionMode.getEventDriven() != null) {
+//                                //log.info("SubscriptionResponse.response: {}, SubscriptionRegisterService[EventDriven]", ipAddress);
+//                                subscriptionService = SubscriptionRegisterService.getInstance();
+//                            } else if (subscriptionMode.getPeriodic() != null) {
+//                                //log.info("SubscriptionResponse.response: {}, SubscriptionRegisterService[Periodic]", ipAddress);
+//                                subscriptionService = SubscriptionRegisterService.getInstance();
+//                            }
+//                            if (guaranteeBool) {
+//                                resC2c = DsrcAsn1Accept.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c);
+//                            }
+//                        } else {
+//                            log.warn("SubscriptionResponse.response: {}, SubscriptionMode null", ipAddress);
+//                        }
+//                    }
+//                }
+//            } else if (cancelReasonCd != null) {
+//                // Cancel
+//                int cancelReasonId = cancelReasonCd.value.intValue();
+//                resC2c = DsrcAsn1Accept.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c);
+//                log.info("SubscriptionResponse.response: {}, Accept, cancelReasonCd: {}", ipAddress, cancelReasonId);
+//            }
+//        }
 
-                    objectId = DsrcAsn1Utils.getObjectId(subscriptionData.getDatexSubscribePdu().getEndApplicationMessageId().value);
-                    //log.info("SubscriptionResponse.response: objectId: {}", objectId);
-
-                    if (objectId != eObjectId.OBJ_ProbeVehicleDetectionRoadSide.getValue() &&
-                        objectId  > eObjectId.OBJ_DSRCRecentOBUTransactionInfo.getValue()) {
-                        // Reject
-                        resC2c = DsrcAsn1Reject.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c,
-                                eRejectSubscription.Reject_Subscription_cd_invalidSubscriptionMsgId.getValue());
-                        log.info("SubscriptionResponse.response: {}, Reject, objectId: {}", ipAddress, objectId);
-                    }
-                    else {
-                        SubscriptionMode subscriptionMode = subscriptionData.getDatexSubscribeMode();
-                        if (subscriptionMode != null) {
-                            // subscriptionMode = single, event-driven, periodic
-                            if (subscriptionMode.getSingle() != null) {
-                                //log.info("SubscriptionResponse.response: {}, SubscriptionSingleService", ipAddress);
-                                subscriptionService = SubscriptionSingleService.getInstance();
-                            } else if (subscriptionMode.getEventDriven() != null) {
-                                //log.info("SubscriptionResponse.response: {}, SubscriptionRegisterService[EventDriven]", ipAddress);
-                                subscriptionService = SubscriptionRegisterService.getInstance();
-                            } else if (subscriptionMode.getPeriodic() != null) {
-                                //log.info("SubscriptionResponse.response: {}, SubscriptionRegisterService[Periodic]", ipAddress);
-                                subscriptionService = SubscriptionRegisterService.getInstance();
-                            }
-                            if (guaranteeBool) {
-                                resC2c = DsrcAsn1Accept.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c);
-                            }
-                        } else {
-                            log.warn("SubscriptionResponse.response: {}, SubscriptionMode null", ipAddress);
-                        }
-                    }
-                }
-            } else if (cancelReasonCd != null) {
-                // Cancel
-                int cancelReasonId = cancelReasonCd.value.intValue();
-                resC2c = DsrcAsn1Accept.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c);
-                log.info("SubscriptionResponse.response: {}, Accept, cancelReasonCd: {}", ipAddress, cancelReasonId);
-            }
-        }
-
-        if (subscriptionService != null) {
-            subscriptionService.response(this.obj, this.ctx.channel(), objectId, subscription);
-        }
+//        if (subscriptionService != null) {
+//            subscriptionService.response(this.obj, this.ctx.channel(), objectId, subscription);
+//        }
 
         if (resC2c != null) {
             // send accept or reject

+ 2 - 3
src/main/java/com/its/rota/server/xnet/server/process/response/TerminateResponse.java

@@ -4,12 +4,11 @@ import com.beanit.its.C2CAuthenticatedMessage;
 import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
-import com.its.rota.server.xnet.server.process.service.ControlDeviceService;
 import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class TerminateResponse implements DsrcAsn1Response {
+public class TerminateResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;
@@ -31,7 +30,7 @@ public class TerminateResponse implements DsrcAsn1Response {
         log.info("TerminateResponse.response: {}", ipAddress);
 
         //Terminate terminate = new Terminate(eTerminate.Terminate_ClientCommProblesm.getValue());
-        ControlDeviceService.getInstance().sendTerminate(this.obj, this.ctx.channel(), eTerminate.Terminate_Other.getValue());
+//        ControlDeviceService.getInstance().sendTerminate(this.obj, this.ctx.channel(), eTerminate.Terminate_Other.getValue());
         return true;
     }
 }

+ 1 - 1
src/main/java/com/its/rota/server/xnet/server/process/response/TransferDoneResponse.java

@@ -8,7 +8,7 @@ import io.netty.channel.ChannelHandlerContext;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
-public class TransferDoneResponse implements DsrcAsn1Response {
+public class TransferDoneResponse implements ItsAsnResponse {
     private CenterDto obj;
     private ChannelHandlerContext ctx;
     private C2CAuthenticatedMessage c2c;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 647 - 660
src/main/java/com/its/rota/server/xnet/server/process/service/ControlDeviceService.java


+ 382 - 395
src/main/java/com/its/rota/server/xnet/server/process/service/LoginDeviceService.java

@@ -1,26 +1,12 @@
 package com.its.rota.server.xnet.server.process.service;
 
 import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
-import com.beanit.asn1bean.ber.types.*;
-import com.beanit.asn1bean.ber.types.string.BerUTF8String;
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.*;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.utils.NettyUtils;
-import com.its.app.utils.SysUtils;
-import com.its.dsrc.config.RunningConfig;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseObuNonCrypt;
-import com.its.dsrc.global.AppRepository;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.config.ApplicationConfig;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
 import lombok.extern.slf4j.Slf4j;
 
-import java.math.BigInteger;
-import java.util.Calendar;
-
 @Slf4j
 public class LoginDeviceService {
     private static LoginDeviceService _instance = null;
@@ -44,19 +30,19 @@ public class LoginDeviceService {
 
         // OBU Non Crypt 데이터 요청 Subscription
         if (isObuNonCrypt) {
-            log.info("initLoginDevice.isObuNonCrypt. {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
+//            log.info("initLoginDevice.isObuNonCrypt. {}, {}, {}", obj.getCenterId(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
             //requestPublicationNonCryptObu(obj, channel);
         }
 
         // DSRC 상태정보 요청 Subscription
         if (isDsrcStatus) {
-            log.info("initLoginDevice.isDsrcStatus. {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
+//            log.info("initLoginDevice.isDsrcStatus. {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
             //requestSubscriptions(obj, channel, subscriptionStatusCycle, 1);
         }
 
         // OBU 교통정보 요청 Subscription
         if (isTraffic) {
-            log.info("initLoginDevice.isTraffic. {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
+//            log.info("initLoginDevice.isTraffic. {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
             requestSubscriptions(obj, channel, 0, 2);
         }
 
@@ -74,7 +60,8 @@ public class LoginDeviceService {
      */
     public boolean requestSubscriptionDeviceCommand(CenterDto obj, Channel channel, int controlDeviceId, int commandType)
     {
-        return ControlDeviceService.getInstance().requestSubscriptionDeviceCommand(false, obj, channel, controlDeviceId, commandType, null);
+        return false;
+//        return ControlDeviceService.getInstance().requestSubscriptionDeviceCommand(false, obj, channel, controlDeviceId, commandType, null);
     }
 
     /*
@@ -83,7 +70,7 @@ public class LoginDeviceService {
     public boolean requestSubscriptions(CenterDto obj, Channel channel, int registeredUpdateDelayQty, int subscriptionsType) {
 
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
-        log.info("LoginDeviceService.requestSubscriptions: {}, {}, registeredUpdateDelayQty: {}, subscriptionsType: {}", obj.getID(), obj.getRSE_ID(), registeredUpdateDelayQty, subscriptionsType);
+//        log.info("LoginDeviceService.requestSubscriptions: {}, {}, registeredUpdateDelayQty: {}, subscriptionsType: {}", obj.getID(), obj.getRSE_ID(), registeredUpdateDelayQty, subscriptionsType);
 
         int[] messageId = {1, 0, 15784, 4, 0, 7};
 //        pObject->numids = 6;
@@ -97,90 +84,90 @@ public class LoginDeviceService {
 //            case itObuGatherInfo: pObject->subid[3] = 8; pObject->subid[4] = 0; pObject->subid[5] = 8; break;
 //            default: break;
 //        }
-        int subscribeSerialNbr = obj.getSeq().nextValue();
+//        int subscribeSerialNbr = obj.getSeq().nextValue();
 
         try {
             registeredUpdateDelayQty = 0;
 
-            ControlDevice controlDevice = null;
-            Registered registered = new Registered();
-            Registered.Continuous continuous = new Registered.Continuous();
-            SubscriptionMode subscriptionMode = new SubscriptionMode();
-
-            if (subscriptionsType == 1) {
-                // DSRC 상태정보 요청
-                controlDevice = ControlDeviceService.getInstance().makeControlDevice_DeviceCommand(obj, eControlCommand.ControlCommand_Status_Request, eControlDeviceId.ControlDeviceId_Controller);
-                continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(registeredUpdateDelayQty));
-                continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
-                continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
-                registered.setContinuous(continuous);
-                subscriptionMode.setPeriodic(registered);
-                log.info("LoginDeviceService.requestSubscriptions: {}, DSRC Status_Request, subscribeSerialNbr: {}", ipAddress, subscribeSerialNbr);
-            }
-            else if (subscriptionsType == 2) {
-                // OBU 교통정보 요청
-                controlDevice = ControlDeviceService.getInstance().makeControlDevice_DSRCTrafficInfoRequest(obj, eControlRequest.Request_TrafficInfo);
-                continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(registeredUpdateDelayQty));
-                continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
-                continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
-                registered.setContinuous(continuous);
-                subscriptionMode.setEventDriven(registered);
-                log.info("LoginDeviceService.requestSubscriptions: {}, DSRC OBU TrafficInfo_Request, subscribeSerialNbr: {}", ipAddress, subscribeSerialNbr);
-            }
-
-            if (controlDevice == null) {
-                return false;
-            }
+//            ControlDevice controlDevice = null;
+//            Registered registered = new Registered();
+//            Registered.Continuous continuous = new Registered.Continuous();
+//            SubscriptionMode subscriptionMode = new SubscriptionMode();
+//
+//            if (subscriptionsType == 1) {
+//                // DSRC 상태정보 요청
+//                controlDevice = ControlDeviceService.getInstance().makeControlDevice_DeviceCommand(obj, eControlCommand.ControlCommand_Status_Request, eControlDeviceId.ControlDeviceId_Controller);
+//                continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(registeredUpdateDelayQty));
+//                continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
+//                continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
+//                registered.setContinuous(continuous);
+//                subscriptionMode.setPeriodic(registered);
+//                log.info("LoginDeviceService.requestSubscriptions: {}, DSRC Status_Request, subscribeSerialNbr: {}", ipAddress, subscribeSerialNbr);
+//            }
+//            else if (subscriptionsType == 2) {
+//                // OBU 교통정보 요청
+//                controlDevice = ControlDeviceService.getInstance().makeControlDevice_DSRCTrafficInfoRequest(obj, eControlRequest.Request_TrafficInfo);
+//                continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(registeredUpdateDelayQty));
+//                continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
+//                continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
+//                registered.setContinuous(continuous);
+//                subscriptionMode.setEventDriven(registered);
+//                log.info("LoginDeviceService.requestSubscriptions: {}, DSRC OBU TrafficInfo_Request, subscribeSerialNbr: {}", ipAddress, subscribeSerialNbr);
+//            }
+//
+//            if (controlDevice == null) {
+//                return false;
+//            }
 
             // ControlDeviceList set
             ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(1024);
-            ControlDeviceList controlDeviceList = new ControlDeviceList();
-            controlDeviceList.getControlDevice().add(controlDevice);
-            controlDeviceList.encode(msgBuff);
-
-            // EndApplicationMessage set
-            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
-            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
-            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
-
-            SubscriptionData subscriptionData = new SubscriptionData();
-            subscriptionData.setDatexSubscribePersistentBool(new BerBoolean(false));
-            subscriptionData.setDatexSubscribeStatusCd(new BerEnum(0));         // 0: New, 1: Update
-            subscriptionData.setDatexSubscribeMode(subscriptionMode);
-            subscriptionData.setDatexSubscribePublishFormatCd(new BerEnum(3));  // 0: other, 1: ftp, 2: tftp, 3: dataPacket
-            //subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(1));
-            subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(10));
-            subscriptionData.setDatexSubscribeGuaranteeBool(new BerBoolean(true));
-            subscriptionData.setDatexSubscribePdu(endApplicationMessage);
-
-            SubscriptionType subscriptionType = new SubscriptionType();
-            subscriptionType.setSubscription(subscriptionData);
-
-            Subscription subscription = new Subscription();
-            subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
-            subscription.setDatexSubscribeType(subscriptionType);
-
-            PDUs pdus = new PDUs();
-            pdus.setSubscription(subscription);
-            byte[] auth = { (byte) eAuthInfo.AI_Subscription.getValue() };
-            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
-            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-            c2c.setDatexDataPacketNumber(new BerInteger(subscribeSerialNbr));
-            c2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-            c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
-            c2c.setPdu(pdus);
-
-            ChannelFuture f = channel.writeAndFlush(c2c);
-            f.awaitUninterruptibly();
-            if (f.isDone() || f.isSuccess()) {
-                log.info("LoginDeviceService.requestSubscriptions: {}, {}, subscriptionsType: {}, send ok", obj.getID(), obj.getRSE_ID(), subscriptionsType);
-            }
-            else {
-                log.error("LoginDeviceService.requestSubscriptions: {}, {}, subscriptionsType: {}, send failed.", obj.getID(), obj.getRSE_ID(), subscriptionsType);
-            }
+//            ControlDeviceList controlDeviceList = new ControlDeviceList();
+//            controlDeviceList.getControlDevice().add(controlDevice);
+//            controlDeviceList.encode(msgBuff);
+//
+//            // EndApplicationMessage set
+//            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
+//            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
+//            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
+//
+//            SubscriptionData subscriptionData = new SubscriptionData();
+//            subscriptionData.setDatexSubscribePersistentBool(new BerBoolean(false));
+//            subscriptionData.setDatexSubscribeStatusCd(new BerEnum(0));         // 0: New, 1: Update
+//            subscriptionData.setDatexSubscribeMode(subscriptionMode);
+//            subscriptionData.setDatexSubscribePublishFormatCd(new BerEnum(3));  // 0: other, 1: ftp, 2: tftp, 3: dataPacket
+//            //subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(1));
+//            subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(10));
+//            subscriptionData.setDatexSubscribeGuaranteeBool(new BerBoolean(true));
+//            subscriptionData.setDatexSubscribePdu(endApplicationMessage);
+//
+//            SubscriptionType subscriptionType = new SubscriptionType();
+//            subscriptionType.setSubscription(subscriptionData);
+//
+//            Subscription subscription = new Subscription();
+//            subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
+//            subscription.setDatexSubscribeType(subscriptionType);
+//
+//            PDUs pdus = new PDUs();
+//            pdus.setSubscription(subscription);
+//            byte[] auth = { (byte) eAuthInfo.AI_Subscription.getValue() };
+//            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
+//            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//            c2c.setDatexDataPacketNumber(new BerInteger(subscribeSerialNbr));
+//            c2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
+//            c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
+//            c2c.setPdu(pdus);
+//
+//            ChannelFuture f = channel.writeAndFlush(c2c);
+//            f.awaitUninterruptibly();
+//            if (f.isDone() || f.isSuccess()) {
+//                log.info("LoginDeviceService.requestSubscriptions: {}, {}, subscriptionsType: {}, send ok", obj.getID(), obj.getRSE_ID(), subscriptionsType);
+//            }
+//            else {
+//                log.error("LoginDeviceService.requestSubscriptions: {}, {}, subscriptionsType: {}, send failed.", obj.getID(), obj.getRSE_ID(), subscriptionsType);
+//            }
         }
         catch(Exception e) {
-            log.error("LoginDeviceService.requestSubscriptions: {}, {}, subscriptionsType: {}, Exception: {}", obj.getID(), obj.getRSE_ID(), subscriptionsType, e.toString());
+//            log.error("LoginDeviceService.requestSubscriptions: {}, {}, subscriptionsType: {}, Exception: {}", obj.getID(), obj.getRSE_ID(), subscriptionsType, e.toString());
         }
         return true;
     }
@@ -190,116 +177,116 @@ public class LoginDeviceService {
      */
     public boolean requestPublicationNonCryptObu(CenterDto obj, Channel channel) {
 
-        log.info("LoginDeviceService.requestPublicationNonCryptObu: {}, {}", obj.getID(), obj.getRSE_ID());
-        int obuCnt = AppRepository.getInstance().rseObuNonCryptList.size();
-        if (obuCnt == 0) {
-            log.info("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, No Data...", obj.getID(), obj.getRSE_ID());
-            return true;
-        }
-
-        int subscribeSerialNbr = obj.getSeq().nextValue();
-        int[] messageId = {1, 0, 15784, 4, 0, 7};
-        byte[] controlId = { (byte) eControlDevice.Control_BasicInfo.getValue() };
-        byte[] operCode = {0x00};  // 0x00(추가), 0x01(삭제)
-        String roadStationId = obj.getRSE_MCU_ID();//obj.getROAD_SPOT_ID();
-        int updateNo = 0;
-
-        try {
-            // 1. OUB Non Crypt Data encoding
-            DataOfNonCryptoObu dataObu = new DataOfNonCryptoObu();
-            DataOfNonCryptoObu.CryptObuList obuList = new DataOfNonCryptoObu.CryptObuList();
-
-            for (TbRseObuNonCrypt vo : AppRepository.getInstance().rseObuNonCryptList) {
-                // 프로토콜 문서상 OBU ID는 최대 8자리임
-                String fullObuId = vo.getOBU_ID();
-                int len = fullObuId.length() / 2;
-                byte[] obuId = new byte[8];
-                for (int ii = 0; ii < len; ii++) {
-                    String temp = fullObuId.substring(ii * 2, ii * 2 + 2);   // 2자리씩 잘라냄
-                    byte tempId[] = new BigInteger(temp, 16).toByteArray();
-                    obuId[ii] = tempId[tempId.length - 1];
-                }
-
-                CryptObu obu = new CryptObu();
-                obu.setOperCode(new BerOctetString(operCode));          // 0x00 : 추가 , 0x01: 삭제
-                obu.setObuID(new BerOctetString(obuId));
-                obuList.getCryptObu().add(obu);
-            }
-            // 주3) infoID
-            //    1 : DataOfCollectionPointInfo (가상 수집지점 정보)
-            //    2 : DirectionDecisionInfo (방향 판단 정보)
-            //    3 : DataOfNonCryptoObu (비 암호화 단말기 정보)
-            dataObu.setInfoID(new BerInteger(eControlRequest.Request_BasicInfo_NonCrypt.getValue()));
-            dataObu.setUpdateNo(new BerInteger(updateNo));                              // 주4) updateNo : 해당정보의 변경이력 번호
-            dataObu.setGenerationTime(new BerGeneralizedTime(SysUtils.getSysTime()));   // 주5) generationTime : 해당 정보의 생성 일자 시간
-            dataObu.setCryptObuList(obuList);                                           // CryptObuList
-
-            // 2. BasicBaseInfo set
-            BasicBaseInfo basicBaseInfo = new BasicBaseInfo();
-            basicBaseInfo.setRoadStationID(new BerOctetString(roadStationId.getBytes()));    // roadStationId, 최소 13, 최대 20
-            basicBaseInfo.setRoadStationType(new BerInteger(107));                      // stationType
-            basicBaseInfo.setDataOfNonCryptoObuList(dataObu);                                // NonCryptoObuList
-
-            // 3. ControlDevice set
-            ReverseByteArrayOutputStream deviceBuff = new ReverseByteArrayOutputStream(2048);
-            basicBaseInfo.encode(deviceBuff);
-
-            ControlDevice controlDevice = new ControlDevice();
-            controlDevice.setVpbdControlID(new BerOctetString(controlId));
-            controlDevice.setVpbdControlDeviceData(new BerOctetString(deviceBuff.getArray()));
-
-            // 4. ControlDeviceList set
-            ReverseByteArrayOutputStream deviceListBuff = new ReverseByteArrayOutputStream(2048);
-            ControlDeviceList controlDeviceList = new ControlDeviceList();
-            controlDeviceList.getControlDevice().add(controlDevice);
-            controlDeviceList.encode(deviceListBuff);
-
-            // 5. EndApplicationMessage set
-            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
-            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
-            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(deviceListBuff.getArray()));
-
-            // 6. Publication
-            PublicationType publicationType = new PublicationType();
-            publicationType.setDatexPublishData(endApplicationMessage);
-
-            PublicationData publicationData = new PublicationData();
-            publicationData.setDatexPublishSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
-            publicationData.setDatexPublishSerialNbr(new BerInteger(subscribeSerialNbr));
-            publicationData.setDatexPublishLatePublicationFlag(new BerBoolean(true));
-            publicationData.setDatexPublishType(publicationType);
-
-            PublishFormat.DatexPublishData publishData = new PublishFormat.DatexPublishData();
-            publishData.getPublicationData().add(publicationData);
-
-            PublishFormat publishFormat = new PublishFormat();
-            publishFormat.setDatexPublishData(publishData);
-
-            Publication publication = new Publication();
-            publication.setDatexPublishFormat(publishFormat);
-            publication.setDatexPublishGuaranteedBool(new BerBoolean(true));
-
-            PDUs pdus = new PDUs();
-            pdus.setPublication(publication);
-            byte[] auth = {(byte) eAuthInfo.AI_Publication.getValue() };
-            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
-            c2c.setDatexDataPacketNumber(new BerInteger(subscribeSerialNbr));
-            c2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-            c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
-            c2c.setPdu(pdus);
-
-            ChannelFuture f = channel.writeAndFlush(c2c);
-            f.awaitUninterruptibly();
-            if (f.isDone() || f.isSuccess()) {
-                log.info("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, send ok", obj.getID(), obj.getRSE_ID());
-            } else {
-                log.error("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, send failed.", obj.getID(), obj.getRSE_ID());
-            }
-        }
-        catch(Exception e) {
-            log.error("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, Exception: {}", obj.getID(), obj.getRSE_ID(), e.toString());
-        }
+//        log.info("LoginDeviceService.requestPublicationNonCryptObu: {}, {}", obj.getID(), obj.getRSE_ID());
+//        int obuCnt = AppRepository.getInstance().rseObuNonCryptList.size();
+//        if (obuCnt == 0) {
+//            log.info("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, No Data...", obj.getID(), obj.getRSE_ID());
+//            return true;
+//        }
+//
+//        int subscribeSerialNbr = obj.getSeq().nextValue();
+//        int[] messageId = {1, 0, 15784, 4, 0, 7};
+//        byte[] controlId = { (byte) eControlDevice.Control_BasicInfo.getValue() };
+//        byte[] operCode = {0x00};  // 0x00(추가), 0x01(삭제)
+//        String roadStationId = obj.getRSE_MCU_ID();//obj.getROAD_SPOT_ID();
+//        int updateNo = 0;
+//
+//        try {
+//            // 1. OUB Non Crypt Data encoding
+//            DataOfNonCryptoObu dataObu = new DataOfNonCryptoObu();
+//            DataOfNonCryptoObu.CryptObuList obuList = new DataOfNonCryptoObu.CryptObuList();
+//
+//            for (TbRseObuNonCrypt vo : AppRepository.getInstance().rseObuNonCryptList) {
+//                // 프로토콜 문서상 OBU ID는 최대 8자리임
+//                String fullObuId = vo.getOBU_ID();
+//                int len = fullObuId.length() / 2;
+//                byte[] obuId = new byte[8];
+//                for (int ii = 0; ii < len; ii++) {
+//                    String temp = fullObuId.substring(ii * 2, ii * 2 + 2);   // 2자리씩 잘라냄
+//                    byte tempId[] = new BigInteger(temp, 16).toByteArray();
+//                    obuId[ii] = tempId[tempId.length - 1];
+//                }
+//
+//                CryptObu obu = new CryptObu();
+//                obu.setOperCode(new BerOctetString(operCode));          // 0x00 : 추가 , 0x01: 삭제
+//                obu.setObuID(new BerOctetString(obuId));
+//                obuList.getCryptObu().add(obu);
+//            }
+//            // 주3) infoID
+//            //    1 : DataOfCollectionPointInfo (가상 수집지점 정보)
+//            //    2 : DirectionDecisionInfo (방향 판단 정보)
+//            //    3 : DataOfNonCryptoObu (비 암호화 단말기 정보)
+//            dataObu.setInfoID(new BerInteger(eControlRequest.Request_BasicInfo_NonCrypt.getValue()));
+//            dataObu.setUpdateNo(new BerInteger(updateNo));                              // 주4) updateNo : 해당정보의 변경이력 번호
+//            dataObu.setGenerationTime(new BerGeneralizedTime(SysUtils.getSysTime()));   // 주5) generationTime : 해당 정보의 생성 일자 시간
+//            dataObu.setCryptObuList(obuList);                                           // CryptObuList
+//
+//            // 2. BasicBaseInfo set
+//            BasicBaseInfo basicBaseInfo = new BasicBaseInfo();
+//            basicBaseInfo.setRoadStationID(new BerOctetString(roadStationId.getBytes()));    // roadStationId, 최소 13, 최대 20
+//            basicBaseInfo.setRoadStationType(new BerInteger(107));                      // stationType
+//            basicBaseInfo.setDataOfNonCryptoObuList(dataObu);                                // NonCryptoObuList
+//
+//            // 3. ControlDevice set
+//            ReverseByteArrayOutputStream deviceBuff = new ReverseByteArrayOutputStream(2048);
+//            basicBaseInfo.encode(deviceBuff);
+//
+//            ControlDevice controlDevice = new ControlDevice();
+//            controlDevice.setVpbdControlID(new BerOctetString(controlId));
+//            controlDevice.setVpbdControlDeviceData(new BerOctetString(deviceBuff.getArray()));
+//
+//            // 4. ControlDeviceList set
+//            ReverseByteArrayOutputStream deviceListBuff = new ReverseByteArrayOutputStream(2048);
+//            ControlDeviceList controlDeviceList = new ControlDeviceList();
+//            controlDeviceList.getControlDevice().add(controlDevice);
+//            controlDeviceList.encode(deviceListBuff);
+//
+//            // 5. EndApplicationMessage set
+//            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
+//            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
+//            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(deviceListBuff.getArray()));
+//
+//            // 6. Publication
+//            PublicationType publicationType = new PublicationType();
+//            publicationType.setDatexPublishData(endApplicationMessage);
+//
+//            PublicationData publicationData = new PublicationData();
+//            publicationData.setDatexPublishSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
+//            publicationData.setDatexPublishSerialNbr(new BerInteger(subscribeSerialNbr));
+//            publicationData.setDatexPublishLatePublicationFlag(new BerBoolean(true));
+//            publicationData.setDatexPublishType(publicationType);
+//
+//            PublishFormat.DatexPublishData publishData = new PublishFormat.DatexPublishData();
+//            publishData.getPublicationData().add(publicationData);
+//
+//            PublishFormat publishFormat = new PublishFormat();
+//            publishFormat.setDatexPublishData(publishData);
+//
+//            Publication publication = new Publication();
+//            publication.setDatexPublishFormat(publishFormat);
+//            publication.setDatexPublishGuaranteedBool(new BerBoolean(true));
+//
+//            PDUs pdus = new PDUs();
+//            pdus.setPublication(publication);
+//            byte[] auth = {(byte) eAuthInfo.AI_Publication.getValue() };
+//            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
+//            c2c.setDatexDataPacketNumber(new BerInteger(subscribeSerialNbr));
+//            c2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
+//            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//            c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
+//            c2c.setPdu(pdus);
+//
+//            ChannelFuture f = channel.writeAndFlush(c2c);
+//            f.awaitUninterruptibly();
+//            if (f.isDone() || f.isSuccess()) {
+//                log.info("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, send ok", obj.getID(), obj.getRSE_ID());
+//            } else {
+//                log.error("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, send failed.", obj.getID(), obj.getRSE_ID());
+//            }
+//        }
+//        catch(Exception e) {
+//            log.error("LoginDeviceService.requestPublicationNonCryptObu: {}, {}, Exception: {}", obj.getID(), obj.getRSE_ID(), e.toString());
+//        }
         return true;
     }
 
@@ -312,64 +299,64 @@ public class LoginDeviceService {
      */
     public boolean requestLogin(CenterDto obj, Channel channel, ApplicationConfig config) {
 
-        log.info("LoginResponse.requestLogin: {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
-
-        int dataPacketNumber = 0;           //obj.getSeq().nextValue()
-        int dataPacketPriorityNumber = 0;
-        String serverDomainName = runningConfig.getServerDomainName();
-        String destinationTxt = obj.getRSE_MCU_ID();
-        String loginUserNameTxt = "";
-        String loginPasswordTxt = "";
-
-        Login login = new Login();
-        login.setDatexSenderTxt(new BerUTF8String(serverDomainName));
-        login.setDatexDestinationTxt(new BerUTF8String(destinationTxt));
-        login.setDatexLoginUserNameTxt(new BerUTF8String(loginUserNameTxt));
-        login.setDatexLoginPasswordTxt(new BerUTF8String(loginPasswordTxt));
-        login.setDatexLoginHeartbeatDurationMaxQty(new BerInteger(120));
-        login.setDatexLoginResponseTimeOutQty(new BerInteger(30));
-        login.setDatexLoginInitiatorCd(new BerEnum(1));
-        login.setDatexLoginDatagramSizeQty(new BerInteger(2048));
-        int[] encodingRules = {2, 1};
-        Login.DatexLoginEncodingRulesId loginEncodingRulesId = new Login.DatexLoginEncodingRulesId();
-        loginEncodingRulesId.getBerObjectIdentifier().add(new BerObjectIdentifier(encodingRules));
-        login.setDatexLoginEncodingRulesId(loginEncodingRulesId);
-
-        byte[] auth = {(byte) eAuthInfo.AI_Login.getValue() };
-        PDUs loginPdu = new PDUs();
-        loginPdu.setLogin(login);
-
-        HeaderOptions headerOptions = new HeaderOptions();
-        Time tm = new Time();
-        Time.TimeSecondFractions tmFac = new Time.TimeSecondFractions();
-        Time.TimeTimezone        tmZon = new Time.TimeTimezone();
-        Calendar currTm = Calendar.getInstance();
-        tm.setTimeYearQty(new BerInteger(currTm.get(Calendar.YEAR)));
-        tm.setTimeMonthQty(new BerInteger(currTm.get(Calendar.MONTH)+1));
-        tm.setTimeDayQty(new BerInteger(currTm.get(Calendar.DATE)));
-        tm.setTimeHourQty(new BerInteger(currTm.get(Calendar.HOUR_OF_DAY)));
-        tm.setTimeMinuteQty(new BerInteger(currTm.get(Calendar.MINUTE)));
-        tm.setTimeSecondQty(new BerInteger(currTm.get(Calendar.SECOND)));
-        tmFac.setMilliseconds(new BerInteger(currTm.get(Calendar.MILLISECOND)));
-        tm.setTimeSecondFractions(tmFac);
-        headerOptions.setDatexDataPacketTime(tm);
-
-        C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
-        c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-        c2c.setDatexDataPacketNumber(new BerInteger(dataPacketNumber));
-        c2c.setDatexDataPacketPriorityNumber(new BerInteger(dataPacketPriorityNumber));
-        c2c.setOptions(headerOptions);
-        c2c.setPdu(loginPdu);
-
-        ChannelFuture f = channel.writeAndFlush(c2c);
-        f.awaitUninterruptibly();
-        if (f.isDone() || f.isSuccess()) {
-            obj.setHeaderOptions(DsrcAsn1Utils.swapHeaderOptions(headerOptions));
-            obj.setLogin(login);
-            log.info("LoginResponse.requestLogin: {}, {}, {}, send ok.", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
-        } else {
-            log.error("LoginDeviceService.requestLogin: {}, {}, send failed.", obj.getID(), obj.getRSE_ID());
-        }
+//        log.info("LoginResponse.requestLogin: {}, {}, {}", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
+//
+//        int dataPacketNumber = 0;           //obj.getSeq().nextValue()
+//        int dataPacketPriorityNumber = 0;
+//        String serverDomainName = runningConfig.getServerDomainName();
+//        String destinationTxt = obj.getRSE_MCU_ID();
+//        String loginUserNameTxt = "";
+//        String loginPasswordTxt = "";
+//
+//        Login login = new Login();
+//        login.setDatexSenderTxt(new BerUTF8String(serverDomainName));
+//        login.setDatexDestinationTxt(new BerUTF8String(destinationTxt));
+//        login.setDatexLoginUserNameTxt(new BerUTF8String(loginUserNameTxt));
+//        login.setDatexLoginPasswordTxt(new BerUTF8String(loginPasswordTxt));
+//        login.setDatexLoginHeartbeatDurationMaxQty(new BerInteger(120));
+//        login.setDatexLoginResponseTimeOutQty(new BerInteger(30));
+//        login.setDatexLoginInitiatorCd(new BerEnum(1));
+//        login.setDatexLoginDatagramSizeQty(new BerInteger(2048));
+//        int[] encodingRules = {2, 1};
+//        Login.DatexLoginEncodingRulesId loginEncodingRulesId = new Login.DatexLoginEncodingRulesId();
+//        loginEncodingRulesId.getBerObjectIdentifier().add(new BerObjectIdentifier(encodingRules));
+//        login.setDatexLoginEncodingRulesId(loginEncodingRulesId);
+//
+//        byte[] auth = {(byte) eAuthInfo.AI_Login.getValue() };
+//        PDUs loginPdu = new PDUs();
+//        loginPdu.setLogin(login);
+//
+//        HeaderOptions headerOptions = new HeaderOptions();
+//        Time tm = new Time();
+//        Time.TimeSecondFractions tmFac = new Time.TimeSecondFractions();
+//        Time.TimeTimezone        tmZon = new Time.TimeTimezone();
+//        Calendar currTm = Calendar.getInstance();
+//        tm.setTimeYearQty(new BerInteger(currTm.get(Calendar.YEAR)));
+//        tm.setTimeMonthQty(new BerInteger(currTm.get(Calendar.MONTH)+1));
+//        tm.setTimeDayQty(new BerInteger(currTm.get(Calendar.DATE)));
+//        tm.setTimeHourQty(new BerInteger(currTm.get(Calendar.HOUR_OF_DAY)));
+//        tm.setTimeMinuteQty(new BerInteger(currTm.get(Calendar.MINUTE)));
+//        tm.setTimeSecondQty(new BerInteger(currTm.get(Calendar.SECOND)));
+//        tmFac.setMilliseconds(new BerInteger(currTm.get(Calendar.MILLISECOND)));
+//        tm.setTimeSecondFractions(tmFac);
+//        headerOptions.setDatexDataPacketTime(tm);
+//
+//        C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
+//        c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//        c2c.setDatexDataPacketNumber(new BerInteger(dataPacketNumber));
+//        c2c.setDatexDataPacketPriorityNumber(new BerInteger(dataPacketPriorityNumber));
+//        c2c.setOptions(headerOptions);
+//        c2c.setPdu(loginPdu);
+//
+//        ChannelFuture f = channel.writeAndFlush(c2c);
+//        f.awaitUninterruptibly();
+//        if (f.isDone() || f.isSuccess()) {
+//            obj.setHeaderOptions(DsrcAsn1Utils.swapHeaderOptions(headerOptions));
+//            obj.setLogin(login);
+//            log.info("LoginResponse.requestLogin: {}, {}, {}, send ok.", obj.getRSE_CTLR_NMBR(), obj.getRSE_CTLR_IP(), obj.getRSE_MCU_ID());
+//        } else {
+//            log.error("LoginDeviceService.requestLogin: {}, {}, send failed.", obj.getID(), obj.getRSE_ID());
+//        }
         return true;
     }
 
@@ -426,7 +413,7 @@ public class LoginDeviceService {
      */
     public boolean requestObuGatherInfo(CenterDto obj, Channel channel) {
 
-        log.info("LoginDeviceService.requestObuGatherInfo: {}, {}", obj.getID(), obj.getRSE_ID());
+//        log.info("LoginDeviceService.requestObuGatherInfo: {}, {}", obj.getID(), obj.getRSE_ID());
 
         int[] messageId = {1, 0, 15784, 8, 0, 8};
         int dataPacketNumber = 1;           //obj.getSeq().nextValue()
@@ -440,79 +427,79 @@ public class LoginDeviceService {
             byte[] generationDate = {0,0,0,0};
             byte[] generationTime = {0,0,0};
 
-            OBUGatherInfoList lists = new OBUGatherInfoList();
-            OBUGatherInfo gatherInfo = new OBUGatherInfo();
-            gatherInfo.setObuIdNumber(new BerOctetString(obuIdNumber));
-            BeaconID beaconID = new BeaconID();
-            beaconID.setManufacturerid(new BerInteger(obj.getManufacturerid()));
-            beaconID.setIndividualid(new BerInteger(obj.getIndividualid()));
-            gatherInfo.setRseIDNumber(beaconID);
-            gatherInfo.setVehicleType(new BerOctetString(vehicleType));
-            gatherInfo.setObuType(new BerOctetString(obuType));
-            gatherInfo.setGenerationDate(new BerOctetString(generationDate));
-            gatherInfo.setGenerationTime(new BerOctetString(generationTime));
-            lists.getOBUGatherInfo().add(gatherInfo);
-
-            byte[] controlId = { (byte)4 };
-            ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(1024);
-            lists.encode(msgBuff);
-            ControlDevice controlDevice = new ControlDevice();
-            controlDevice.setVpbdControlID(new BerOctetString(controlId));
-            controlDevice.setVpbdControlDeviceData(new BerOctetString(msgBuff.getArray()));
-
-            Registered registered = new Registered();
-            Registered.Continuous continuous = new Registered.Continuous();
-            SubscriptionMode subscriptionMode = new SubscriptionMode();
-
-            continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(0));
-            continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
-            continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
-            registered.setContinuous(continuous);
-            subscriptionMode.setEventDriven(registered);
-
-            // EndApplicationMessage set
-            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
-            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
-            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
-
-            SubscriptionData subscriptionData = new SubscriptionData();
-            subscriptionData.setDatexSubscribePersistentBool(new BerBoolean(false));
-            subscriptionData.setDatexSubscribeStatusCd(new BerEnum(0));         // 0: New, 1: Update
-            subscriptionData.setDatexSubscribeMode(subscriptionMode);
-            subscriptionData.setDatexSubscribePublishFormatCd(new BerEnum(3));  // 0: other, 1: ftp, 2: tftp, 3: dataPacket
-            subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(datexSubscriptionPriorityNbr));
-            subscriptionData.setDatexSubscribeGuaranteeBool(new BerBoolean(true));
-            subscriptionData.setDatexSubscribePdu(endApplicationMessage);
-
-            SubscriptionType subscriptionType = new SubscriptionType();
-            subscriptionType.setSubscription(subscriptionData);
-
-            Subscription subscription = new Subscription();
-            //subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
-            subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
-            subscription.setDatexSubscribeType(subscriptionType);
-
-            PDUs pdus = new PDUs();
-            pdus.setSubscription(subscription);
-            byte[] auth = { (byte) eAuthInfo.AI_Subscription.getValue() };
-            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
-            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-            c2c.setDatexDataPacketNumber(new BerInteger(dataPacketNumber));
-            c2c.setDatexDataPacketPriorityNumber(new BerInteger(dataPacketPriorityNumber));
-            c2c.setOptions(new HeaderOptions());
-            c2c.setPdu(pdus);
-
-            ChannelFuture f = channel.writeAndFlush(c2c);
-            f.awaitUninterruptibly();
-            if (f.isDone() || f.isSuccess()) {
-                log.info("LoginDeviceService.requestObuGatherInfo: {}, {}, send ok", obj.getID(), obj.getRSE_ID());
-            }
-            else {
-                log.error("LoginDeviceService.requestObuGatherInfo: {}, {}, send failed.", obj.getID(), obj.getRSE_ID());
-            }
+//            OBUGatherInfoList lists = new OBUGatherInfoList();
+//            OBUGatherInfo gatherInfo = new OBUGatherInfo();
+//            gatherInfo.setObuIdNumber(new BerOctetString(obuIdNumber));
+//            BeaconID beaconID = new BeaconID();
+//            beaconID.setManufacturerid(new BerInteger(obj.getManufacturerid()));
+//            beaconID.setIndividualid(new BerInteger(obj.getIndividualid()));
+//            gatherInfo.setRseIDNumber(beaconID);
+//            gatherInfo.setVehicleType(new BerOctetString(vehicleType));
+//            gatherInfo.setObuType(new BerOctetString(obuType));
+//            gatherInfo.setGenerationDate(new BerOctetString(generationDate));
+//            gatherInfo.setGenerationTime(new BerOctetString(generationTime));
+//            lists.getOBUGatherInfo().add(gatherInfo);
+//
+//            byte[] controlId = { (byte)4 };
+//            ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(1024);
+//            lists.encode(msgBuff);
+//            ControlDevice controlDevice = new ControlDevice();
+//            controlDevice.setVpbdControlID(new BerOctetString(controlId));
+//            controlDevice.setVpbdControlDeviceData(new BerOctetString(msgBuff.getArray()));
+//
+//            Registered registered = new Registered();
+//            Registered.Continuous continuous = new Registered.Continuous();
+//            SubscriptionMode subscriptionMode = new SubscriptionMode();
+//
+//            continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(0));
+//            continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
+//            continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
+//            registered.setContinuous(continuous);
+//            subscriptionMode.setEventDriven(registered);
+//
+//            // EndApplicationMessage set
+//            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
+//            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
+//            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
+//
+//            SubscriptionData subscriptionData = new SubscriptionData();
+//            subscriptionData.setDatexSubscribePersistentBool(new BerBoolean(false));
+//            subscriptionData.setDatexSubscribeStatusCd(new BerEnum(0));         // 0: New, 1: Update
+//            subscriptionData.setDatexSubscribeMode(subscriptionMode);
+//            subscriptionData.setDatexSubscribePublishFormatCd(new BerEnum(3));  // 0: other, 1: ftp, 2: tftp, 3: dataPacket
+//            subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(datexSubscriptionPriorityNbr));
+//            subscriptionData.setDatexSubscribeGuaranteeBool(new BerBoolean(true));
+//            subscriptionData.setDatexSubscribePdu(endApplicationMessage);
+//
+//            SubscriptionType subscriptionType = new SubscriptionType();
+//            subscriptionType.setSubscription(subscriptionData);
+//
+//            Subscription subscription = new Subscription();
+//            //subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
+//            subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
+//            subscription.setDatexSubscribeType(subscriptionType);
+//
+//            PDUs pdus = new PDUs();
+//            pdus.setSubscription(subscription);
+//            byte[] auth = { (byte) eAuthInfo.AI_Subscription.getValue() };
+//            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
+//            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//            c2c.setDatexDataPacketNumber(new BerInteger(dataPacketNumber));
+//            c2c.setDatexDataPacketPriorityNumber(new BerInteger(dataPacketPriorityNumber));
+//            c2c.setOptions(new HeaderOptions());
+//            c2c.setPdu(pdus);
+//
+//            ChannelFuture f = channel.writeAndFlush(c2c);
+//            f.awaitUninterruptibly();
+//            if (f.isDone() || f.isSuccess()) {
+//                log.info("LoginDeviceService.requestObuGatherInfo: {}, {}, send ok", obj.getID(), obj.getRSE_ID());
+//            }
+//            else {
+//                log.error("LoginDeviceService.requestObuGatherInfo: {}, {}, send failed.", obj.getID(), obj.getRSE_ID());
+//            }
         }
         catch(Exception e) {
-            log.error("LoginDeviceService.requestObuGatherInfo: {}, {}, Exception: {}", obj.getID(), obj.getRSE_ID(), e.toString());
+//            log.error("LoginDeviceService.requestObuGatherInfo: {}, {}, Exception: {}", obj.getID(), obj.getRSE_ID(), e.toString());
         }
         return true;
     }
@@ -521,7 +508,7 @@ public class LoginDeviceService {
 
         int updateDelayQty = 30;
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
-        log.info("LoginDeviceService.requestObuStatusInfo: {}, {}, {}", obj.getID(), obj.getMcuID(), updateDelayQty);
+//        log.info("LoginDeviceService.requestObuStatusInfo: {}, {}, {}", obj.getID(), obj.getMcuID(), updateDelayQty);
 
         int[] messageId = {1, 0, 15784, 4, 0, 7};
         int dataPacketNumber = 2;           //obj.getSeq().nextValue()
@@ -531,67 +518,67 @@ public class LoginDeviceService {
         try {
             byte[] controlId = {3};
             byte[] controlData = {};
-            ControlDevice controlDevice = new ControlDevice();
-            controlDevice.setVpbdControlID(new BerOctetString(controlId));
-            controlDevice.setVpbdControlDeviceData(new BerOctetString(controlData));
-            Registered registered = new Registered();
-            Registered.Continuous continuous = new Registered.Continuous();
-            SubscriptionMode subscriptionMode = new SubscriptionMode();
-
-            continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(updateDelayQty));
-            continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
-            continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
-            registered.setContinuous(continuous);
-            subscriptionMode.setPeriodic(registered);
-
-            // ControlDeviceList set
-            ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(1024);
-            ControlDeviceList controlDeviceList = new ControlDeviceList();
-            controlDeviceList.getControlDevice().add(controlDevice);
-            controlDeviceList.encode(msgBuff);
-
-            // EndApplicationMessage set
-            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
-            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
-            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
-
-            SubscriptionData subscriptionData = new SubscriptionData();
-            subscriptionData.setDatexSubscribePersistentBool(new BerBoolean(false));
-            subscriptionData.setDatexSubscribeStatusCd(new BerEnum(0));         // 0: New, 1: Update
-            subscriptionData.setDatexSubscribeMode(subscriptionMode);
-            subscriptionData.setDatexSubscribePublishFormatCd(new BerEnum(3));  // 0: other, 1: ftp, 2: tftp, 3: dataPacket
-            subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(datexSubscriptionPriorityNbr));
-            subscriptionData.setDatexSubscribeGuaranteeBool(new BerBoolean(true));
-            subscriptionData.setDatexSubscribePdu(endApplicationMessage);
-
-            SubscriptionType subscriptionType = new SubscriptionType();
-            subscriptionType.setSubscription(subscriptionData);
-
-            Subscription subscription = new Subscription();
-            subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
-            subscription.setDatexSubscribeType(subscriptionType);
-
-            PDUs pdus = new PDUs();
-            pdus.setSubscription(subscription);
-            byte[] auth = { (byte) eAuthInfo.AI_Subscription.getValue() };
-            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
-            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-            c2c.setDatexDataPacketNumber(new BerInteger(dataPacketNumber));
-            c2c.setDatexDataPacketPriorityNumber(new BerInteger(dataPacketPriorityNumber));
-            c2c.setOptions(new HeaderOptions());
-            c2c.setPdu(pdus);
-
-            ChannelFuture f = channel.writeAndFlush(c2c);
-            f.awaitUninterruptibly();
-            if (f.isDone() || f.isSuccess()) {
-                log.info("LoginDeviceService.requestObuStatusInfo: {}, {}, {}, send ok", obj.getID(), obj.getMcuID(), updateDelayQty);
-            }
-            else {
-                log.error("LoginDeviceService.requestObuStatusInfo: {}, {}, {}, send failed.", obj.getID(), obj.getMcuID(), updateDelayQty);
-            }
+//            ControlDevice controlDevice = new ControlDevice();
+//            controlDevice.setVpbdControlID(new BerOctetString(controlId));
+//            controlDevice.setVpbdControlDeviceData(new BerOctetString(controlData));
+//            Registered registered = new Registered();
+//            Registered.Continuous continuous = new Registered.Continuous();
+//            SubscriptionMode subscriptionMode = new SubscriptionMode();
+//
+//            continuous.setDatexRegisteredUpdateDelayQty(new BerInteger(updateDelayQty));
+//            continuous.setDatexRegisteredStartTime(DsrcAsn1Utils.getRegisterStartTime());
+//            continuous.setDatexRegisteredEndTime(DsrcAsn1Utils.getRegisterEndTime());
+//            registered.setContinuous(continuous);
+//            subscriptionMode.setPeriodic(registered);
+//
+//            // ControlDeviceList set
+//            ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(1024);
+//            ControlDeviceList controlDeviceList = new ControlDeviceList();
+//            controlDeviceList.getControlDevice().add(controlDevice);
+//            controlDeviceList.encode(msgBuff);
+//
+//            // EndApplicationMessage set
+//            EndApplicationMessage endApplicationMessage =  new EndApplicationMessage();
+//            endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
+//            endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
+//
+//            SubscriptionData subscriptionData = new SubscriptionData();
+//            subscriptionData.setDatexSubscribePersistentBool(new BerBoolean(false));
+//            subscriptionData.setDatexSubscribeStatusCd(new BerEnum(0));         // 0: New, 1: Update
+//            subscriptionData.setDatexSubscribeMode(subscriptionMode);
+//            subscriptionData.setDatexSubscribePublishFormatCd(new BerEnum(3));  // 0: other, 1: ftp, 2: tftp, 3: dataPacket
+//            subscriptionData.setDatexSubscriptionPriorityNbr(new BerInteger(datexSubscriptionPriorityNbr));
+//            subscriptionData.setDatexSubscribeGuaranteeBool(new BerBoolean(true));
+//            subscriptionData.setDatexSubscribePdu(endApplicationMessage);
+//
+//            SubscriptionType subscriptionType = new SubscriptionType();
+//            subscriptionType.setSubscription(subscriptionData);
+//
+//            Subscription subscription = new Subscription();
+//            subscription.setDatexSubscribeSerialNbr(new BerInteger(subscribeSerialNbr));
+//            subscription.setDatexSubscribeType(subscriptionType);
+//
+//            PDUs pdus = new PDUs();
+//            pdus.setSubscription(subscription);
+//            byte[] auth = { (byte) eAuthInfo.AI_Subscription.getValue() };
+//            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
+//            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//            c2c.setDatexDataPacketNumber(new BerInteger(dataPacketNumber));
+//            c2c.setDatexDataPacketPriorityNumber(new BerInteger(dataPacketPriorityNumber));
+//            c2c.setOptions(new HeaderOptions());
+//            c2c.setPdu(pdus);
+//
+//            ChannelFuture f = channel.writeAndFlush(c2c);
+//            f.awaitUninterruptibly();
+//            if (f.isDone() || f.isSuccess()) {
+//                log.info("LoginDeviceService.requestObuStatusInfo: {}, {}, {}, send ok", obj.getID(), obj.getMcuID(), updateDelayQty);
+//            }
+//            else {
+//                log.error("LoginDeviceService.requestObuStatusInfo: {}, {}, {}, send failed.", obj.getID(), obj.getMcuID(), updateDelayQty);
+//            }
         }
         catch(Exception e) {
-            log.error("LoginDeviceService.requestObuStatusInfo: {}, {}, {}, Exception: {}", obj.getID(), obj.getMcuID(), updateDelayQty, e);
+//            log.error("LoginDeviceService.requestObuStatusInfo: {}, {}, {}, Exception: {}", obj.getID(), obj.getMcuID(), updateDelayQty, e);
         }
         return true;
     }

+ 176 - 204
src/main/java/com/its/rota/server/xnet/server/process/service/MultiMediaDataService.java

@@ -1,42 +1,14 @@
 package com.its.rota.server.xnet.server.process.service;
 
-import com.beanit.asn1bean.ber.ReverseByteArrayOutputStream;
-import com.beanit.asn1bean.ber.types.*;
-import com.beanit.asn1bean.ber.types.string.BerUTF8String;
-import com.beanit.asn1bean.ber.types.string.BerVisibleString;
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.AppUtils;
-import com.its.app.utils.SysUtils;
-import com.its.dsrc.dao.mapper.RseOffrSectMapper;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseOffrSect;
-import com.its.dsrc.entity.TbRseOffrSectTraf;
-import com.its.dsrc.global.AppRepository;
-import com.its.dsrc.process.DbmsData;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.process.DbmsDataType;
-import com.its.dsrc.vo.NET;
-import com.its.dsrc.vo.voDsrcOffrSectTraf;
-import com.its.rota.server.dto.CenterDto;
-import io.netty.channel.ChannelFuture;
 import lombok.extern.slf4j.Slf4j;
-import org.slf4j.MDC;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
 @Slf4j
 public class MultiMediaDataService {
 
-    private RseOffrSectMapper rseOffrSectMapper;
-    private ConcurrentHashMap<String, TbRseOffrSect> offrSectInfoMap = null;
-    private ConcurrentHashMap<String, voDsrcOffrSectTraf> offrSectTrafMap = null;
-    private List<TbRseOffrSectTraf> offrInfrHsList = null;
+//    private RseOffrSectMapper rseOffrSectMapper;
+//    private ConcurrentHashMap<String, TbRseOffrSect> offrSectInfoMap = null;
+//    private ConcurrentHashMap<String, voDsrcOffrSectTraf> offrSectTrafMap = null;
+//    private List<TbRseOffrSectTraf> offrInfrHsList = null;
 
     private static MultiMediaDataService _instance = null;
 
@@ -51,10 +23,10 @@ public class MultiMediaDataService {
     }
 
     public MultiMediaDataService() {
-        this.rseOffrSectMapper = (RseOffrSectMapper) AppUtils.getBean(RseOffrSectMapper.class);
-        this.offrSectInfoMap = new ConcurrentHashMap<String, TbRseOffrSect>();
-        this.offrSectTrafMap = new ConcurrentHashMap<String, voDsrcOffrSectTraf>();
-        this.offrInfrHsList = Collections.synchronizedList(new ArrayList<>());
+//        this.rseOffrSectMapper = (RseOffrSectMapper) AppUtils.getBean(RseOffrSectMapper.class);
+//        this.offrSectInfoMap = new ConcurrentHashMap<String, TbRseOffrSect>();
+//        this.offrSectTrafMap = new ConcurrentHashMap<String, voDsrcOffrSectTraf>();
+//        this.offrInfrHsList = Collections.synchronizedList(new ArrayList<>());
     }
 
     /*
@@ -65,28 +37,28 @@ public class MultiMediaDataService {
     private boolean loadOffrSectInfo() {
         // DSRC 제공구간 목록을 조회해서 DSRC 제어기에 설정한다.
         // 기존 제어기의 목록을 삭제한다.
-        for (Map.Entry<String, TbRseCtlr> obj : AppRepository.getInstance().getCtlrMap().entrySet()) {
-            obj.getValue().getOffrSectMap().clear();    // 제공구간 목록 초기화
-            this.offrInfrHsList.clear();                // 제공이력 목록 삭제
-        }
-        try {
-            List<TbRseOffrSect> list = this.rseOffrSectMapper.selectRseOffrSectAll();
-            this.offrSectInfoMap.clear();
-            for (TbRseOffrSect vo : list) {
-                this.offrSectInfoMap.put(vo.getOFFR_SECT_ID(), vo);
-                TbRseCtlr obj = AppRepository.getInstance().getCtlrMap().get(vo.getRSE_CTLR_NMBR());
-                if (obj == null) {
-                    log.error("MultiMediaDataService.loadOffrSectInfo: DSRC Not Found: {}", vo.getRSE_CTLR_NMBR());
-                }
-                else {
-                    obj.getOffrSectMap().put(vo.getOFFR_SECT_ID(), vo);
-                }
-            }
-        }
-        catch(Exception e) {
-            log.error("MultiMediaDataService.loadOffrSectInfo: Exception: {}", e.toString());
-        }
-        log.info("MultiMediaDataService.loadOffrSectInfo: {} EA.", this.offrSectInfoMap.size());
+//        for (Map.Entry<String, TbRseCtlr> obj : AppRepository.getInstance().getCtlrMap().entrySet()) {
+//            obj.getValue().getOffrSectMap().clear();    // 제공구간 목록 초기화
+//            this.offrInfrHsList.clear();                // 제공이력 목록 삭제
+//        }
+//        try {
+//            List<TbRseOffrSect> list = this.rseOffrSectMapper.selectRseOffrSectAll();
+//            this.offrSectInfoMap.clear();
+//            for (TbRseOffrSect vo : list) {
+//                this.offrSectInfoMap.put(vo.getOFFR_SECT_ID(), vo);
+//                TbRseCtlr obj = AppRepository.getInstance().getCtlrMap().get(vo.getRSE_CTLR_NMBR());
+//                if (obj == null) {
+//                    log.error("MultiMediaDataService.loadOffrSectInfo: DSRC Not Found: {}", vo.getRSE_CTLR_NMBR());
+//                }
+//                else {
+//                    obj.getOffrSectMap().put(vo.getOFFR_SECT_ID(), vo);
+//                }
+//            }
+//        }
+//        catch(Exception e) {
+//            log.error("MultiMediaDataService.loadOffrSectInfo: Exception: {}", e.toString());
+//        }
+//        log.info("MultiMediaDataService.loadOffrSectInfo: {} EA.", this.offrSectInfoMap.size());
         return true;
     }
 
@@ -95,16 +67,16 @@ public class MultiMediaDataService {
      */
     private boolean loadOffrSectTraf() {
         try {
-            List<voDsrcOffrSectTraf> list = this.rseOffrSectMapper.selectRseOffrSectTraf();
-            this.offrSectTrafMap.clear();
-            for (voDsrcOffrSectTraf vo : list) {
-                this.offrSectTrafMap.put(vo.getOFFR_SECT_ID(), vo);
-            }
+//            List<voDsrcOffrSectTraf> list = this.rseOffrSectMapper.selectRseOffrSectTraf();
+//            this.offrSectTrafMap.clear();
+//            for (voDsrcOffrSectTraf vo : list) {
+//                this.offrSectTrafMap.put(vo.getOFFR_SECT_ID(), vo);
+//            }
         }
         catch(Exception e) {
             log.error("MultiMediaDataService.loadOffrSectTraf: Exception: {}", e.toString());
         }
-        log.info("MultiMediaDataService.loadOffrSectTraf: {} EA.", this.offrSectTrafMap.size());
+//        log.info("MultiMediaDataService.loadOffrSectTraf: {} EA.", this.offrSectTrafMap.size());
         return true;
     }
 
@@ -121,147 +93,147 @@ public class MultiMediaDataService {
         String logKey = "x";
 
         // 제어기별 Multimedia packet 생성
-        for (Map.Entry<String, TbRseCtlr> entry : AppRepository.getInstance().getCtlrMap().entrySet()) {
-            TbRseCtlr obj = entry.getValue();
-            if (!logKey.equals("x")) {
-                MDC.remove(logKey);
-                MDC.clear();
-            }
-            logKey = obj.getLogKey();
-            MDC.put("id", logKey);
-            if (obj.getChannel() == null || obj.getNetState() != NET.LOGINED || !obj.getChannel().isActive()) {
-                log.warn("MultiMediaDataService.makeMultimediaData: {}, {}, is not connected.", obj.getID(), obj.getRSE_ID());
-                continue;
-            }
-
-            if (obj.getOffrSectMap().size() == 0) {
-                log.warn("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia data not found.", obj.getID(), obj.getRSE_ID());
-                continue;
-            }
-
-            MultiMediaDataList multiMediaDataList = null;
-            for (Map.Entry<String, TbRseOffrSect> sectEntry : obj.getOffrSectMap().entrySet()) {
-                TbRseOffrSect sectInfo = sectEntry.getValue();
-                voDsrcOffrSectTraf traf = this.offrSectTrafMap.get(sectInfo.getOFFR_SECT_ID());
-                if (traf == null) {
-                    continue;
-                }
-
-                if (multiMediaDataList == null) {
-                    multiMediaDataList = new MultiMediaDataList();
-                }
-
-                String offrDt = SysUtils.getSysTime();
-                String offrCont = traf.getOFFR_DRCT_NM() + " 방향 " + traf.getCMTR_GRAD_NM();
-                byte[] infoTypeid = { 0x01 };
-
-                //0x00 : 정의 없음
-                //0x01 : 소통정보
-                //0x02 : 돌발/통제/도로상태/유고 정보
-                //0x03 : 공지사항
-                //0x04 : 정지영상
-
-                MultiMediaData multiMediaData = new MultiMediaData();
-                MultiMediaData.LinkLinkIDNumber linkIDNumber = new MultiMediaData.LinkLinkIDNumber();
-                linkIDNumber.getBerUTF8String().add(new BerUTF8String(traf.getOFFR_SECT_ID()));
-
-                multiMediaData.setDirectionID(new BerOctetString(traf.getOBU_ENTR_DRCT_NMBR().getBytes())); // directionID
-                multiMediaData.setTrntMessageCreativeGeneralizedTime(new BerVisibleString(offrDt));         // trnt-MessageCreativeGeneralizedTime\
-                multiMediaData.setLinkLinkIDNumber(linkIDNumber);                                           // link-LinkIDNumber
-                multiMediaData.setInfoTypeID(new BerOctetString(infoTypeid));                               // infoTypeID
-
-                MultiMediaData.DataType dataType = new MultiMediaData.DataType();
-                dataType.setMmdCharData(new CharObjectData(offrCont.getBytes()));
-                multiMediaData.setDataType(dataType);                                                       // dataType
-
-                multiMediaDataList.getMultiMediaData().add(multiMediaData);
-
-                this.offrInfrHsList.add(new TbRseOffrSectTraf(traf.getOFFR_SECT_ID(), offrDt, offrCont));
-            }
-
-            if (multiMediaDataList == null) {
-                log.warn("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia traffic data not found.", obj.getID(), obj.getRSE_ID());
-                continue;
-            }
-
-            EndApplicationMessage endMsg = makeEndApplicationMessage(obj, multiMediaDataList);
-            if (endMsg == null) {
-                continue;
-            }
-
-            byte[] auth = { (byte) eAuthInfo.AI_Multimedia.getValue() };
-            int packetNmbr = obj.getSeq().nextValue();
-
-            PublicationType publicationType = new PublicationType();
-            publicationType.setDatexPublishData(endMsg);
-
-            PublicationData publicationData = new PublicationData();
-            publicationData.setDatexPublishSubscribeSerialNbr(new BerInteger(packetNmbr));          // 요청 serial nmbr
-            publicationData.setDatexPublishSerialNbr(new BerInteger(packetNmbr));     // 생성 serial nmbr
-            publicationData.setDatexPublishLatePublicationFlag(new BerBoolean(true));
-            publicationData.setDatexPublishType(publicationType);
-
-            PublishFormat.DatexPublishData publishData = new PublishFormat.DatexPublishData();
-            publishData.getPublicationData().add(publicationData);
-
-            PublishFormat publishFormat = new PublishFormat();
-            publishFormat.setDatexPublishData(publishData);
-
-            Publication publication = new Publication();
-            publication.setDatexPublishFormat(publishFormat);
-            publication.setDatexPublishGuaranteedBool(new BerBoolean(true));
-
-            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
-            PDUs pdus = new PDUs();
-            pdus.setPublication(publication);
-            c2c.setDatexDataPacketNumber(new BerInteger(packetNmbr));
-            c2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
-            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-            c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
-            c2c.setPdu(pdus);
-
-            ChannelFuture f = obj.getChannel().writeAndFlush(c2c);
-            f.awaitUninterruptibly();
-            if (f.isDone() || f.isSuccess()) {
-                log.info("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia data: {} EA, send ok", obj.getID(), obj.getRSE_ID(), multiMediaDataList.getMultiMediaData().size());
-                //obj.putRegisteredCommands(c2c);
-            } else {
-                log.error("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia data: {} EA, send failed. isDone: {}, isSuccess: {}",
-                        obj.getID(), obj.getRSE_ID(), multiMediaDataList.getMultiMediaData().size(), f.isDone(), f.isSuccess());
-            }
-        }
-        if (!logKey.equals("x")) {
-            MDC.remove(logKey);
-            MDC.clear();
-        }
-        // DSRC 제공구간 제공이력을 이력테이블에 저장한다.
-        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
-        dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_MULTIMEDIA_HS, false, this.offrInfrHsList));
+//        for (Map.Entry<String, TbRseCtlr> entry : AppRepository.getInstance().getCtlrMap().entrySet()) {
+//            TbRseCtlr obj = entry.getValue();
+//            if (!logKey.equals("x")) {
+//                MDC.remove(logKey);
+//                MDC.clear();
+//            }
+//            logKey = obj.getLogKey();
+//            MDC.put("id", logKey);
+//            if (obj.getChannel() == null || obj.getNetState() != NET.LOGINED || !obj.getChannel().isActive()) {
+//                log.warn("MultiMediaDataService.makeMultimediaData: {}, {}, is not connected.", obj.getID(), obj.getRSE_ID());
+//                continue;
+//            }
+//
+//            if (obj.getOffrSectMap().size() == 0) {
+//                log.warn("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia data not found.", obj.getID(), obj.getRSE_ID());
+//                continue;
+//            }
+//
+//            MultiMediaDataList multiMediaDataList = null;
+//            for (Map.Entry<String, TbRseOffrSect> sectEntry : obj.getOffrSectMap().entrySet()) {
+//                TbRseOffrSect sectInfo = sectEntry.getValue();
+//                voDsrcOffrSectTraf traf = this.offrSectTrafMap.get(sectInfo.getOFFR_SECT_ID());
+//                if (traf == null) {
+//                    continue;
+//                }
+//
+//                if (multiMediaDataList == null) {
+//                    multiMediaDataList = new MultiMediaDataList();
+//                }
+//
+//                String offrDt = SysUtils.getSysTime();
+//                String offrCont = traf.getOFFR_DRCT_NM() + " 방향 " + traf.getCMTR_GRAD_NM();
+//                byte[] infoTypeid = { 0x01 };
+//
+//                //0x00 : 정의 없음
+//                //0x01 : 소통정보
+//                //0x02 : 돌발/통제/도로상태/유고 정보
+//                //0x03 : 공지사항
+//                //0x04 : 정지영상
+//
+//                MultiMediaData multiMediaData = new MultiMediaData();
+//                MultiMediaData.LinkLinkIDNumber linkIDNumber = new MultiMediaData.LinkLinkIDNumber();
+//                linkIDNumber.getBerUTF8String().add(new BerUTF8String(traf.getOFFR_SECT_ID()));
+//
+//                multiMediaData.setDirectionID(new BerOctetString(traf.getOBU_ENTR_DRCT_NMBR().getBytes())); // directionID
+//                multiMediaData.setTrntMessageCreativeGeneralizedTime(new BerVisibleString(offrDt));         // trnt-MessageCreativeGeneralizedTime\
+//                multiMediaData.setLinkLinkIDNumber(linkIDNumber);                                           // link-LinkIDNumber
+//                multiMediaData.setInfoTypeID(new BerOctetString(infoTypeid));                               // infoTypeID
+//
+//                MultiMediaData.DataType dataType = new MultiMediaData.DataType();
+//                dataType.setMmdCharData(new CharObjectData(offrCont.getBytes()));
+//                multiMediaData.setDataType(dataType);                                                       // dataType
+//
+//                multiMediaDataList.getMultiMediaData().add(multiMediaData);
+//
+//                this.offrInfrHsList.add(new TbRseOffrSectTraf(traf.getOFFR_SECT_ID(), offrDt, offrCont));
+//            }
+//
+//            if (multiMediaDataList == null) {
+//                log.warn("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia traffic data not found.", obj.getID(), obj.getRSE_ID());
+//                continue;
+//            }
+//
+//            EndApplicationMessage endMsg = makeEndApplicationMessage(obj, multiMediaDataList);
+//            if (endMsg == null) {
+//                continue;
+//            }
+//
+//            byte[] auth = { (byte) eAuthInfo.AI_Multimedia.getValue() };
+//            int packetNmbr = obj.getSeq().nextValue();
+//
+//            PublicationType publicationType = new PublicationType();
+//            publicationType.setDatexPublishData(endMsg);
+//
+//            PublicationData publicationData = new PublicationData();
+//            publicationData.setDatexPublishSubscribeSerialNbr(new BerInteger(packetNmbr));          // 요청 serial nmbr
+//            publicationData.setDatexPublishSerialNbr(new BerInteger(packetNmbr));     // 생성 serial nmbr
+//            publicationData.setDatexPublishLatePublicationFlag(new BerBoolean(true));
+//            publicationData.setDatexPublishType(publicationType);
+//
+//            PublishFormat.DatexPublishData publishData = new PublishFormat.DatexPublishData();
+//            publishData.getPublicationData().add(publicationData);
+//
+//            PublishFormat publishFormat = new PublishFormat();
+//            publishFormat.setDatexPublishData(publishData);
+//
+//            Publication publication = new Publication();
+//            publication.setDatexPublishFormat(publishFormat);
+//            publication.setDatexPublishGuaranteedBool(new BerBoolean(true));
+//
+//            C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
+//            PDUs pdus = new PDUs();
+//            pdus.setPublication(publication);
+//            c2c.setDatexDataPacketNumber(new BerInteger(packetNmbr));
+//            c2c.setDatexDataPacketPriorityNumber(new BerInteger(1));
+//            c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
+//            c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
+//            c2c.setPdu(pdus);
+//
+//            ChannelFuture f = obj.getChannel().writeAndFlush(c2c);
+//            f.awaitUninterruptibly();
+//            if (f.isDone() || f.isSuccess()) {
+//                log.info("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia data: {} EA, send ok", obj.getID(), obj.getRSE_ID(), multiMediaDataList.getMultiMediaData().size());
+//                //obj.putRegisteredCommands(c2c);
+//            } else {
+//                log.error("MultiMediaDataService.makeMultimediaData: {}, {}, multimedia data: {} EA, send failed. isDone: {}, isSuccess: {}",
+//                        obj.getID(), obj.getRSE_ID(), multiMediaDataList.getMultiMediaData().size(), f.isDone(), f.isSuccess());
+//            }
+//        }
+//        if (!logKey.equals("x")) {
+//            MDC.remove(logKey);
+//            MDC.clear();
+//        }
+//        // DSRC 제공구간 제공이력을 이력테이블에 저장한다.
+//        DbmsDataProcess dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
+//        dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_MULTIMEDIA_HS, false, this.offrInfrHsList));
     }
 
-    public EndApplicationMessage makeEndApplicationMessage(CenterDto obj, MultiMediaDataList multiMediaDataList) {
-
-        EndApplicationMessage endApplicationMessage = null;
-        MDC.put("id", obj.getLogKey());
-        try {
-            if (multiMediaDataList != null) {
-                int[] messageId = {1, 0, 15784, 5, 0, 1};
-                ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(2048);
-                multiMediaDataList.encode(msgBuff);
-
-                endApplicationMessage = new EndApplicationMessage();
-                endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
-                endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
-            }
-        }
-        catch(Exception e) {
-            log.error("MultiMediaDataService.makeEndApplicationMessage: {}, MultiMediaDataList: {}, Exception: {}", obj.getID(), multiMediaDataList, e);
-            return null;
-        }
-        log.debug("MultiMediaDataService.makeEndApplicationMessage: {}, MultiMediaDataList: {}, EndApplicationMessage: {}", obj.getID(), multiMediaDataList, endApplicationMessage);
-        MDC.remove(obj.getLogKey());
-        MDC.clear();
-        return endApplicationMessage;
-    }
+//    public EndApplicationMessage makeEndApplicationMessage(CenterDto obj, MultiMediaDataList multiMediaDataList) {
+//
+//        EndApplicationMessage endApplicationMessage = null;
+//        MDC.put("id", obj.getLogKey());
+//        try {
+//            if (multiMediaDataList != null) {
+//                int[] messageId = {1, 0, 15784, 5, 0, 1};
+//                ReverseByteArrayOutputStream msgBuff = new ReverseByteArrayOutputStream(2048);
+//                multiMediaDataList.encode(msgBuff);
+//
+//                endApplicationMessage = new EndApplicationMessage();
+//                endApplicationMessage.setEndApplicationMessageId(new BerObjectIdentifier(messageId));
+//                endApplicationMessage.setEndApplicationMessageMsg(new BerAny(msgBuff.getArray()));
+//            }
+//        }
+//        catch(Exception e) {
+//            log.error("MultiMediaDataService.makeEndApplicationMessage: {}, MultiMediaDataList: {}, Exception: {}", obj.getID(), multiMediaDataList, e);
+//            return null;
+//        }
+//        log.debug("MultiMediaDataService.makeEndApplicationMessage: {}, MultiMediaDataList: {}, EndApplicationMessage: {}", obj.getID(), multiMediaDataList, endApplicationMessage);
+//        MDC.remove(obj.getLogKey());
+//        MDC.clear();
+//        return endApplicationMessage;
+//    }
 
 }

+ 110 - 121
src/main/java/com/its/rota/server/xnet/server/process/service/OBUGatherInfoService.java

@@ -1,26 +1,15 @@
 package com.its.rota.server.xnet.server.process.service;
 
-import com.beanit.asn1dsrc.dsrc.OBUGatherInfo;
-import com.its.app.AppUtils;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.entity.TbRseObuClct;
-import com.its.dsrc.global.AppRepository;
-import com.its.dsrc.process.DbmsData;
-import com.its.dsrc.process.DbmsDataProcess;
-import com.its.dsrc.process.DbmsDataType;
-import com.its.dsrc.service.RseSectService;
-import com.its.dsrc.vo.voDsrcObuPassInfo;
-import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.common.SpringUtils;
+import com.its.rota.server.process.dbms.DbmsDataProcess;
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 
-import java.util.*;
-
 @Getter
 @Slf4j
 public class OBUGatherInfoService {
 
-    private RseSectService rseSectService;
+//    private RseSectService rseSectService;
     private DbmsDataProcess dbmsDataProcess;
 
     private static OBUGatherInfoService _instance = null;
@@ -36,8 +25,8 @@ public class OBUGatherInfoService {
     }
 
     public OBUGatherInfoService() {
-        this.dbmsDataProcess = (DbmsDataProcess) AppUtils.getBean(DbmsDataProcess.class);
-        this.rseSectService = (RseSectService) AppUtils.getBean(RseSectService.class);
+        this.dbmsDataProcess = SpringUtils.getBean(DbmsDataProcess.class);
+//        this.rseSectService = (RseSectService) AppUtils.getBean(RseSectService.class);
     }
 
     /*
@@ -45,110 +34,110 @@ public class OBUGatherInfoService {
      *  decoding 한 OBU 수집 정보를 데이터베이스에 저장하고,
      *  OBU 가 지나온 RSE 를 이용하여 RSE 구간 소통정보를 생성한다.
      */
-    public boolean decoding_OBUGatherInfo(CenterDto obj, List<OBUGatherInfo> list) {
-
-        List<TbRseObuClct> obuGatherInfos = Collections.synchronizedList(new ArrayList<>());
-
-        log.debug("OBUGatherInfoService.decoding_OBUGatherInfo: {}, {}, {} EA", obj.getID(), obj.getRSE_ID(), list.size());
-
-        String dsrcId = obj.getID();
-        try {
-            for (OBUGatherInfo obuGatherInfo : list) {
-                String individualId = "";
-                String manufacturerId = "";
-                if (obuGatherInfo.getRseIDNumber().getIndividualid() == null) {
-                    log.warn("{}, ObuGatherInfo.getIndividualid NULL", obj.getID());
-                    return false;
-                }
-                if (obuGatherInfo.getRseIDNumber().getManufacturerid() == null) {
-                    log.warn("{}, ObuGatherInfo.getManufacturerid NULL", obj.getID());
-                }
-
-                individualId = obuGatherInfo.getRseIDNumber().getIndividualid().toString();
-                manufacturerId = obuGatherInfo.getRseIDNumber().getManufacturerid().toString();
-
-                // individualid == rseId
-                String obuType = "0";
-                String vehicleType = "0";
-                String obuIdNumber = "0";
-                String generationDate = "0";
-                String generationTime = "0";
-                if (obuGatherInfo.getObuType() != null) {
-                    obuType = obuGatherInfo.getObuType().toString();
-                }
-                if (obuGatherInfo.getVehicleType() != null) {
-                    vehicleType = obuGatherInfo.getVehicleType().toString();
-                }
-                if (obuGatherInfo.getObuIdNumber() != null) {
-                    obuIdNumber = obuGatherInfo.getObuIdNumber().toString();
-                }
-                if (obuGatherInfo.getGenerationDate() != null) {
-                    generationDate = obuGatherInfo.getGenerationDate().toString();
-                }
-                if (obuGatherInfo.getGenerationTime() != null) {
-                    generationTime = obuGatherInfo.getGenerationTime().toString();
-                }
-
-                // 이전 통과 RSE 를 찾는다
-                //
-
-                String generationTm = generationDate+generationTime;
-                TbRseObuClct voObu = new TbRseObuClct(obj.getID(), generationTm, obuIdNumber, vehicleType, obuType);
-                obuGatherInfos.add(voObu);
-
-                log.debug("OBUGatherInfoService.decoding_OBUGatherInfo: {}, {}, {}, {}, voObu: {}",
-                        obj.getID(), obj.getRSE_ID(), generationDate, generationTime, voObu.toString());
-
-                // 시작 RSE 에 해당하는 모든 구간에 대하여
-                Iterator<String> startDsrcSectIds = AppRepository.getInstance().rseSectStartMap.get(dsrcId).iterator();
-                synchronized (this.rseSectService.getDsrcObuPassMap()) {
-                    while (startDsrcSectIds.hasNext()) {
-                        String startDsrcSectId = startDsrcSectIds.next();
-                        if (startDsrcSectId == null || startDsrcSectId.equals("")) {
-                            continue;
-                        }
-                        // 모든 SECT_ID에 대하여 무조건 추가한다.
-                        voDsrcObuPassInfo obuStartPassInfo = new voDsrcObuPassInfo();
-                        obuStartPassInfo.setObuId(obuIdNumber);
-                        obuStartPassInfo.setStartDsrcPassTm(generationTm);
-                        this.rseSectService.getDsrcObuPassMap().get(startDsrcSectId).put(obuIdNumber, obuStartPassInfo);
-                    }
-                }
-
-                // 종료 RSE 에 해당하는 모든 구간에 대하여
-                Iterator<String> endDsrcSectIds = AppRepository.getInstance().rseSectEndMap.get(dsrcId).iterator();
-                synchronized (this.rseSectService.getDsrcObuPassMap()) {
-                    while (endDsrcSectIds.hasNext()) {
-                        String endDsrcSectId = endDsrcSectIds.next();
-                        if (endDsrcSectId == null || endDsrcSectId.equals("")) {
-                            continue;
-                        }
-                        // 종료 SECT_ID에 대하여 이전 통과정보가 존재하지 않으면 추가, 존재하면 통과종료시각 업데이트
-                        Map<String, voDsrcObuPassInfo> passInfo = this.rseSectService.getDsrcObuPassMap().get(endDsrcSectId);
-                        if (passInfo == null || !passInfo.containsKey(obuIdNumber)) {
-                            // 존재하지 않으면 추가한다.
-                            voDsrcObuPassInfo obuEndPassInfo = new voDsrcObuPassInfo();
-                            obuEndPassInfo.setObuId(obuIdNumber);
-                            obuEndPassInfo.setEndDsrcPassTm(generationTm);
-                            this.rseSectService.getDsrcObuPassMap().get(endDsrcSectId).put(obuIdNumber, obuEndPassInfo);
-                            continue;
-                        }
-
-                        // 존재하면 종료 DSRC 통과시각을 업데이트 한다.
-                        passInfo.get(obuIdNumber).setEndDsrcPassTm(generationTm);
-                    }
-                }
-            }
-        }
-        catch(Exception e) {
-            log.error("{}", e.toString());
-        }
-
-        if (obuGatherInfos.size() > 0) {
-            // OBU 수집정보를 데이터베이스에 저장
-            this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_OBU_GATHER_LOG, false, (Object)obuGatherInfos));
-        }
-        return true;
-    }
+//    public boolean decoding_OBUGatherInfo(CenterDto obj, List<OBUGatherInfo> list) {
+//
+//        List<TbRseObuClct> obuGatherInfos = Collections.synchronizedList(new ArrayList<>());
+//
+//        log.debug("OBUGatherInfoService.decoding_OBUGatherInfo: {}, {}, {} EA", obj.getID(), obj.getRSE_ID(), list.size());
+//
+//        String dsrcId = obj.getID();
+//        try {
+//            for (OBUGatherInfo obuGatherInfo : list) {
+//                String individualId = "";
+//                String manufacturerId = "";
+//                if (obuGatherInfo.getRseIDNumber().getIndividualid() == null) {
+//                    log.warn("{}, ObuGatherInfo.getIndividualid NULL", obj.getID());
+//                    return false;
+//                }
+//                if (obuGatherInfo.getRseIDNumber().getManufacturerid() == null) {
+//                    log.warn("{}, ObuGatherInfo.getManufacturerid NULL", obj.getID());
+//                }
+//
+//                individualId = obuGatherInfo.getRseIDNumber().getIndividualid().toString();
+//                manufacturerId = obuGatherInfo.getRseIDNumber().getManufacturerid().toString();
+//
+//                // individualid == rseId
+//                String obuType = "0";
+//                String vehicleType = "0";
+//                String obuIdNumber = "0";
+//                String generationDate = "0";
+//                String generationTime = "0";
+//                if (obuGatherInfo.getObuType() != null) {
+//                    obuType = obuGatherInfo.getObuType().toString();
+//                }
+//                if (obuGatherInfo.getVehicleType() != null) {
+//                    vehicleType = obuGatherInfo.getVehicleType().toString();
+//                }
+//                if (obuGatherInfo.getObuIdNumber() != null) {
+//                    obuIdNumber = obuGatherInfo.getObuIdNumber().toString();
+//                }
+//                if (obuGatherInfo.getGenerationDate() != null) {
+//                    generationDate = obuGatherInfo.getGenerationDate().toString();
+//                }
+//                if (obuGatherInfo.getGenerationTime() != null) {
+//                    generationTime = obuGatherInfo.getGenerationTime().toString();
+//                }
+//
+//                // 이전 통과 RSE 를 찾는다
+//                //
+//
+//                String generationTm = generationDate+generationTime;
+//                TbRseObuClct voObu = new TbRseObuClct(obj.getID(), generationTm, obuIdNumber, vehicleType, obuType);
+//                obuGatherInfos.add(voObu);
+//
+//                log.debug("OBUGatherInfoService.decoding_OBUGatherInfo: {}, {}, {}, {}, voObu: {}",
+//                        obj.getID(), obj.getRSE_ID(), generationDate, generationTime, voObu.toString());
+//
+//                // 시작 RSE 에 해당하는 모든 구간에 대하여
+//                Iterator<String> startDsrcSectIds = AppRepository.getInstance().rseSectStartMap.get(dsrcId).iterator();
+//                synchronized (this.rseSectService.getDsrcObuPassMap()) {
+//                    while (startDsrcSectIds.hasNext()) {
+//                        String startDsrcSectId = startDsrcSectIds.next();
+//                        if (startDsrcSectId == null || startDsrcSectId.equals("")) {
+//                            continue;
+//                        }
+//                        // 모든 SECT_ID에 대하여 무조건 추가한다.
+//                        voDsrcObuPassInfo obuStartPassInfo = new voDsrcObuPassInfo();
+//                        obuStartPassInfo.setObuId(obuIdNumber);
+//                        obuStartPassInfo.setStartDsrcPassTm(generationTm);
+//                        this.rseSectService.getDsrcObuPassMap().get(startDsrcSectId).put(obuIdNumber, obuStartPassInfo);
+//                    }
+//                }
+//
+//                // 종료 RSE 에 해당하는 모든 구간에 대하여
+//                Iterator<String> endDsrcSectIds = AppRepository.getInstance().rseSectEndMap.get(dsrcId).iterator();
+//                synchronized (this.rseSectService.getDsrcObuPassMap()) {
+//                    while (endDsrcSectIds.hasNext()) {
+//                        String endDsrcSectId = endDsrcSectIds.next();
+//                        if (endDsrcSectId == null || endDsrcSectId.equals("")) {
+//                            continue;
+//                        }
+//                        // 종료 SECT_ID에 대하여 이전 통과정보가 존재하지 않으면 추가, 존재하면 통과종료시각 업데이트
+//                        Map<String, voDsrcObuPassInfo> passInfo = this.rseSectService.getDsrcObuPassMap().get(endDsrcSectId);
+//                        if (passInfo == null || !passInfo.containsKey(obuIdNumber)) {
+//                            // 존재하지 않으면 추가한다.
+//                            voDsrcObuPassInfo obuEndPassInfo = new voDsrcObuPassInfo();
+//                            obuEndPassInfo.setObuId(obuIdNumber);
+//                            obuEndPassInfo.setEndDsrcPassTm(generationTm);
+//                            this.rseSectService.getDsrcObuPassMap().get(endDsrcSectId).put(obuIdNumber, obuEndPassInfo);
+//                            continue;
+//                        }
+//
+//                        // 존재하면 종료 DSRC 통과시각을 업데이트 한다.
+//                        passInfo.get(obuIdNumber).setEndDsrcPassTm(generationTm);
+//                    }
+//                }
+//            }
+//        }
+//        catch(Exception e) {
+//            log.error("{}", e.toString());
+//        }
+//
+//        if (obuGatherInfos.size() > 0) {
+//            // OBU 수집정보를 데이터베이스에 저장
+//            this.dbmsDataProcess.add(new DbmsData(DbmsDataType.DBMS_DATA_OBU_GATHER_LOG, false, (Object)obuGatherInfos));
+//        }
+//        return true;
+//    }
 
 }

+ 1 - 0
src/main/java/com/its/rota/server/xnet/server/process/service/SubscriptionService.java

@@ -1,5 +1,6 @@
 package com.its.rota.server.xnet.server.process.service;
 
+import com.beanit.its.Subscription;
 import com.its.rota.server.dto.CenterDto;
 import io.netty.channel.Channel;
 

+ 45 - 48
src/main/java/com/its/rota/server/xnet/server/process/service/impl/SubscriptionRegisterService.java

@@ -1,18 +1,15 @@
 package com.its.rota.server.xnet.server.process.service.impl;
 
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.eControlDevice;
-import com.beanit.asn1dsrc.enums.eObjectId;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.xnettcp.dsrc.process.service.ControlDeviceService;
-import com.its.dsrc.xnettcp.dsrc.process.service.SubscriptionService;
+import com.beanit.its.Registered;
+import com.beanit.its.Subscription;
+import com.beanit.its.SubscriptionData;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.xnet.server.process.service.SubscriptionService;
 import io.netty.channel.Channel;
 import lombok.extern.slf4j.Slf4j;
 
 import java.io.ByteArrayInputStream;
-import java.util.List;
 
 @Slf4j
 public class SubscriptionRegisterService implements SubscriptionService {
@@ -39,14 +36,14 @@ public class SubscriptionRegisterService implements SubscriptionService {
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
         //log.info("SubscriptionRegisterService.response: {}. ObjectId: {}", ipAddress, objectId);
 
-        if (objectId == eObjectId.OBJ_MultiMediaData.getValue()) {
-            return multiMediaDataResponse(obj, channel, objectId, subscription);
-        }
-
-        if (objectId != eObjectId.OBJ_ControlDevice.getValue()) {
-            log.error("SubscriptionRegisterService.response: {}, Unknown ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
-            return false;
-        }
+//        if (objectId == eObjectId.OBJ_MultiMediaData.getValue()) {
+//            return multiMediaDataResponse(obj, channel, objectId, subscription);
+//        }
+//
+//        if (objectId != eObjectId.OBJ_ControlDevice.getValue()) {
+//            log.error("SubscriptionRegisterService.response: {}, Unknown ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
+//            return false;
+//        }
 
         try {
             Registered registered = null;
@@ -66,34 +63,34 @@ public class SubscriptionRegisterService implements SubscriptionService {
                 // 필요하면 목록에 저장하고 있다가 스케쥴러에 의해 수행될수 있도록 하자.
                 // 서버 모드에서는 특별히 처리할 게 없다.
                 ByteArrayInputStream berInputStream = new ByteArrayInputStream(subscriptionData.getDatexSubscribePdu().getEndApplicationMessageMsg().value);
-                ControlDeviceList devices = new ControlDeviceList();
-                devices.decode(berInputStream);
-                List<ControlDevice> list = devices.getControlDevice();
-                for (ControlDevice controlDevice : list) {
-                    if (controlDevice.getVpbdControlDeviceData() != null) {
-                        eControlDevice e = eControlDevice.getByValue(controlDevice.getVpbdControlID().value[0]);
-                        log.info("SubscriptionRegisterService.response: {}", e.toString());
-                        switch(e) {
-                            case Control_Command:        //(0x01, "Control_Command"),
-                                break;
-                            case Control_BasicInfo:      //(0x02, "Control_BasicInfo"),
-                                break;
-                            case Control_StatusRequest:  //(0x03, "Control_StatusRequest"),
-                                ControlDeviceService.getInstance().decoding_ControlDevice_Status_ITTelecom(obj, controlDevice);
-                                break;
-                            case Control_InfoRequest:    //(0x04, "Control_InfoRequest"),
-                                DSRCTrafficInfoRequest dsrcTrafficInfoRequest = new DSRCTrafficInfoRequest();
-                                ByteArrayInputStream deviceStream = new ByteArrayInputStream(controlDevice.getVpbdControlDeviceData().value);
-                                dsrcTrafficInfoRequest.decode(deviceStream);
-                                log.info("SubscriptionRegisterService.response: {}", dsrcTrafficInfoRequest.toString());
-                                break;
-                            case Control_EnterDirInfo:   //(0x05, "Control_EnterDirInfo"),
-                                break;
-                            case Control_DisconnectInfo: //(0x06, "Control_DisconnectInfo");
-                                break;
-                        }
-                    }
-                }
+//                ControlDeviceList devices = new ControlDeviceList();
+//                devices.decode(berInputStream);
+//                List<ControlDevice> list = devices.getControlDevice();
+//                for (ControlDevice controlDevice : list) {
+//                    if (controlDevice.getVpbdControlDeviceData() != null) {
+//                        eControlDevice e = eControlDevice.getByValue(controlDevice.getVpbdControlID().value[0]);
+//                        log.info("SubscriptionRegisterService.response: {}", e.toString());
+//                        switch(e) {
+//                            case Control_Command:        //(0x01, "Control_Command"),
+//                                break;
+//                            case Control_BasicInfo:      //(0x02, "Control_BasicInfo"),
+//                                break;
+//                            case Control_StatusRequest:  //(0x03, "Control_StatusRequest"),
+//                                ControlDeviceService.getInstance().decoding_ControlDevice_Status_ITTelecom(obj, controlDevice);
+//                                break;
+//                            case Control_InfoRequest:    //(0x04, "Control_InfoRequest"),
+//                                DSRCTrafficInfoRequest dsrcTrafficInfoRequest = new DSRCTrafficInfoRequest();
+//                                ByteArrayInputStream deviceStream = new ByteArrayInputStream(controlDevice.getVpbdControlDeviceData().value);
+//                                dsrcTrafficInfoRequest.decode(deviceStream);
+//                                log.info("SubscriptionRegisterService.response: {}", dsrcTrafficInfoRequest.toString());
+//                                break;
+//                            case Control_EnterDirInfo:   //(0x05, "Control_EnterDirInfo"),
+//                                break;
+//                            case Control_DisconnectInfo: //(0x06, "Control_DisconnectInfo");
+//                                break;
+//                        }
+//                    }
+//                }
             }
         }
         catch(Exception e) {
@@ -104,10 +101,10 @@ public class SubscriptionRegisterService implements SubscriptionService {
 
     private boolean multiMediaDataResponse(CenterDto obj, Channel channel, int objectId, Subscription subscription) {
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
-        if (objectId != eObjectId.OBJ_MultiMediaData.getValue()) {
-            log.error("SubscriptionRegisterService.multiMediaDataResponse: {}, OBJ_MultiMediaData ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
-            return false;
-        }
+//        if (objectId != eObjectId.OBJ_MultiMediaData.getValue()) {
+//            log.error("SubscriptionRegisterService.multiMediaDataResponse: {}, OBJ_MultiMediaData ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
+//            return false;
+//        }
         try {
             Registered registered = null;
             int subscribeSerialNbr = subscription.getDatexSubscribeSerialNbr().value.intValue();

+ 61 - 72
src/main/java/com/its/rota/server/xnet/server/process/service/impl/SubscriptionSingleService.java

@@ -1,26 +1,15 @@
 package com.its.rota.server.xnet.server.process.service.impl;
 
-import com.beanit.asn1bean.ber.types.BerBoolean;
 import com.beanit.asn1bean.ber.types.BerInteger;
 import com.beanit.asn1bean.ber.types.BerOctetString;
-import com.beanit.asn1dsrc.dsrc.*;
-import com.beanit.asn1dsrc.enums.eAuthInfo;
-import com.beanit.asn1dsrc.enums.eControlDevice;
-import com.beanit.asn1dsrc.enums.eControlRequest;
-import com.beanit.asn1dsrc.enums.eObjectId;
-import com.beanit.asn1dsrc.util.DsrcAsn1Utils;
-import com.its.app.utils.NettyUtils;
-import com.its.dsrc.entity.TbRseCtlr;
-import com.its.dsrc.xnettcp.dsrc.process.service.ControlDeviceService;
-import com.its.dsrc.xnettcp.dsrc.process.service.SubscriptionService;
+import com.beanit.its.*;
+import com.its.app.common.utils.NettyUtils;
 import com.its.rota.server.dto.CenterDto;
+import com.its.rota.server.xnet.server.process.service.SubscriptionService;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import lombok.extern.slf4j.Slf4j;
 
-import java.io.ByteArrayInputStream;
-import java.util.List;
-
 @Slf4j
 public class SubscriptionSingleService implements SubscriptionService {
     private static SubscriptionSingleService _instance = null;
@@ -46,66 +35,66 @@ public class SubscriptionSingleService implements SubscriptionService {
         String ipAddress = NettyUtils.getRemoteIpAddress(channel);
         log.info("SubscriptionSingleService.response: {}. SubscriptionSingleService: ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
 
-        if (objectId != eObjectId.OBJ_ControlDevice.getValue()) {
-            log.error("{}. SubscriptionSingleService.response: unknown ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
-            return false;
-        }
+//        if (objectId != eObjectId.OBJ_ControlDevice.getValue()) {
+//            log.error("{}. SubscriptionSingleService.response: unknown ObjectId: {}, Subscription: {}", ipAddress, objectId, subscription.toString());
+//            return false;
+//        }
 
         boolean isMultimedia = false;
         Publication publication = null;
         int serialNmbr = subscription.getDatexSubscribeSerialNbr().value.intValue();
-        byte[] auth = { (byte) eAuthInfo.AI_NonCryptObu.getValue() };
+        byte[] auth = null;//{ (byte) eAuthInfo.AI_NonCryptObu.getValue() };
 
         try {
             SubscriptionData subscriptionData = subscription.getDatexSubscribeType().getSubscription();
-            ControlDeviceList list = new ControlDeviceList();
-            byte[] inBytes = subscriptionData.getDatexSubscribePdu().getEndApplicationMessageMsg().value;
-            list.decode(new ByteArrayInputStream(inBytes, 0, inBytes.length));
-            List<ControlDevice> objs = list.getControlDevice();
-            for (ControlDevice device : objs) {
-                eControlDevice requestType = eControlDevice.getByValue(device.getVpbdControlID().value[0]);
-                if (requestType == null || requestType.getValue() != eControlDevice.Control_InfoRequest.getValue())
-                    continue;
-
-                try {
-                    DSRCTrafficInfoRequest request = new DSRCTrafficInfoRequest();
-                    byte[] datas = device.getVpbdControlDeviceData().value;
-                    request.decode(new ByteArrayInputStream(datas, 0, datas.length));
-                    eControlRequest queryType = eControlRequest.getByValue(request.getQueryType().value.intValue());
-                    ControlDevice resDevice = ControlDeviceService.getInstance().makeControlDevice_BasicBaseInfo(obj, queryType);
-                    EndApplicationMessage endMsg = ControlDeviceService.getInstance().makeEndApplicationMessage(obj, resDevice);
-                    if (endMsg == null) {
-                        log.error("{}. SubscriptionSingleService: EndApplicationMessage error, DSRCTrafficInfoRequest: {}", ipAddress, request.toString());
-                        continue;
-                    }
-
-                    PublicationType publicationType = new PublicationType();
-                    publicationType.setDatexPublishData(endMsg);
-
-                    PublicationData publicationData = new PublicationData();
-                    publicationData.setDatexPublishSubscribeSerialNbr(new BerInteger(serialNmbr));          // 요청 serial nmbr
-                    publicationData.setDatexPublishSerialNbr(new BerInteger(obj.getSeq().nextValue()));     // 생성 serial nmbr
-                    publicationData.setDatexPublishLatePublicationFlag(new BerBoolean(true));
-                    publicationData.setDatexPublishType(publicationType);
-
-                    PublishFormat.DatexPublishData publishData = new PublishFormat.DatexPublishData();
-                    publishData.getPublicationData().add(publicationData);
-
-                    PublishFormat publishFormat = new PublishFormat();
-                    publishFormat.setDatexPublishData(publishData);
-
-                    publication = new Publication();
-                    publication.setDatexPublishFormat(publishFormat);
-                    publication.setDatexPublishGuaranteedBool(new BerBoolean(true));
-                    if (queryType.getValue() == eControlRequest.Request_MulticastInfo.getValue()) {
-                        auth[0] = (byte)eAuthInfo.AI_Multimedia.getValue();
-                        isMultimedia = true;
-                    }
-                }
-                catch (Exception e) {
-                    log.error("{}. SubscriptionSingleService: SubscriptionData: {}, ControlDevice: {}, Exception: {}", ipAddress, subscriptionData.toString(),  device.toString(), e);
-                }
-            }
+//            ControlDeviceList list = new ControlDeviceList();
+//            byte[] inBytes = subscriptionData.getDatexSubscribePdu().getEndApplicationMessageMsg().value;
+//            list.decode(new ByteArrayInputStream(inBytes, 0, inBytes.length));
+//            List<ControlDevice> objs = list.getControlDevice();
+//            for (ControlDevice device : objs) {
+//                eControlDevice requestType = eControlDevice.getByValue(device.getVpbdControlID().value[0]);
+//                if (requestType == null || requestType.getValue() != eControlDevice.Control_InfoRequest.getValue())
+//                    continue;
+//
+//                try {
+//                    DSRCTrafficInfoRequest request = new DSRCTrafficInfoRequest();
+//                    byte[] datas = device.getVpbdControlDeviceData().value;
+//                    request.decode(new ByteArrayInputStream(datas, 0, datas.length));
+//                    eControlRequest queryType = eControlRequest.getByValue(request.getQueryType().value.intValue());
+//                    ControlDevice resDevice = ControlDeviceService.getInstance().makeControlDevice_BasicBaseInfo(obj, queryType);
+//                    EndApplicationMessage endMsg = ControlDeviceService.getInstance().makeEndApplicationMessage(obj, resDevice);
+//                    if (endMsg == null) {
+//                        log.error("{}. SubscriptionSingleService: EndApplicationMessage error, DSRCTrafficInfoRequest: {}", ipAddress, request.toString());
+//                        continue;
+//                    }
+//
+//                    PublicationType publicationType = new PublicationType();
+//                    publicationType.setDatexPublishData(endMsg);
+//
+//                    PublicationData publicationData = new PublicationData();
+//                    publicationData.setDatexPublishSubscribeSerialNbr(new BerInteger(serialNmbr));          // 요청 serial nmbr
+//                    publicationData.setDatexPublishSerialNbr(new BerInteger(obj.getSeq().nextValue()));     // 생성 serial nmbr
+//                    publicationData.setDatexPublishLatePublicationFlag(new BerBoolean(true));
+//                    publicationData.setDatexPublishType(publicationType);
+//
+//                    PublishFormat.DatexPublishData publishData = new PublishFormat.DatexPublishData();
+//                    publishData.getPublicationData().add(publicationData);
+//
+//                    PublishFormat publishFormat = new PublishFormat();
+//                    publishFormat.setDatexPublishData(publishData);
+//
+//                    publication = new Publication();
+//                    publication.setDatexPublishFormat(publishFormat);
+//                    publication.setDatexPublishGuaranteedBool(new BerBoolean(true));
+//                    if (queryType.getValue() == eControlRequest.Request_MulticastInfo.getValue()) {
+//                        auth[0] = (byte)eAuthInfo.AI_Multimedia.getValue();
+//                        isMultimedia = true;
+//                    }
+//                }
+//                catch (Exception e) {
+//                    log.error("{}. SubscriptionSingleService: SubscriptionData: {}, ControlDevice: {}, Exception: {}", ipAddress, subscriptionData.toString(),  device.toString(), e);
+//                }
+//            }
         } catch (Exception e) {
             log.error("{}. SubscriptionSingleService: Subscription: {}, Exception: {}", ipAddress, subscription.toString(), e);
         }
@@ -113,23 +102,23 @@ public class SubscriptionSingleService implements SubscriptionService {
             return false;
         }
 
-        int packetNmbr = obj.getSeq().nextValue();
+        int packetNmbr = 0;//obj.getSeq().nextValue();
         C2CAuthenticatedMessage c2c = new C2CAuthenticatedMessage();
         PDUs pdus = new PDUs();
         pdus.setPublication(publication);
         c2c.setDatexDataPacketNumber(new BerInteger(packetNmbr));
         c2c.setDatexDataPacketPriorityNumber(new BerInteger(0));
         c2c.setDatexAuthenticationInfoText(new BerOctetString(auth));
-        c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
+//        c2c.setOptions(DsrcAsn1Utils.swapHeaderOptions(obj.getHeaderOptions()));
         c2c.setPdu(pdus);
 
-        log.info("SubscriptionSingleService: {}, C2CAuth: {}", obj.getID(), c2c);
+//        log.info("SubscriptionSingleService: {}, C2CAuth: {}", obj.getID(), c2c);
 
         ChannelFuture f = channel.writeAndFlush(c2c);
         if (f.isSuccess()) {
-            obj.putRegisteredCommands(c2c);
+//            obj.putRegisteredCommands(c2c);
         } else {
-            log.error("SubscriptionSingleService: {}, Exception: {}", obj.getID(), c2c);
+//            log.error("SubscriptionSingleService: {}, Exception: {}", obj.getID(), c2c);
         }
 
         if (isMultimedia) {

+ 0 - 20
src/main/resources/mybatis/mapper/CommHistMapper.xml

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.ggits.comm.server.dao.mapper.CommHistMapper">
-
-    <insert id="insertCommHist" parameterType="com.its.rota.server.entity.TbCommHist">
-    <![CDATA[
-        INSERT INTO TB_COMM_HIST ( REGION_CD, COLLCT_DTIME, COLLCT_SN, COMM_CD )
-                          VALUES ( #{obj.regionCd}, SYSDATE, #{obj.collSn}, #{obj.opCode} )
-        ]]>
-    </insert>
-
-    <insert id="insertCommLoginOut" parameterType="com.its.rota.server.entity.TbCommHist">
-    <![CDATA[
-        INSERT INTO TB_COMM_HIST ( REGION_CD, COLLCT_DTIME, COLLCT_SN, SYS_CD )
-                          VALUES ( #{obj.regionCd}, SYSDATE, #{obj.collSn}, #{obj.sysCd} )
-        ]]>
-    </insert>
-
-</mapper>

+ 0 - 42
src/main/resources/mybatis/mapper/DeleteMapper.xml

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.its.rota.server.dao.mapper.DeleteMapper">
-
-    <delete id="deleteRcvLinkTraffic">
-        <![CDATA[
-        DELETE FROM RCV_LINK_TRAFFIC
-        WHERE logdate < SYSDATE - 15/1440 -- 15 분전
-        ]]>
-    </delete>
-
-    <delete id="deleteSndIncident">
-        <![CDATA[
-        DELETE FROM SND_INCIDENT
-        WHERE logdate < SYSDATE - 720/1440 -- 12 시간전
-        ]]>
-    </delete>
-
-    <delete id="deleteRcvLog">
-        <![CDATA[
-        DELETE FROM RCV_LOG
-        WHERE logdate < SYSDATE - 1
-        ]]>
-    </delete>
-
-    <delete id="deleteSndLog">
-        <![CDATA[
-        DELETE FROM SND_LOG
-        WHERE logdate < SYSDATE - 2
-        ]]>
-    </delete>
-
-    <delete id="deleteRcvIncident">
-        <![CDATA[
-        DELETE FROM RCV_INCIDENT
-        WHERE logdate < SYSDATE - 3
-        ]]>
-    </delete>
-
-
-</mapper>

+ 75 - 0
src/main/resources/mybatis/mapper/IncidentMapper.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.its.rota.server.dao.mapper.IncidentMapper">
+
+    <delete id="delCheckIncident" >
+        <![CDATA[
+        DELETE SND_INCIDENT S
+        WHERE EXISTS (SELECT 'X'
+                FROM INCIDENT_CENTER@UTISDB
+               WHERE incidentid = S.node_nodeidnumber
+                 AND reportdate != TO_DATE(SUBSTR(S.updatetypeother, 1, 14), 'YYYYMMDDHH24MISS'))
+        ]]>
+    </delete>
+
+    <insert id="insSndIncident" parameterType="com.its.rota.server.entity.TbCheckIncident">
+        <![CDATA[
+        INSERT INTO SND_INCIDENT(tocenterid, link_linkidnumber, logdate, fromcenterid, node_nodeidnumber,
+                                 contactorganizationnametext, descriptiontypeincidentcode, descriptiontypeincidentother,
+                                 incidentvehiclesinvolvedcode, incidentvehiclesinvolvedother, incidentstatuscode,
+                                 incidentstatusother, updatetypecode, updatetypeother, sendyn)
+        SELECT #{obj.toCenterId},
+               LINK_ID,
+               SYSDATE,
+               #{obj.fromCenterId},
+               INCIDENT_ID,
+               '경찰청정보연계',
+               TO_NUMBER(INCIDENT_TYPE_CD),
+               SUBSTRB(REPLACE(INCIDENT_TITLE,'::',' '),1,255),
+               TO_NUMBER(INCIDENT_SUBTYPE_CD),
+               SUBSTRB(INCIDENT_DESC,1,255),
+               NVL(TO_NUMBER(SUBSTR(INCIDENT_TYPE_CD,4,2)), 2),
+               TO_CHAR(LOCATION_DATA_X, '000.000000000000')||TO_CHAR(LOCATION_DATA_Y, '00.0000000000000')||ADDRESS_NEW,
+               TO_NUMBER(SUBSTR(INCIDENT_GRADE_CD,5,1)),
+               TO_CHAR(REPORT_DATE, 'YYYYMMDDHH24MISS')||TO_CHAR(START_DATE, 'YYYYMMDDHH24MISS')||TO_CHAR(END_DATE, 'YYYYMMDDHH24MISS'),
+               'N'
+        FROM UTISINCI.TB_IMS_DATA@UTISDB I, CENTER_REGION R
+        WHERE NOT EXISTS (SELECT 'X'
+                          FROM SND_INCIDENT
+                          WHERE I.INCIDENT_ID = node_nodeidnumber
+                            AND tocenterid    = #{obj.toCenterId}
+                          )
+            AND REPORT_DATE   > SYSDATE - 720/1440
+            AND R.centerid    = #{obj.fromCenterId}
+            AND LENGTH(LINK_ID) = 10
+            AND LOCATION_DATA_X > 100
+            AND LOCATION_DATA_Y < 100
+            AND INCIDENT_GRADE_CD IN ('A0401','A0402')
+            AND R.regioncd = TO_NUMBER(SUBSTR(LINK_ID, 1, 3))
+        ]]>
+    </insert>
+
+    <select id="selSndIncident" parameterType="com.its.rota.server.entity.TbCheckIncident" resultType="com.its.rota.server.entity.TbSndIncident">
+        <![CDATA[
+        SELECT link_linkidnumber as          linkId,
+               node_nodeidnumber             as nodeId,
+               contactorganizationnametext   as contactOrganizationNameText,
+               descriptiontypeincidentcode   as descriptionTypeIncidentCode,
+               descriptiontypeincidentother  as descriptionTypeIncidentOther,
+               incidentvehiclesinvolvedcode  as incidentVehiclesInvolvedCode,
+               incidentvehiclesinvolvedother as incidentVehiclesInvolvedOther,
+               incidentstatuscode            as incidentStatusCode,
+               incidentstatusother           as incidentStatusOther,
+               updatetypecode                as updateTypeCode,
+               updatetypeother               as updateTypeOther
+        FROM SND_INCIDENT
+        WHERE tocenterid = #{obj.toCenterId}
+          AND logdate > SYSDATE - 720/1440
+          AND fromcenterid = #{obj.fromCenterId}
+          AND sendyn != 'Y'
+  AND ROWNUM < 100
+        ]]>
+    </select>
+
+</mapper>

+ 0 - 14
src/main/resources/mybatis/mapper/IntEventHistMapper.xml

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.ggits.comm.server.dao.mapper.IntEventHistMapper">
-
-    <insert id="insertIntEventHist" parameterType="com.its.rota.server.entity.TbIntEventHist">
-    <![CDATA[
-        INSERT INTO TB_INT_EVENT_HIST( REGION_CD,  INT_NO, COLLCT_DTIME, COLLCT_SN, EVENT_CD )
-                              VALUES (#{obj.regionCd}, #{obj.intNo}, SYSDATE, EVENT.NEXTVAL, #{obj.eventCd} )
-        ]]>
-    </insert>
-
-
-</mapper>

+ 0 - 451
src/main/resources/mybatis/mapper/IntMapper.xml

@@ -1,451 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.ggits.comm.server.dao.mapper.IntMapper">
-
-    <select id="selectGgitsIntAll" parameterType="java.lang.String" resultType="com.its.rota.server.entity.TbInt" fetchSize="1024">
-        <![CDATA[
-        SELECT A.REGION_CD AS regionCd,
-               B.REGION_NO * 10000 + A.INT_NO AS intLcNo,
-               A.INT_NO AS intNo,
-               A.INT_NM AS intNm,
-               NVL(A.INT_TYPE,     0) AS intType,
-               NVL(A.INT_LCTYPE,   1) AS intLcType,
-               NVL(A.INT_LAMPTYPE, 3) AS intLampType,
-               NVL(A.MAIN_INTNO,   0) AS mainIntNo,
-               NVL(A.GROUP_NO,     0) AS groupNo,
-               NVL(A.NODE_ID,      0) AS nodeId
-        FROM TB_INT A, TB_REGION_GGITS B
-        WHERE A.REGION_CD = B.REGION_CD
-        ]]>
-    </select>
-    <select id="selectAll" parameterType="java.lang.String" resultType="com.its.rota.server.entity.TbInt" fetchSize="1024">
-        <![CDATA[
-        SELECT A.REGION_CD AS regionCd,
-               B.REGION_NO * 10000 + A.INT_NO AS intLcNo,
-               A.INT_NO AS intNo,
-               A.INT_NM AS intNm,
-               NVL(A.INT_TYPE,     0) AS intType,
-               NVL(A.INT_LCTYPE,   1) AS intLcType,
-               NVL(A.INT_LAMPTYPE, 3) AS intLampType,
-               NVL(A.MAIN_INTNO,   0) AS mainIntNo,
-               NVL(A.GROUP_NO,     0) AS groupNo,
-               NVL(A.NODE_ID,      0) AS nodeId
-        FROM TB_INT A, TB_REGION_GGITS B
-        WHERE A.REGION_CD = B.REGION_CD
-          AND A.REGION_CD = #{regionCd}
-        ]]>
-    </select>
-
-    <insert id="insertIntUnknown" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT( REGION_CD,  INT_NO,  INT_NM, X_COORD, Y_COORD, UPD_DTIME)
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.intNn}, 0, 0, SYSDATE )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownPhase" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_PHASE( REGION_CD,  INT_NO, MAP_NO )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, 0 )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownStatus" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_STATUS( REGION_CD,  INT_NO )
-        VALUES (#{obj.regionCd}, #{obj.intNo} )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownResrvPlan" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_RESRV_PLAN( REGION_CD,  INT_NO, RESRV_NO )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.pNum} )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownPlan" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_PLAN( REGION_CD,  INT_NO, INT_PLAN_NO )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.pNum} )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownOperPlan" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_OPER_PLAN( REGION_CD,  INT_NO, INT_PLAN_NO, INT_PLAN_IDX_NO )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.pNum}, #{obj.iNum} )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownHolyDdPlan" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_HOLYDD_PLAN( REGION_CD,  INT_NO, PLAN_SN )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.pNum} )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownDyPlan" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_DY_PLAN( REGION_CD,  INT_NO, PLAN_DY )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.pNum} )
-        ]]>
-    </insert>
-
-    <insert id="insertIntUnknownSignalMap" parameterType="com.its.rota.server.entity.TbIntUnknown">
-    <![CDATA[
-        INSERT INTO TB_INT_SIGNALMAP( REGION_CD,  INT_NO, RING_NO, PLAN_TP, STEP_NO )
-        VALUES (#{obj.regionCd}, #{obj.intNo}, #{obj.pNum}, #{obj.iNum}, #{obj.oNum} )
-        ]]>
-    </insert>
-
-    <select id="selectCurrTransAll" parameterType="java.lang.String" resultType="com.its.rota.server.entity.TbCurrTrans">
-        <![CDATA[
-        SELECT T.REGION_CD AS regionCd,
-               T.INT_NO AS intNo,
-               T.RING_NO AS ringNo,
-               T.PLAN_TP AS planTp,
-               T.STEP_NO AS stepNo,
-               T.MIN_TM AS minTm,
-               T.MAX_TM AS maxTm,
-               T.EOP AS eop,
-               A.INT_MAINPHASE AS intMainPhase
-        FROM TB_INT_SIGNALMAP T,
-             TB_INT_PHASE     A,
-             TB_INT_STATUS    B
-        WHERE T.REGION_CD = A.REGION_CD
-          AND T.INT_NO    = A.INT_NO
-          AND A.REGION_CD = B.REGION_CD
-          AND A.INT_NO    = B.INT_NO
-          AND T.PLAN_TP   = B.MAP_NO
-          AND A.MAP_NO    = B.MAP_NO
-          AND (T.MIN_TM > 0 OR T.MAX_TM > 0 OR T.EOP > 0)
-          AND T.REGION_CD = #{regionCd}
-        ORDER BY 1,2,3,4,5
-        ]]>
-    </select>
-
-    <select id="selectCurrTodAll" parameterType="java.lang.String" resultType="com.its.rota.server.entity.TbCurrTod">
-        <![CDATA[
-        SELECT A.REGION_CD                  AS regionCd,
-               A.INT_NO                     AS intNo,
-               A.INT_PLAN_NO                AS planNo,
-               A.INT_PLAN_IDX_NO            AS idxNo,
-               NVL(A.OPER_PLAN_HH,       0) AS hour,
-       NVL(A.OPER_PLAN_MI,       0) AS minute,
-       NVL(A.INT_OPER_CYCLE_VAL, 0) AS cycle,
-       NVL(A.INT_OPER_OFFSET_VAL,0) AS offset,
-            NVL(A.A_RING_1_PHASE_VAL, 0) AS splitA1,
-            NVL(A.A_RING_2_PHASE_VAL, 0) AS splitA2,
-            NVL(A.A_RING_3_PHASE_VAL, 0) AS splitA3,
-            NVL(A.A_RING_4_PHASE_VAL, 0) AS splitA4,
-            NVL(A.A_RING_5_PHASE_VAL, 0) AS splitA5,
-            NVL(A.A_RING_6_PHASE_VAL, 0) AS splitA6,
-            NVL(A.A_RING_7_PHASE_VAL, 0) AS splitA7,
-            NVL(A.A_RING_8_PHASE_VAL, 0) AS splitA8,
-            NVL(A.B_RING_1_PHASE_VAL, 0) AS splitB1,
-            NVL(A.B_RING_2_PHASE_VAL, 0) AS splitB2,
-            NVL(A.B_RING_3_PHASE_VAL, 0) AS splitB3,
-            NVL(A.B_RING_4_PHASE_VAL, 0) AS splitB4,
-            NVL(A.B_RING_5_PHASE_VAL, 0) AS splitB5,
-            NVL(A.B_RING_6_PHASE_VAL, 0) AS splitB6,
-            NVL(A.B_RING_7_PHASE_VAL, 0) AS splitB7,
-            NVL(A.B_RING_8_PHASE_VAL, 0) AS splitB8
-        FROM TB_INT_OPER_PLAN A,
-            (SELECT IDP.REGION_CD, IDP.INT_NO,
-            NVL2(IHP.INT_PLAN_NO, IHP.INT_PLAN_NO, IDP.INT_PLAN_NO) AS INT_PLAN_NO
-            FROM (SELECT REGION_CD, INT_NO, INT_PLAN_NO
-            FROM TB_INT_DY_PLAN
-            WHERE PLAN_DY = TO_NUMBER(TO_CHAR (SYSDATE, 'D'))
-            ) IDP
-            LEFT OUTER JOIN
-            (SELECT REGION_CD, INT_NO, INT_PLAN_NO
-            FROM TB_INT_HOLYDD_PLAN
-            WHERE LPAD(HOLYDD_PLAN_MM, 2, 0) = TO_CHAR(SYSDATE, 'MM')
-            AND LPAD(HOLYDD_PLAN_DD, 2, 0) = TO_CHAR(SYSDATE, 'DD')
-            ) IHP
-            ON IDP.REGION_CD = IHP.REGION_CD
-            AND IDP.INT_NO    = IHP.INT_NO
-            ) B
-        WHERE A.REGION_CD = #{regionCd}
-          AND A.REGION_CD = B.REGION_CD
-          AND A.INT_NO = B.INT_NO
-          AND B.INT_PLAN_NO = A.INT_PLAN_NO
-        ORDER BY A.REGION_CD, A.INT_NO, A.INT_PLAN_IDX_NO
-        ]]>
-    </select>
-
-    <update id="initIntStts">
-    <![CDATA[
-        MERGE INTO TB_INT_STATUS L
-            USING (SELECT A.REGION_CD, B.INT_NO
-                   FROM TB_REGION_CENTER A,
-                        TB_INT           B
-                   WHERE A.REGION_CD = B.REGION_CD
-                     AND B.INT_TYPE  = 0) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO)
-                VALUES (M.REGION_CD, M.INT_NO)
-        ]]>
-    </update>
-
-    <update id="initIntPlan">
-    <![CDATA[
-        MERGE INTO TB_INT_PLAN L
-            USING (SELECT A.REGION_CD, B.INT_NO, C.IDX AS INT_PLAN_NO
-                   FROM TB_REGION_CENTER A,
-                        TB_INT           B,
-                        (SELECT LEVEL AS IDX FROM DUAL CONNECT BY LEVEL <= 10) C
-                   WHERE A.REGION_CD = B.REGION_CD
-                     AND B.INT_TYPE  = 0) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO, INT_PLAN_NO)
-                VALUES (M.REGION_CD, M.INT_NO, M.INT_PLAN_NO)
-        ]]>
-    </update>
-
-    <update id="initIntOperPlan">
-    <![CDATA[
-        MERGE INTO TB_INT_OPER_PLAN L
-            USING (SELECT A.REGION_CD, B.INT_NO, C.INT_PLAN_NO, C.INT_PLAN_IDX_NO
-                   FROM TB_REGION_CENTER A,
-                        TB_INT           B,
-                        (SELECT A.IDX AS INT_PLAN_NO, B.IDX AS INT_PLAN_IDX_NO
-                         FROM (SELECT LEVEL AS IDX FROM DUAL CONNECT BY LEVEL <= 10) A,
-                              (SELECT LEVEL AS IDX FROM DUAL CONNECT BY LEVEL <= 16) B) C
-                   WHERE A.REGION_CD = B.REGION_CD
-                     AND B.INT_TYPE  = 0) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO
-                AND L.INT_PLAN_NO = M.INT_PLAN_NO
-                AND L.INT_PLAN_IDX_NO = M.INT_PLAN_IDX_NO)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO, INT_PLAN_NO, INT_PLAN_IDX_NO)
-                VALUES (M.REGION_CD, M.INT_NO, M.INT_PLAN_NO, M.INT_PLAN_IDX_NO)
-        ]]>
-    </update>
-
-    <update id="initIntDyPlan">
-    <![CDATA[
-        MERGE INTO TB_INT_DY_PLAN L
-            USING (SELECT A.REGION_CD, B.INT_NO, C.IDX AS PLAN_DY
-                   FROM TB_REGION_CENTER A,
-                        TB_INT           B,
-                        (SELECT LEVEL AS IDX FROM DUAL CONNECT BY LEVEL <= 7) C
-                   WHERE A.REGION_CD = B.REGION_CD
-                     AND B.INT_TYPE  = 0) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO
-                AND L.PLAN_DY = M.PLAN_DY)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO, PLAN_DY, INT_PLAN_NO)
-                VALUES (M.REGION_CD, M.INT_NO, M.PLAN_DY, 1)
-        ]]>
-    </update>
-
-    <update id="initIntResrvPlan">
-    <![CDATA[
-        MERGE INTO TB_INT_RESRV_PLAN L
-            USING (SELECT A.REGION_CD, B.INT_NO, C.IDX AS RESRV_NO
-                   FROM TB_REGION_CENTER A,
-                        TB_INT           B,
-                        (SELECT LEVEL AS IDX FROM DUAL CONNECT BY LEVEL <= 10) C
-                   WHERE A.REGION_CD = B.REGION_CD
-                     AND B.INT_TYPE  = 0) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO, RESRV_NO)
-                VALUES (M.REGION_CD, M.INT_NO, M.RESRV_NO)
-        ]]>
-    </update>
-
-    <update id="initIntHolyDdPlan">
-    <![CDATA[
-        MERGE INTO TB_INT_HOLYDD_PLAN L
-            USING (SELECT A.REGION_CD, B.INT_NO, C.IDX AS PLAN_SN
-                   FROM TB_REGION_CENTER A,
-                        TB_INT           B,
-                        (SELECT LEVEL AS IDX FROM DUAL CONNECT BY LEVEL <= 30) C
-                   WHERE A.REGION_CD = B.REGION_CD
-                     AND B.INT_TYPE  = 0) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO, PLAN_SN)
-                VALUES (M.REGION_CD, M.INT_NO, M.PLAN_SN)
-        ]]>
-    </update>
-
-    <update id="initIntSignalMap">
-    <![CDATA[
-        MERGE INTO TB_INT_SIGNALMAP L
-            USING (SELECT A.REGION_CD, A.INT_NO, B.RING_NO, B.PLAN_TP, B.STEP_NO
-                   FROM (SELECT A.REGION_CD, B.INT_NO
-                         FROM TB_REGION_CENTER A,
-                              TB_INT           B
-                         WHERE A.REGION_CD = B.REGION_CD
-                           AND B.INT_TYPE  = 0
-                        ) A,
-                        (SELECT L.RING_NO, L.PLAN_TP, M.IDX AS STEP_NO
-                         FROM (SELECT X.IDX AS RING_NO, Y.IDX AS PLAN_TP
-                               FROM (SELECT LEVEL-1 AS IDX FROM DUAL CONNECT BY LEVEL <=  2) X,
-                                    (SELECT LEVEL-1 AS IDX FROM DUAL CONNECT BY LEVEL <=  7) Y
-                              ) L,
-                              (SELECT LEVEL   AS IDX FROM DUAL CONNECT BY LEVEL <= 32) M
-                        ) B) M
-            ON (L.REGION_CD = M.REGION_CD
-                AND L.INT_NO = M.INT_NO)
-            WHEN NOT MATCHED THEN
-                INSERT (REGION_CD, INT_NO, RING_NO, PLAN_TP, STEP_NO)
-                VALUES (M.REGION_CD, M.INT_NO, M.RING_NO, M.PLAN_TP, M.STEP_NO)
-        ]]>
-    </update>
-
-    <update id="updateIntPhaseStts" parameterType="java.util.Map">
-    <![CDATA[
-        UPDATE TB_INT_STATUS
-        SET COLLCT_DTIME                = TO_DATE(#{COLLCT_DTIME},'YYYYMMDDHH24MISS')
-          , SYS_COLLCT_DTIME            = SYSDATE
-          , COMM_ON_OFF_FLAG            = #{COMM_ON_OFF_FLAG}
-          , CONTRLR_OPER_MODE_CD        = #{CONTRLR_OPER_MODE_CD}
-          , A_RING_PHASE_VAL            = #{A_RING_PHASE_VAL}
-          , B_RING_PHASE_VAL            = #{B_RING_PHASE_VAL}
-          , SIGLIGHT_TURNOFF_FLAG       = #{SIGLIGHT_TURNOFF_FLAG}
-          , SIGLIGHT_BLINK_FLAG         = #{SIGLIGHT_BLINK_FLAG}
-          , CONTRLR_MANUAL_FLAG         = #{CONTRLR_MANUAL_FLAG}
-          , MAP_NO                      = #{MAP_NO}
-          , CONTRLR_TMDIFF_CONTRL_FLAG  = #{CONTRLR_TMDIFF_CONTRL_FLAG}
-          , INT_SIG_CYCLE_CNT           = #{INT_SIG_CYCLE_CNT}
-          , INT_SIG_CYCLE_LEN           = #{INT_SIG_CYCLE_LEN}
-          , A_RING_1_PHASE_VAL          = #{A_RING_1_PHASE_VAL}
-          , A_RING_2_PHASE_VAL          = #{A_RING_2_PHASE_VAL}
-          , A_RING_3_PHASE_VAL          = #{A_RING_3_PHASE_VAL}
-          , A_RING_4_PHASE_VAL          = #{A_RING_4_PHASE_VAL}
-          , A_RING_5_PHASE_VAL          = #{A_RING_5_PHASE_VAL}
-          , A_RING_6_PHASE_VAL          = #{A_RING_6_PHASE_VAL}
-          , A_RING_7_PHASE_VAL          = #{A_RING_7_PHASE_VAL}
-          , A_RING_8_PHASE_VAL          = #{A_RING_8_PHASE_VAL}
-          , B_RING_1_PHASE_VAL          = #{B_RING_1_PHASE_VAL}
-          , B_RING_2_PHASE_VAL          = #{B_RING_2_PHASE_VAL}
-          , B_RING_3_PHASE_VAL          = #{B_RING_3_PHASE_VAL}
-          , B_RING_4_PHASE_VAL          = #{B_RING_4_PHASE_VAL}
-          , B_RING_5_PHASE_VAL          = #{B_RING_5_PHASE_VAL}
-          , B_RING_6_PHASE_VAL          = #{B_RING_6_PHASE_VAL}
-          , B_RING_7_PHASE_VAL          = #{B_RING_7_PHASE_VAL}
-          , B_RING_8_PHASE_VAL          = #{B_RING_8_PHASE_VAL}
-          , PPC_CONTRL_FLAG             = #{PPC_CONTRL_FLAG}
-          , GROUP_NO                    = #{GROUP_NO}
-          , SIMULFLAG                   = 'N'
-        WHERE REGION_CD = #{REGION_CD}
-          AND INT_NO    = #{INT_NO}
-        ]]>
-    </update>
-
-    <update id="updateIntStaticCycle" parameterType="java.util.Map">
-    <![CDATA[
-        UPDATE TB_INT_STATUS
-        SET COLLCT_DTIME               = TO_DATE(#{COLLCT_DTIME},'YYYYMMDDHH24MISS')
-          , SYS_COLLCT_DTIME           = SYSDATE
-          , COMM_ON_OFF_FLAG           = #{COMM_ON_OFF_FLAG}
-          , CONTRLR_OPER_MODE_CD       = #{CONTRLR_OPER_MODE_CD}
-          , A_RING_PHASE_VAL           = #{A_RING_PHASE_VAL}
-          , B_RING_PHASE_VAL           = #{B_RING_PHASE_VAL}
-          , SIGLIGHT_TURNOFF_FLAG      = #{SIGLIGHT_TURNOFF_FLAG}
-          , SIGLIGHT_BLINK_FLAG        = #{SIGLIGHT_BLINK_FLAG}
-          , CONTRLR_MANUAL_FLAG        = #{CONTRLR_MANUAL_FLAG}
-          , MAP_NO                     = #{MAP_NO}
-          , CONTRLR_TMDIFF_CONTRL_FLAG = #{CONTRLR_TMDIFF_CONTRL_FLAG}
-          , INT_SIG_CYCLE_CNT          = #{INT_SIG_CYCLE_CNT}
-          , INT_SIG_CYCLE_LEN          = #{INT_SIG_CYCLE_LEN}
-          , PPC_CONTRL_FLAG            = #{PPC_CONTRL_FLAG}
-          , SIMULFLAG                  = 'N'
-        WHERE REGION_CD = REGION_CD = #{REGION_CD}
-          AND INT_NO    = #{INT_NO}
-        ]]>
-    </update>
-
-    <update id="updateIntSimulationSend" parameterType="java.util.Map">
-    <![CDATA[
-        UPDATE TB_INT_STATUS
-        SET COLLCT_DTIME                = SYSDATE
-          , SYS_COLLCT_DTIME            = SYSDATE
-          , COMM_ON_OFF_FLAG            = #{COMM_ON_OFF_FLAG}
-          , CONTRLR_OPER_MODE_CD        = #{CONTRLR_OPER_MODE_CD}
-          , A_RING_PHASE_VAL            = #{A_RING_PHASE_VAL}
-          , B_RING_PHASE_VAL            = #{B_RING_PHASE_VAL}
-          , SIGLIGHT_TURNOFF_FLAG       = #{SIGLIGHT_TURNOFF_FLAG}
-          , SIGLIGHT_BLINK_FLAG         = #{SIGLIGHT_BLINK_FLAG}
-          , CONTRLR_MANUAL_FLAG         = #{CONTRLR_MANUAL_FLAG}
-          , MAP_NO                      = #{MAP_NO}
-          , CONTRLR_TMDIFF_CONTRL_FLAG  = #{CONTRLR_TMDIFF_CONTRL_FLAG}
-          , INT_SIG_CYCLE_CNT           = #{INT_SIG_CYCLE_CNT}
-          , INT_SIG_CYCLE_LEN           = #{INT_SIG_CYCLE_LEN}
-          , A_RING_1_PHASE_VAL          = #{A_RING_1_PHASE_VAL}
-          , A_RING_2_PHASE_VAL          = #{A_RING_2_PHASE_VAL}
-          , A_RING_3_PHASE_VAL          = #{A_RING_3_PHASE_VAL}
-          , A_RING_4_PHASE_VAL          = #{A_RING_4_PHASE_VAL}
-          , A_RING_5_PHASE_VAL          = #{A_RING_5_PHASE_VAL}
-          , A_RING_6_PHASE_VAL          = #{A_RING_6_PHASE_VAL}
-          , A_RING_7_PHASE_VAL          = #{A_RING_7_PHASE_VAL}
-          , A_RING_8_PHASE_VAL          = #{A_RING_8_PHASE_VAL}
-          , B_RING_1_PHASE_VAL          = #{B_RING_1_PHASE_VAL}
-          , B_RING_2_PHASE_VAL          = #{B_RING_2_PHASE_VAL}
-          , B_RING_3_PHASE_VAL          = #{B_RING_3_PHASE_VAL}
-          , B_RING_4_PHASE_VAL          = #{B_RING_4_PHASE_VAL}
-          , B_RING_5_PHASE_VAL          = #{B_RING_5_PHASE_VAL}
-          , B_RING_6_PHASE_VAL          = #{B_RING_6_PHASE_VAL}
-          , B_RING_7_PHASE_VAL          = #{B_RING_7_PHASE_VAL}
-          , B_RING_8_PHASE_VAL          = #{B_RING_8_PHASE_VAL}
-          , PPC_CONTRL_FLAG             = #{PPC_CONTRL_FLAG}
-          , SIMULFLAG                   = 'Y'
-        WHERE REGION_CD = #{REGION_CD}
-          AND INT_NO    = #{INT_NO}
-        ]]>
-    </update>
-
-    <update id="updateIntSimulationSendTrans" parameterType="java.util.Map">
-    <![CDATA[
-        UPDATE TB_INT_STATUS_TOD
-        SET COLLCT_DTIME                = SYSDATE
-          , SYS_COLLCT_DTIME            = SYSDATE
-          , COMM_ON_OFF_FLAG            = #{COMM_ON_OFF_FLAG}
-          , CONTRLR_OPER_MODE_CD        = #{CONTRLR_OPER_MODE_CD}
-          , A_RING_PHASE_VAL            = #{A_RING_PHASE_VAL}
-          , B_RING_PHASE_VAL            = #{B_RING_PHASE_VAL}
-          , SIGLIGHT_TURNOFF_FLAG       = #{SIGLIGHT_TURNOFF_FLAG}
-          , SIGLIGHT_BLINK_FLAG         = #{SIGLIGHT_BLINK_FLAG}
-          , CONTRLR_MANUAL_FLAG         = #{CONTRLR_MANUAL_FLAG}
-          , MAP_NO                      = #{MAP_NO}
-          , CONTRLR_TMDIFF_CONTRL_FLAG  = #{CONTRLR_TMDIFF_CONTRL_FLAG}
-          , INT_SIG_CYCLE_CNT           = #{INT_SIG_CYCLE_CNT}
-          , INT_SIG_CYCLE_LEN           = #{INT_SIG_CYCLE_LEN}
-          , A_RING_1_PHASE_VAL          = #{A_RING_1_PHASE_VAL}
-          , A_RING_2_PHASE_VAL          = #{A_RING_2_PHASE_VAL}
-          , A_RING_3_PHASE_VAL          = #{A_RING_3_PHASE_VAL}
-          , A_RING_4_PHASE_VAL          = #{A_RING_4_PHASE_VAL}
-          , A_RING_5_PHASE_VAL          = #{A_RING_5_PHASE_VAL}
-          , A_RING_6_PHASE_VAL          = #{A_RING_6_PHASE_VAL}
-          , A_RING_7_PHASE_VAL          = #{A_RING_7_PHASE_VAL}
-          , A_RING_8_PHASE_VAL          = #{A_RING_8_PHASE_VAL}
-          , B_RING_1_PHASE_VAL          = #{B_RING_1_PHASE_VAL}
-          , B_RING_2_PHASE_VAL          = #{B_RING_2_PHASE_VAL}
-          , B_RING_3_PHASE_VAL          = #{B_RING_3_PHASE_VAL}
-          , B_RING_4_PHASE_VAL          = #{B_RING_4_PHASE_VAL}
-          , B_RING_5_PHASE_VAL          = #{B_RING_5_PHASE_VAL}
-          , B_RING_6_PHASE_VAL          = #{B_RING_6_PHASE_VAL}
-          , B_RING_7_PHASE_VAL          = #{B_RING_7_PHASE_VAL}
-          , B_RING_8_PHASE_VAL          = #{B_RING_8_PHASE_VAL}
-          , PPC_CONTRL_FLAG             = #{PPC_CONTRL_FLAG}
-          , SIMULFLAG                   = 'Y'
-        WHERE REGION_CD = #{REGION_CD}
-          AND INT_NO    = #{INT_NO}
-        ]]>
-    </update>
-
-</mapper>

+ 1 - 1
src/main/resources/mybatis/mapper/ProcessMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
-<mapper namespace="com.ggits.comm.server.dao.mapper.ProcessMapper">
+<mapper namespace="com.its.rota.server.dao.mapper.ProcessMapper">
 
     <update id="initProcessStts">
     <![CDATA[

+ 0 - 87
src/main/resources/mybatis/mapper/RegionCenterMapper.xml

@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="com.ggits.comm.server.dao.mapper.RegionCenterMapper">
-
-    <select id="selectRegionGgits" resultType="com.its.rota.server.entity.TbRegionGgits" fetchSize="50">
-        <![CDATA[
-        SELECT A.REGION_CD AS regionCd,
-               A.REGION_NO AS ggitsRegionNo,
-               B.REGION_ID AS regionId
-        FROM TB_REGION_GGITS A, TB_REGION_CENTER B
-        WHERE A.REGION_CD = B.REGION_CD
-        ]]>
-    </select>
-
-    <select id="selectRegionCenter" resultType="com.its.rota.server.entity.TbRegionCenter" fetchSize="50">
-        <![CDATA[
-        SELECT B.REGION_CD AS regionCd,
-               B.REGION_NM AS regionNm,
-               NVL(B.IP_ADDRESS, '192.168.24.22') AS ipAddress,
-               B.LOGIN_ID AS loginId,
-               B.LOGIN_PSWD AS loginPswd,
-               B.FILE_UPD_DT AS fileUpdDt,
-               B.SIMUL_FLAG AS simulateFlag,
-               B.REGION_ID AS regionId,
-               B.EXT_YN AS extYn,
-               B.REALTIME_YN AS realtimeYn,
-               B.DBASE_YN AS dbaseYn,
-               B.COMM_HIST_YN AS commHistYn,
-               A.MIN_INT_NO AS minIntNo,
-               A.MAX_INT_NO AS maxIntNo,
-               A.INT_CNT AS intCount
-        FROM (SELECT TRIM(REGION_CD) AS REGION_CD,
-                     MIN(INT_NO) AS MIN_INT_NO, MAX(INT_NO) AS MAX_INT_NO,
-                     COUNT(1) AS INT_CNT
-              FROM TB_INT
-              GROUP BY REGION_CD) A,
-             (SELECT TRIM(A.REGION_CD)            AS REGION_CD,
-                     TRIM(A.REGION_NM)            AS REGION_NM,
-                     TRIM(A.IP_ADDRESS)           AS IP_ADDRESS,
-                     TRIM(A.REGION_CENTER_ID)     AS LOGIN_ID,
-                     TRIM(A.REGION_CENTER_PASSWD) AS LOGIN_PSWD,
-                     NVL(A.FILE_UPD_DT, '000000000000')   AS FILE_UPD_DT,
-                     NVL(A.SIMUL_FLAG,  'N')              AS SIMUL_FLAG,
-                     A.REGION_ID                          AS REGION_ID,
-                     NVL(B.EXT_YN,      'N')              AS EXT_YN,
-                     NVL(B.REALTIME_YN, 'N')              AS REALTIME_YN,
-                     NVL(B.DBASE_YN,    'N')              AS DBASE_YN,
-                     NVL(A.COMM_HIST_YN,'N')              AS COMM_HIST_YN
-              FROM TB_REGION_CENTER A, TB_REGION_CENTER_SVC B
-              WHERE A.REGION_CD = B.REGION_CD(+)
-             ) B, TB_REGION_GGITS C
-        WHERE A.REGION_CD = B.REGION_CD
-          AND B.REGION_CD = C.REGION_CD
-        ]]>
-    </select>
-
-    <update id="updateCommState" parameterType="com.its.rota.server.entity.TbRegionCenterComm">
-    <![CDATA[
-        UPDATE TB_REGION_CENTER
-        SET COMM_STATE = #{obj.commState},
-            REG_DATE   = SYSDATE
-        WHERE REGION_CD  = #{obj.regionCd}
-        ]]>
-    </update>
-
-    <update id="updateCommStateConnect" parameterType="com.its.rota.server.entity.TbRegionCenterComm">
-    <![CDATA[
-        UPDATE TB_REGION_CENTER
-        SET COMM_STATE = #{obj.commState},
-            CONN_DATE  =  SYSDATE,
-            REG_DATE   = SYSDATE
-        WHERE REGION_CD  = #{obj.regionCd}
-        ]]>
-    </update>
-
-    <update id="updateCommStateDisconnect" parameterType="com.its.rota.server.entity.TbRegionCenterComm">
-    <![CDATA[
-        UPDATE TB_REGION_CENTER
-        SET COMM_STATE = #{obj.commState},
-            DISCON_DATE =  SYSDATE,
-            REG_DATE   = SYSDATE
-        WHERE REGION_CD  = #{obj.regionCd}
-        ]]>
-    </update>
-
-</mapper>

+ 32 - 0
src/main/resources/mybatis/mapper/TrafficMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.its.rota.server.dao.mapper.TrafficMapper">
+
+    <select id="selCheckTraffic" resultType="com.its.rota.server.entity.TbCheckTraffic">
+        <![CDATA[
+        SELECT TO_CHAR(regdate, 'YYYYMMDDHH24MISS') as regDate
+        FROM TRAFFIC_CENTER@UTISDB
+        WHERE regdate > (SYSDATE - 15/1440)
+          AND ROWNUM < 2
+        ]]>
+    </select>
+
+    <select id="selectRegionCenter" resultType="com.its.rota.server.entity.TbCenter" fetchSize="100">
+        <![CDATA[
+        SELECT SUBSTR(centerid, 1, 10) as centerid,
+               SUBSTR(centerinfo, 1, 20) as centerInfo,
+               ipaddress as ipAddress,
+               commport as commPort,
+               datexuser as datexUser,
+               datexpasswd as datexPasswd,
+               heartbeatcycle as heartBeat,
+               restime as resTime,
+               datagramsize as datagramSize
+        FROM CENTER
+        WHERE centerflag = 'L'
+          AND exeyn = 'Y'
+        ]]>
+    </select>
+
+</mapper>

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است