shjung 11 maanden geleden
bovenliggende
commit
4134f08f16

+ 0 - 44
src/main/java/com/beanit/enums/eControlCommand.java

@@ -1,44 +0,0 @@
-package com.beanit.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum eControlCommand {
-
-    ControlCommand_Status_Request       (0x00, "ControlCommand_Status_Request"),
-    ControlCommand_Reset                (0x01, "ControlCommand_Reset"),
-    ControlCommand_Push_Broadcast_Delete(0x02, "ControlCommand_Push_Broadcast_Delete"),
-    ControlCommand_Broadcast_Delete     (0x03, "ControlCommand_Broadcast_Delete"),
-    ControlCommand_Wireless_Stop        (0x04, "ControlCommand_Wireless_Stop"),
-    ControlCommand_Wireless_Start       (0x05, "ControlCommand_Wireless_Start");
-
-    private final int value;
-    private final String string;
-
-    private static final Map<Integer, eControlCommand> map;
-    static {
-        map = new HashMap<>();
-        for (eControlCommand e : values()) {
-            map.put(Integer.valueOf(e.value), e);
-        }
-    }
-    public static eControlCommand getByValue(int value) {
-        return map.get(Integer.valueOf(value));
-    }
-    public static eControlCommand getByValue(byte value) {
-        int intValue = (int)(value & 0x0F);
-        return map.get(Integer.valueOf(intValue));
-    }
-
-    eControlCommand(int value, String string) {
-        this.value  = value;
-        this.string = string;
-    }
-
-    public int getValue() {
-        return this.value;
-    }
-    public String toString() {
-        return this.string;
-    }
-}

+ 0 - 44
src/main/java/com/beanit/enums/eControlDevice.java

@@ -1,44 +0,0 @@
-package com.beanit.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum eControlDevice {
-
-    Control_Command       (0x01, "Control_Command"),
-    Control_BasicInfo     (0x02, "Control_BasicInfo"),
-    Control_StatusRequest (0x03, "Control_StatusRequest"),
-    Control_InfoRequest   (0x04, "Control_InfoRequest"),
-    Control_EnterDirInfo  (0x05, "Control_EnterDirInfo"),
-    Control_DisconnectInfo(0x06, "Control_DisconnectInfo");
-
-    private final int value;
-    private final String string;
-
-    private static final Map<Integer, eControlDevice> map;
-    static {
-        map = new HashMap<>();
-        for (eControlDevice e : values()) {
-            map.put(Integer.valueOf(e.value), e);
-        }
-    }
-    public static eControlDevice getByValue(int value) {
-        return map.get(Integer.valueOf(value));
-    }
-    public static eControlDevice getByValue(byte value) {
-        int intValue = (int)(value & 0x0F);
-        return map.get(Integer.valueOf(intValue));
-    }
-
-    eControlDevice(int value, String string) {
-        this.value  = value;
-        this.string = string;
-    }
-
-    public int getValue() {
-        return this.value;
-    }
-    public String toString() {
-        return this.string;
-    }
-}

+ 0 - 43
src/main/java/com/beanit/enums/eControlDeviceId.java

@@ -1,43 +0,0 @@
-package com.beanit.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum eControlDeviceId {
-
-    ControlDeviceId_Controller (0x00, "ControlDeviceId_Controller"),
-    ControlDeviceId_Antena1    (0x01, "ControlDeviceId_Antenna1"),
-    ControlDeviceId_Antena2    (0x02, "ControlDeviceId_Antenna2"),
-    ControlDeviceId_Antena3    (0x03, "ControlDeviceId_Antenna3"),
-    ControlDeviceId_Antena4    (0x04, "ControlDeviceId_Antenna4");
-
-    private final int value;
-    private final String string;
-
-    private static final Map<Integer, eControlDeviceId> map;
-    static {
-        map = new HashMap<>();
-        for (eControlDeviceId e : values()) {
-            map.put(Integer.valueOf(e.value), e);
-        }
-    }
-    public static eControlDeviceId getByValue(int value) {
-        return map.get(Integer.valueOf(value));
-    }
-    public static eControlDeviceId getByValue(byte value) {
-        int intValue = (int)(value & 0x0F);
-        return map.get(Integer.valueOf(intValue));
-    }
-
-    eControlDeviceId(int value, String string) {
-        this.value  = value;
-        this.string = string;
-    }
-
-    public int getValue() {
-        return this.value;
-    }
-    public String toString() {
-        return this.string;
-    }
-}

