Skip to content

Commit add3555

Browse files
committed
Refactoring: Remove 'readCommand' field in 'AlertLogCommand' Model
1 parent d986841 commit add3555

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/main/java/root/core/domain/AlertLogCommand.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,32 @@
66
@NoArgsConstructor
77
@Data
88
public class AlertLogCommand {
9-
private String readCommand;
109
private String readLine;
1110
private String readFilePath;
1211
private String dateFormat;
1312
private String dateFormatRegex;
1413
private String[] catchErrorMsg;
1514

16-
public AlertLogCommand(String readCommand, String readLine, String readFilePath) {
17-
this.readCommand = readCommand;
15+
public AlertLogCommand(String readLine, String readFilePath) {
1816
this.readLine = readLine;
1917
this.readFilePath = readFilePath;
2018
}
2119

22-
public AlertLogCommand(String readCommand, String readLine, String readFilePath, String dateFormat, String dateFormatRegex) {
23-
this.readCommand = readCommand;
20+
public AlertLogCommand(String readLine, String readFilePath, String dateFormat, String dateFormatRegex) {
2421
this.readLine = readLine;
2522
this.readFilePath = readFilePath;
2623
this.dateFormat = dateFormat;
2724
this.dateFormatRegex = dateFormatRegex;
2825
}
2926

30-
public AlertLogCommand(String readCommand, String readLine, String readFilePath, String... catchErrorMsg) {
31-
this.readCommand = readCommand;
27+
public AlertLogCommand(String readLine, String readFilePath, String... catchErrorMsg) {
3228
this.readLine = readLine;
3329
this.readFilePath = readFilePath;
3430
this.catchErrorMsg = catchErrorMsg;
3531
}
3632

33+
// TODO OSº° command ÀÛ¼º
3734
public String getCommand() {
38-
return this.getReadCommand() + " -" + this.getReadLine() + " " + this.getReadFilePath();
35+
return "tail -" + this.getReadLine() + " " + this.getReadFilePath();
3936
}
4037
}

src/main/java/root/core/repository/implement/PropertyRepositoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ public AlertLogCommand getAlertLogCommand(String serverName) {
549549
String alertLogReadLine = connInfoConfig.getString(serverName + ".server.alertlog.readline");
550550
String alertLogDateFormat = connInfoConfig.getString(serverName + ".server.alertlog.dateformat");
551551
String alertLogDateFormatRegex = connInfoConfig.getString(serverName + ".server.alertlog.dateformatregex");
552-
AlertLogCommand alc = new AlertLogCommand("tail", alertLogReadLine, alertLogFilePath, alertLogDateFormat,
552+
AlertLogCommand alc = new AlertLogCommand(alertLogReadLine, alertLogFilePath, alertLogDateFormat,
553553
alertLogDateFormatRegex);
554554
return alc;
555555
}

0 commit comments

Comments
 (0)