1. 添加doris数据源
2. 添加StateMapper,准备进行oracle数据库对接
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.realtime.protection.configuration.utils.status.state;
|
||||
|
||||
public interface State {
|
||||
|
||||
Boolean handle(State newState);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user