+ 0 - 49
src/main/java/com/beanit/enums/eControlRequest.java

@@ -1,49 +0,0 @@
-package com.beanit.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum eControlRequest {
-
-    Request_BasicInfo           (0x00, "Request_BasicInfo"),            //      -- 기초정보(수집지점정보,방향판단정보,비암호화 단말정보) 요청
-    Request_BasicInfo_Collect   (0x01, "Request_BasicInfo_Collect"),    //      -- 기초정보(수집지점정보) 요청
-    Request_BasicInfo_Direction (0x02, "Request_BasicInfo_Direction"),  //      -- 기초정보(방향판단정보) 요청
-    Request_BasicInfo_NonCrypt  (0x03, "Request_BasicInfo_NonCrypt"),   //      -- 기초정보(비암호화 단말정보) 요청
-    Request_MulticastInfo       (0x04, "Request_MulticastInfo"),        //      -- Broadcast 교통정보 요청
-    Request_ObuRequestInfo      (0x05, "Request_ObuRequestInfo"),       //      -- OBU 1:1 교통정보 요청
-    Request_ObuPushInfo         (0x06, "Request_ObuPushInfo"),          //      -- OBU Push 방송정보 요청
-    Request_TrafficInfo         (0x07, "Request_TrafficInfo"),          //주3), -- 교통수집정보 요청
-    Request_ObuEndConnect       (0x08, "Request_ObuEndConnect"),        //주4), -- 단말 접속종료정보 요청
-    Request_ObuEnterDirect      (0x09, "Request_ObuEnterDirect"),       //주5), -- 단말 진입방향정보 요청
-    Request_BasicInfo_CryptKey  (0x0A, "Request_BasicInfo_CryptKey");   //      -- 기초정보(암호화 key 정보) 요청
-
-    private final int value;
-    private final String string;
-
-    private static final Map<Integer, eControlRequest> map;
-    static {
-        map = new HashMap<>();
-        for (eControlRequest e : values()) {
-            map.put(Integer.valueOf(e.value), e);
-        }
-    }
-    public static eControlRequest getByValue(int value) {
-        return map.get(Integer.valueOf(value));
-    }
-    public static eControlRequest getByValue(byte value) {
-        int intValue = (int)(value & 0x0F);
-        return map.get(Integer.valueOf(intValue));
-    }
-
-    eControlRequest(int value, String string) {
-        this.value  = value;
-        this.string = string;
-    }
-
-    public int getValue() {
-        return this.value;
-    }
-    public String toString() {
-        return this.string;
-    }
-}

+ 8 - 9
src/main/java/com/beanit/enums/eWorkMode.java → src/main/java/com/beanit/enums/eLoginInitiatorCd.java

@@ -3,31 +3,30 @@ package com.beanit.enums;
 import java.util.HashMap;
 import java.util.Map;
 
