1. 添加doris数据源

2. 添加StateMapper,准备进行oracle数据库对接
This commit is contained in:
EnderByEndera
2024-01-09 09:20:13 +08:00
parent 2b04a7d6ce
commit a04b83e4c3
15 changed files with 134 additions and 39 deletions

View File

@@ -0,0 +1,25 @@
package com.realtime.protection.configuration.entity.task;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class Command {
private Integer id;
private Integer type;
private String sourceIP;
private String sourcePort;
private String destinationIP;
private String destinationPort;
private Integer protocol;
private String maskSourceIP;
private String maskSourcePort;
private String maskDestinationIP;
private String maskDestinationPort;
private Integer direction;
private LocalDateTime datetime;
}

View File

@@ -1,20 +0,0 @@
package com.realtime.protection.configuration.utils.status;
import com.realtime.protection.configuration.utils.status.state.State;
public class StatusChanger {
private final State state;
public StatusChanger(State state) {
this.state = state;
}
public static StatusChanger setOriginal(State original) {
return new StatusChanger(original);
}
public Boolean changeState(State newState) {
return this.state.handle(newState);
}
}

View File

@@ -1,16 +0,0 @@
package com.realtime.protection.configuration.utils.status.state;
public class PauseState implements State {
@Override
public Boolean handle(State newState) {
if (!(newState instanceof RunningState)) {
return false;
}
return handleRun();
}
private Boolean handleRun() {
return true;
}
}

View File

@@ -1,28 +0,0 @@
package com.realtime.protection.configuration.utils.status.state;
public class RunningState implements State {
@Override
public Boolean handle(State newState) {
if (newState instanceof RunningState) {
return false;
}
if (newState instanceof PauseState) {
return handlePause();
}
if (newState instanceof StopState) {
return handleStop();
}
return false;
}
private Boolean handlePause() {
return true;
}
private Boolean handleStop() {
return true;
}
}

View File

@@ -1,6 +0,0 @@
package com.realtime.protection.configuration.utils.status.state;
public interface State {
Boolean handle(State newState);
}

View File

@@ -1,17 +0,0 @@
package com.realtime.protection.configuration.utils.status.state;
public class StopState implements State {
@Override
public Boolean handle(State newState) {
if (!(newState instanceof RunningState)) {
return false;
}
return handleRun();
}
public Boolean handleRun() {
return true;
}
}