-public enum eWorkMode {
+public enum eLoginInitiatorCd {
 
-    WorkMode_Stop       (0, "WorkMode_Stop"),           //동작 중지
-    WorkMode_Start      (1, "WorkMode_Start"),          //동작 시작
-    WorkMode_ManageStart(2, "WorkMode_ManageStart");    //유지보수 동작 시작
+    datexLogin_Initiator_cd_serverInitiated (0, "datexLogin_Initiator_cd_serverInitiated"),
+    datexLogin_Initiator_cd_clientInitiated (1, "datexLogin_Initiator_cd_clientInitiated");
 
     private final int value;
     private final String string;
 
-    private static final Map<Integer, eWorkMode> map;
+    private static final Map<Integer, eLoginInitiatorCd> map;
     static {
         map = new HashMap<>();
-        for (eWorkMode e : values()) {
+        for (eLoginInitiatorCd e : values()) {
             map.put(Integer.valueOf(e.value), e);
         }
     }
-    public static eWorkMode getByValue(int value) {
+    public static eLoginInitiatorCd getByValue(int value) {
         return map.get(Integer.valueOf(value));
     }
-    public static eWorkMode getByValue(byte value) {
+    public static eLoginInitiatorCd getByValue(byte value) {
         int intValue = (int)(value & 0x0F);
         return map.get(Integer.valueOf(intValue));
     }
 
-    eWorkMode(int value, String string) {
+    eLoginInitiatorCd(int value, String string) {
         this.value  = value;
         this.string = string;
     }

+ 45 - 0
src/main/java/com/beanit/enums/eLogoutReasonCd.java

@@ -0,0 +1,45 @@
+package com.beanit.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum eLogoutReasonCd {
+
+    other             (0, "other"),
+    serverRequested   (1, "serverRequested"),
+    clientRequested   (2, "clientRequested"),
+    serverShutdown    (3, "serverShutdown"),
+    clientShutdown    (4, "clientShutdown"),
+    serverCommProblems(5, "serverCommProblems"),
+    clientCommProblems(3, "clientCommProblems");
+
+    private final int value;
+    private final String string;
+
+    private static final Map<Integer, eLogoutReasonCd> map;
+    static {
+        map = new HashMap<>();
+        for (eLogoutReasonCd e : values()) {
+            map.put(Integer.valueOf(e.value), e);
+        }
+    }
+    public static eLogoutReasonCd getByValue(int value) {
+        return map.get(Integer.valueOf(value));
+    }
+    public static eLogoutReasonCd getByValue(byte value) {
+        int intValue = (int)(value & 0x0F);
+        return map.get(Integer.valueOf(intValue));
+    }
+
+    eLogoutReasonCd(int value, String string) {
+        this.value  = value;
+        this.string = string;
+    }
+
+    public int getValue() {
+        return this.value;
+    }
+    public String toString() {
+        return this.string;
+    }
+}

+ 4 - 4
src/main/java/com/beanit/utils/ItsAsnUtils.java

@@ -98,10 +98,10 @@ public final class ItsAsnUtils {
     }
     public static HeaderOptions getDefaultOptions() {
         HeaderOptions hdrOpts = ItsAsnUtils.getHeaderOptions(
-                new BerUTF8String("DSRC Center Unit"),
-                new BerUTF8String("DSRC Center Unit"),
-                new BerUTF8String("DSRC Main Control Unit"),
-                new BerUTF8String("DSRC Main Control Unit"));
+                new BerUTF8String("UTIC Center Unit"),
+                new BerUTF8String("UTIC Center Unit"),
+                new BerUTF8String("UTIC Main Control Unit"),
+                new BerUTF8String("UTIC Main Control Unit"));
 
         return hdrOpts;
     }

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

@@ -4,7 +4,6 @@ import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.process.dbms.DbmsDataProcess;
 import com.its.rota.server.xnet.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;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.DisposableBean;
@@ -73,9 +72,6 @@ public class ItsRotaServerApplication implements CommandLineRunner, ApplicationL
         ApplicationRepository applicationRepository = SpringUtils.getBean(ApplicationRepository.class);
         applicationRepository.terminate();
 
-        UnitSystService unitSystService = SpringUtils.getBean(UnitSystService.class);
-        unitSystService.updateUnitSystStts(false);
-
         ItsAsnCommServerService itsAsnCommServerService = SpringUtils.getBean(ItsAsnCommServerService.class);
         itsAsnCommServerService.shutdown();
     }

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

@@ -1,14 +0,0 @@
-package com.its.rota.server.dao.mapper;
-
-import com.its.rota.server.entity.TbProcessState;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-@Mapper
-public interface ProcessMapper {
-
-    int initProcessStts();
-    int updProcessState(@Param("obj") TbProcessState obj);
-    int updProcessStateStart(@Param("obj") TbProcessState obj);
-    int updProcessStateStop(@Param("obj") TbProcessState obj);
-}

+ 2 - 2
src/main/java/com/its/rota/server/dto/CenterDto.java

@@ -114,7 +114,7 @@ public class CenterDto implements Serializable {
                     .toCenterId(this.getCenterId())
                     .dataCnt(this.incident.getIncidents().size())
                     .build();
-            dbmsDataProcess.add(new DbmsData(this, DbmsData.DBMS_DATA_LOG_INCIDENT, log));
+            dbmsDataProcess.add(new DbmsData(this, DbmsData.DBMS_DATA_SND_LOG_INCIDENT, log));
             return lists;
         }
 
@@ -189,7 +189,7 @@ public class CenterDto implements Serializable {
                     .toCenterId(this.getCenterId())
                     .dataCnt(ApplicationRepository.traffics.size())
                     .build();
-            dbmsDataProcess.add(new DbmsData(this, DbmsData.DBMS_DATA_LOG_TRAFFIC, log));
+            dbmsDataProcess.add(new DbmsData(this, DbmsData.DBMS_DATA_SND_LOG_TRAFFIC, log));
             return lists;
         }
 

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

@@ -12,8 +12,9 @@ public class DbmsData {
     public static final String D_KIND_INC = "I";
 
     public static final int DBMS_DATA_PROCESS_STTS = 0;
-    public static final int DBMS_DATA_LOG_INCIDENT = 1;
-    public static final int DBMS_DATA_LOG_TRAFFIC = 2;
+
+    public static final int DBMS_DATA_SND_LOG_INCIDENT = 1;
+    public static final int DBMS_DATA_SND_LOG_TRAFFIC = 2;
 
     public static final int DBMS_DATA_DELETE_SND_LOG = 10;
     public static final int DBMS_DATA_DELETE_SND_INCIDENT = 11;

+ 2 - 17
src/main/java/com/its/rota/server/process/dbms/DbmsDataProcess.java

@@ -4,9 +4,7 @@ import com.its.app.common.utils.Elapsed;
 import com.its.rota.server.common.SpringUtils;
 import com.its.rota.server.config.ThreadPoolInitializer;
 import com.its.rota.server.dao.mapper.IncidentMapper;
-import com.its.rota.server.dao.mapper.ProcessMapper;
 import com.its.rota.server.dao.mapper.SndLogMapper;
-import com.its.rota.server.entity.TbProcessState;
 import com.its.rota.server.entity.TbSndLog;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -26,7 +24,6 @@ public class DbmsDataProcess {
     private final ThreadPoolExecutor taskExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(1);
 
     private final DbmsDataAsyncTask asyncTask;
-    private final ProcessMapper processMapper;
     private final IncidentMapper incidentMapper;
     private final SndLogMapper sndLogMapper;
 
@@ -75,19 +72,7 @@ public class DbmsDataProcess {
             MDC.put("id", data.getCenter().getLogKey());
             Elapsed elapsed1 = new Elapsed();
             switch(type) {
-                case DbmsData.DBMS_DATA_PROCESS_STTS:
-                    TbProcessState stts = (TbProcessState) data.getData();
-                    if (TbProcessState.PROCESS_START.equals(stts.getRunState())) {
-                        result = this.processMapper.updProcessStateStart(stts);
-                    }
-                    else if (TbProcessState.PROCESS_STOP.equals(stts.getRunState())) {
-                        result = this.processMapper.updProcessStateStop(stts);
-                    }
-                    else {
-                        result = this.processMapper.updProcessState(stts);
-                    }
-                    break;
-                case DbmsData.DBMS_DATA_LOG_INCIDENT:
+                case DbmsData.DBMS_DATA_SND_LOG_INCIDENT:
                     TbSndLog incLog = (TbSndLog) data.getData();
                     result = this.sndLogMapper.insSndLog(incLog);
                     if (DbmsData.D_KIND_INC.equals(incLog.getInfoKind())) {
@@ -96,7 +81,7 @@ public class DbmsDataProcess {
                         result += this.sndLogMapper.insCenterSend(incLog);
                     }
                     break;
-                case DbmsData.DBMS_DATA_LOG_TRAFFIC:
+                case DbmsData.DBMS_DATA_SND_LOG_TRAFFIC:
                     TbSndLog trfLog = (TbSndLog) data.getData();
                     result = this.sndLogMapper.insSndLog(trfLog);
                     if (DbmsData.D_KIND_TRAF.equals(trfLog.getInfoKind())) {

+ 11 - 33
src/main/java/com/its/rota/server/scheduler/ApplicationScheduler.java

@@ -1,6 +1,5 @@
 package com.its.rota.server.scheduler;
 
-import com.its.app.common.utils.Elapsed;
 import com.its.rota.server.config.SchedulingConfig;
 import com.its.rota.server.process.dbms.DbmsData;
 import com.its.rota.server.process.dbms.DbmsDataProcess;
@@ -33,19 +32,10 @@ public class ApplicationScheduler {
     }
     // 초(0-59) 분(0-59) 시간(0-23) 일(1-31) 월(1-12) 요일(0-6) (0: 일, 1: 월, 2:화, 3:수, 4:목, 5:금, 6:토)
 
-    @Async
-    @Scheduled(cron = "0 * * * * *")  // 1분 주기 작업 실행
-    public void unitSystSchedule() {
-//        Elapsed elapsed = new Elapsed();
-//        log.info("ApplicationScheduler.unitSystSchedule: start.");
-//        try {
-//            this.unitSystService.updateUnitSystStts(true);
-//            log.info("ApplicationScheduler.unitSystSchedule: {}", Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-//        }
-//        catch(Exception e) {
-//            log.error("ApplicationScheduler.unitSystSchedule: Exception {}", e.getMessage());
-//        }
-    }
+//    @Async
+//    @Scheduled(cron = "0 * * * * *")  // 1분 주기 작업 실행
+//    public void unitSystSchedule() {
+//    }
 
     @Async
     @Scheduled(cron = "${application.scheduler.delete-snd-incident:0/40 3 * * * *}")
@@ -53,12 +43,9 @@ public class ApplicationScheduler {
         if (!this.config.isUseSndIncident()) {
             return;
         }
-        Elapsed elapsed = new Elapsed();
-        log.info("ApplicationScheduler.deleteSndIncident: start.");
         try {
             this.delSndIncident.setCenter(ApplicationRepository.center);
             this.dbmsDataProcess.add(this.delSndIncident);
-            log.info("ApplicationScheduler.deleteSndIncident: {}", Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
         }
         catch(Exception e) {
             log.error("ApplicationScheduler.deleteSndIncident: Exception {}", e.getMessage());
@@ -71,12 +58,9 @@ public class ApplicationScheduler {
         if (!this.config.isUseSndLog()) {
             return;
         }
-        Elapsed elapsed = new Elapsed();
-        log.info("ApplicationScheduler.deleteSndLog: start.");
         try {
             this.delSndLog.setCenter(ApplicationRepository.center);
             this.dbmsDataProcess.add(this.delSndLog);
-            log.info("ApplicationScheduler.deleteSndLog: {}", Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
         }
         catch(Exception e) {
             log.error("ApplicationScheduler.deleteSndLog: Exception {}", e.getMessage());
@@ -86,25 +70,19 @@ public class ApplicationScheduler {
     @Async
     @Scheduled(cron = "0 * * * * *")  // 1분 주기 작업 실행
     public void checkSendIncident() {
-//        Elapsed elapsed = new Elapsed();
-//        log.info("ApplicationScheduler.checkSendIncident: start.");
-//        try {
-//            this.itsRotaServerService.checkSendIncident();
-//            log.info("ApplicationScheduler.checkSendIncident: {}", Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
-//        }
-//        catch(Exception e) {
-//            log.error("ApplicationScheduler.checkSendIncident: Exception {}", e.getMessage());
-//        }
+        try {
+            this.itsRotaServerService.checkSendIncident();
+        }
+        catch(Exception e) {
+            log.error("ApplicationScheduler.checkSendIncident: Exception {}", e.getMessage());
+        }
     }
 
     @Async
     @Scheduled(cron = "0/10 * * * * *")  // 10초 주기 작업 실행
     public void checkSendTraffic() {
-//        Elapsed elapsed = new Elapsed();
-//        log.info("ApplicationScheduler.checkSendTraffic: start.");
         try {
-            int result = this.itsRotaServerService.checkSendTraffic();
-//            log.info("ApplicationScheduler.checkSendTraffic: result: {}, {}", result, Elapsed.elapsedTimeStr(elapsed.nanoSeconds()));
+            this.itsRotaServerService.checkSendTraffic();
         }
         catch(Exception e) {
             log.error("ApplicationScheduler.checkSendTraffic: Exception {}", e.getMessage());

+ 0 - 68
src/main/java/com/its/rota/server/service/UnitSystService.java

@@ -1,68 +0,0 @@
-package com.its.rota.server.service;
-
-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.DbmsDataProcess;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.slf4j.MDC;
-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 UnitSystService {
-
-    private final DbmsDataProcess dbmsDataProcess;
-    private final ProcessMapper mapper;
-    private final TbProcessState unitSystStts = TbProcessState.builder().build();
-
-    private String processId;
-
-    @PostConstruct
-    private void init() {
-        log.info("UnitSystService.init: start.");
-        ApplicationConfig applicationConfig = SpringUtils.getBean(ApplicationConfig.class);
-        this.processId = applicationConfig.getProcessId();
-
-        log.info("UnitSystService.init. processId: {}.", this.processId);
-        log.info("UnitSystService.init: ..end.");
-    }
-
-    @PreDestroy
-    public void destroyService() {
-        log.error("UnitSystService.destroy. system terminated.......");
-        updateUnitSystStts(false);
-    }
-
-    public void updateUnitSystStts(boolean isRun) {
-        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.updProcessStateStop(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();
-    }
-}

+ 0 - 41
src/main/java/com/its/rota/server/xnet/server/process/response/InitiateResponse.java

@@ -1,41 +0,0 @@
-package com.its.rota.server.xnet.server.process.response;
-
-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.dto.CenterDto;
-import io.netty.channel.ChannelHandlerContext;
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-public class InitiateResponse implements ItsAsnResponse {
-    private CenterDto obj;
-    private ChannelHandlerContext ctx;
-    private C2CAuthenticatedMessage c2c;
-
-    public InitiateResponse(CenterDto obj, ChannelHandlerContext ctx, C2CAuthenticatedMessage c2c) {
-        this.obj = obj;
-        this.ctx = ctx;
-        this.c2c = c2c;
-    }
-
-    @Override
-    public boolean response() {
-        // 처리내용 없음
-        String ipAddress = NettyUtils.getRemoteIpAddress(this.ctx.channel());
-        log.info("InitiateResponse.response: {}", ipAddress);
-
-        PDUs pdus = this.c2c.getPdu();
-        Initiate initiate = pdus.getDatexInitiateNull();
-        if (initiate != null) {
-            /**
-             * Login 요청에 대한 응답을 처리함
-             */
-//            return LoginDeviceService.getInstance().requestLogin(obj, this.ctx.channel(), config);
-        }
-
-        return true;
-    }
-
-}

+ 0 - 28
src/main/java/com/its/rota/server/xnet/server/process/response/NullResponse.java

@@ -1,28 +0,0 @@
-package com.its.rota.server.xnet.server.process.response;
-
-import com.beanit.its.C2CAuthenticatedMessage;
-import com.its.app.common.utils.NettyUtils;
-import com.its.rota.server.dto.CenterDto;
-import io.netty.channel.ChannelHandlerContext;
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
-public class NullResponse implements ItsAsnResponse {
-    private CenterDto obj;
-    private ChannelHandlerContext ctx;
-    private C2CAuthenticatedMessage c2c;
-
-    public NullResponse(CenterDto obj, ChannelHandlerContext ctx, C2CAuthenticatedMessage c2c) {
-        this.obj = obj;
-        this.ctx = ctx;
-        this.c2c = c2c;
-    }
-
-    @Override
-    public boolean response() {
-        // 처리내용 없음. 여기들어오면 패킷이 잘못된 것임
-        String ipAddress = NettyUtils.getRemoteIpAddress(this.ctx.channel());
-        log.info("NullResponse.response: {}", ipAddress);
-        return true;
-    }
-}

+ 0 - 111
src/main/java/com/its/rota/server/xnet/server/process/response/PublicationResponse.java

@@ -1,111 +0,0 @@
-package com.its.rota.server.xnet.server.process.response;
-
-import com.beanit.its.*;
-import com.its.app.common.utils.NettyUtils;
-import com.its.rota.server.dto.CenterDto;
-import io.netty.channel.ChannelHandlerContext;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.IOException;
-import java.util.List;
-
-@Slf4j
-public class PublicationResponse implements ItsAsnResponse {
-    private CenterDto obj;
-    private ChannelHandlerContext ctx;
-    private C2CAuthenticatedMessage c2c;
-
-    public PublicationResponse(CenterDto obj, ChannelHandlerContext ctx, C2CAuthenticatedMessage c2c) {
-        this.obj = obj;
-        this.ctx = ctx;
-        this.c2c = c2c;
-    }
-
-    @Override
-    public boolean response() {
-        String ipAddress = NettyUtils.getRemoteIpAddress(ctx.channel());
-        log.debug("PublicationResponse.response: {}", ipAddress);
-
-        PDUs pdus = this.c2c.getPdu();
-        Publication publication = pdus.getPublication();
-        if (publication == null) {
-           log.error("PublicationResponse.response: {}, Publication data null", ipAddress);
-           return false;
-        }
-
-        boolean guaranteed = publication.getDatexPublishGuaranteedBool().value;
-        PublishFormat publishFormat = publication.getDatexPublishFormat();
-        if (publishFormat.getDatexPublishData() != null) {
-            List<PublicationData> list = publishFormat.getDatexPublishData().getPublicationData();
-            //log.info("PublicationResponse.response: {}. Publication PublishData. size: {} EA", ipAddress, list.size());
-            for (PublicationData data : list) {
-                if (data.getDatexPublishType().getDatexPublishData() != null) {
-                    try {
-                        responsePublicationData(data.getDatexPublishType().getDatexPublishData());
-                    } catch (IOException e) {
-                        log.error("PublicationResponse.response: Exception: {}", e.toString());
-                    }
-                }
-            }
-        }
-        else if (publishFormat.getDatexPublishFileNameTxt() != null) {
-            log.warn("PublicationResponse.response: {}. Publication PublishFileName.", ipAddress);
-        }
-
-        if (guaranteed) {
-            //log.info("PublicationResponse.response: {}. guaranteed: true", ipAddress);
-//            C2CAuthenticatedMessage resC2c = DsrcAsn1Accept.makeC2CAuthenticatedMessage(this.obj, this.ctx.channel(), this.c2c);
-//            if (resC2c != null) {
-//                ChannelFuture f = this.ctx.channel().writeAndFlush(resC2c);
-//                f.awaitUninterruptibly();
-//                if (!f.isDone() || !f.isSuccess()) {
-//                    log.info("PublicationResponse.response: {}. guaranteed: response send failed.", ipAddress);
-//                }
-//            }
-        }
-        return true;
-    }
-
-    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);
-//        }
-    }
-}

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

@@ -1,29 +0,0 @@
-package com.its.rota.server.xnet.server.process.response;
-
-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 TransferDoneResponse implements ItsAsnResponse {
-    private CenterDto obj;
-    private ChannelHandlerContext ctx;
-    private C2CAuthenticatedMessage c2c;
-
-    public TransferDoneResponse(CenterDto obj, ChannelHandlerContext ctx, C2CAuthenticatedMessage c2c) {
-        this.obj = obj;
-        this.ctx = ctx;
-        this.c2c = c2c;
-    }
-
-    @Override
-    public boolean response() {
-        // 처리내용 없음.
-        String ipAddress = NettyUtils.getRemoteIpAddress(this.ctx.channel());
-        log.info("TransferDoneResponse.response: {}", ipAddress);
-        return true;
-    }
-}

+ 0 - 49
src/main/resources/mybatis/mapper/ProcessMapper.xml

@@ -1,49 +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.ProcessMapper">
-
-    <update id="initProcessStts">
-    <![CDATA[
-        MERGE INTO TB_PROCESS_STATE L
-            USING(SELECT A.PROCESSID
-                  FROM TB_PROCESS A
-                  WHERE A.USE_YN = 'Y') M
-            ON (L.PROCESSID = M.PROCESSID)
-            WHEN NOT MATCHED THEN
-                INSERT (PROCESSID, REGDATE, RUNSTATE, ERRTIMEGAP)
-                VALUES (M.PROCESSID, SYSDATE, '1', 120)
-
-        ]]>
-    </update>
-
-    <update id="updProcessState" parameterType="com.its.rota.server.entity.TbProcessState">
-    <![CDATA[
-        UPDATE TB_PROCESS_STATE
-        SET RUNSTATE  = '1',
-            REGDATE   =  SYSDATE
-        WHERE PROCESSID IN (81010, 81020, 81030, 81040, 81050)
-        ]]>
-    </update>
-
-    <update id="updProcessStateStart" parameterType="com.its.rota.server.entity.TbProcessState">
-    <![CDATA[
-        UPDATE TB_PROCESS_STATE
-        SET RUNSTATE  = '0',
-            STRDATE   =  SYSDATE,
-            REGDATE   =  SYSDATE
-        WHERE PROCESSID IN (81010, 81020, 81030, 81040, 81050)
-        ]]>
-    </update>
-
-    <update id="updProcessStateStop" parameterType="com.its.rota.server.entity.TbProcessState">
-    <![CDATA[
-        UPDATE TB_PROCESS_STATE
-        SET RUNSTATE  = #{obj.runState},
-            ENDDATE   =  SYSDATE,
-            REGDATE   =  SYSDATE
-        WHERE PROCESSID IN (81010, 81020, 81030, 81040, 81050)
-        ]]>
-    </update>
-
-</mapper>