Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft 220511 multi module project #244

Merged
merged 8 commits into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
/.gradle/

/build/

.vscode/
17 changes: 0 additions & 17 deletions .project

This file was deleted.

2 changes: 2 additions & 0 deletions Common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/bin/
20 changes: 20 additions & 0 deletions Common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
}

dependencies {

// Apache commons pool2
implementation 'commons-io:commons-io:2.8.0'
implementation 'org.apache.commons:commons-pool2:2.11.1'

// Jsch
implementation 'com.jcraft:jsch:0.1.55'

// Logback
implementation 'ch.qos.logback:logback-classic:1.2.3'
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package root.core.domain;
package root.common.database.implement;

import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down Expand Up @@ -31,7 +31,7 @@ public JdbcConnectionInfo(String jdbcDriver, String jdbcUrl, String jdbcId, Stri
this.jdbcValidation = jdbcValidation;
this.jdbcConnections = jdbcConnections;

// TODO 선택된 Oracle Driver Type에 따라서, Driver 값 변경하기, 현재는 임시로 모두 동일한 값 입력
// TODO ���õ� Oracle Driver Type�� ����, Driver �� �����ϱ�, ����� �ӽ÷� ��� ������ �� �Է�
this.jdbcOracleDriver = "oracle.jdbc.driver.OracleDriver";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@

import lombok.Data;
import root.common.database.contracts.AbstractDatabase;
import root.core.domain.JdbcConnectionInfo;

// TODO Builder Pattern 적용하기
// TODO Builder Pattern �����ϱ�
/**
* Jdbc Driver를 이용해 DBMS와 연결을 수행하는 Class
* Jdbc Driver�� �̿��� DBMS�� ������ �����ϴ� Class
*
* @author DKY
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import lombok.extern.slf4j.Slf4j;
import root.common.database.contracts.AbstractDatabaseConnectionPool;
import root.core.domain.JdbcConnectionInfo;

@Slf4j
public class JdbcDatabaseConnectionPool implements AbstractDatabaseConnectionPool {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package root.core.domain;
package root.common.server.implement;

import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package root.core.domain;
package root.common.server.implement;

import lombok.Data;
import root.core.domain.enums.ServerOS;

@Data
public class JschConnectionInfo {
Expand Down Expand Up @@ -59,7 +58,7 @@ public void setPort(String portString) {
try {
this.port = Integer.parseInt(portString);
} catch (NumberFormatException e) {
this.port = 22; // ±âº»°ª
this.port = 22; // �⺻��
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.jcraft.jsch.Session;

import lombok.extern.slf4j.Slf4j;
import root.core.domain.JschConnectionInfo;

@Slf4j
public class JschServer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package root.core.domain.enums;
package root.common.server.implement;

public enum ServerOS {
WINDOW, LINUX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;

import root.core.domain.JschConnectionInfo;

public class ServerSessionConnectionPoolFactory extends BaseKeyedPooledObjectFactory<JschConnectionInfo, Session> {

@Override
Expand All @@ -20,7 +18,7 @@ public Session create(JschConnectionInfo connInfo) throws Exception {
session.setPassword(connInfo.getPassword());

Properties config = new Properties();
config.put("StrictHostKeyChecking", "no"); // ȣ��Ʈ ������ �˻����� �ʴ´�.
config.put("StrictHostKeyChecking", "no"); // ȣ��Ʈ ������ �˻����� �ʴ´�.
config.put("PreferredAuthentications", "password");
session.setConfig(config);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;

import root.core.domain.JschConnectionInfo;
import root.core.domain.enums.ServerOS;

public class JschServerTest {

public static JschServer jsch;
Expand Down
2 changes: 2 additions & 0 deletions Core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/bin/
30 changes: 30 additions & 0 deletions Core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
}

dependencies {

// Another module
implementation project(':Utils')
implementation project(':Common')

// j-text-utils
implementation 'com.massisframework:j-text-utils:0.3.4'

// Apache Commons Library
implementation 'commons-io:commons-io:2.8.0'
implementation 'org.apache.commons:commons-configuration2:2.7'

// Apache POI
implementation 'org.apache.poi:poi:3.17'
implementation 'org.apache.poi:poi-ooxml-schemas:3.17'
implementation 'org.apache.poi:poi-scratchpad:3.17'
implementation 'org.apache.poi:poi-ooxml:3.17'

// Logback
implementation 'ch.qos.logback:logback-classic:1.2.3'
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package root.core.batch;

import root.core.domain.AlertLogCommand;
import root.common.server.implement.AlertLogCommand;
import root.core.usecase.constracts.ServerMonitoringUsecase;

public class ServerCheckBatch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@Getter
public enum UsageUIType implements EnumType {

NUMERIC("1", "수치 값"), GRAPHIC_BAR("2", "막대형 그래픽"), GRAPHIC_PIE("3", "원형 그래픽");
NUMERIC("1", "수치 값"), GRAPHIC_BAR("2", "막대형 그래픽"), GRAPHIC_PIE("3", "원형 그래픽");

private String code;
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import org.apache.commons.configuration2.PropertiesConfiguration;

import root.core.domain.AlertLogCommand;
import root.core.domain.JdbcConnectionInfo;
import root.core.domain.JschConnectionInfo;
import root.common.database.implement.JdbcConnectionInfo;
import root.common.server.implement.AlertLogCommand;
import root.common.server.implement.JschConnectionInfo;

public interface PropertyRepository {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import root.core.domain.AlertLogCommand;
import root.common.server.implement.AlertLogCommand;
import root.core.domain.OSDiskUsage;

public interface ServerMonitoringRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.util.List;
import java.util.Map;

import root.core.domain.AlertLogCommand;
import root.core.domain.JdbcConnectionInfo;
import root.core.domain.JschConnectionInfo;
import root.common.database.implement.JdbcConnectionInfo;
import root.common.server.implement.AlertLogCommand;
import root.common.server.implement.JschConnectionInfo;
import root.core.domain.MonitoringYN;
import root.core.domain.enums.MonitoringType;
import root.core.domain.enums.RoundingDigits;
Expand All @@ -15,50 +15,50 @@
public interface PropertyService {

/**
* �������� ���������� Load �Ѵ�.
* 접속정보 설정파일을 Load 한다.
*
* @param filePath
*/
void loadConnectionInfoConfig(String filePath);

/**
* ����͸� �������� ���������� ��θ� ��ȯ�Ѵ�.
* 모니터링 접속정보 설정파일의 경로를 반환한다.
*
* @return
*/
List<String> getConnectionInfoList();

/**
* �ֱ� ���� �������� ���������� ��θ� ��ȯ�Ѵ�.
* 최근 사용된 접속정보 설정파일의 경로를 반환한다.
*
* @return
*/
String getLastUseConnectionInfoFilePath();

/**
* ����͸� ���� ���������� Load �Ѵ�.
* 모니터링 여부 설정파일을 Load 한다.
*
* @param filePath
*/
void loadMonitoringInfoConfig(String filePath);

/**
* �ֱ� ���� ����͸� ���� Preset ���������� Preset���� ��ȯ�Ѵ�.
* 최근 사용된 모니터링 여부 Preset 설정파일의 Preset명을 반환한다.
*
* @return
*/
String getLastUsePresetFileName(String filePath);

/**
* ����͸����� Preset ���������� �о� DB ����͸� ���� ����Ʈ�� ��ȯ�Ѵ�.
* 모니터링여부 Preset 설정파일을 읽어 DB 모니터링 여부 리스트를 반환한다.
*
* @param presetConfigFileName
* @return
*/
List<MonitoringYN> getDBMonitoringYnList(String presetConfigFileName);

/**
* ����͸����� Preset ���������� �о� Server ����͸� ���� ����Ʈ�� ��ȯ�Ѵ�.
* 모니터링여부 Preset 설정파일을 읽어 Server 모니터링 여부 리스트를 반환한다.
*
* @param presetConfigFileName
* @return
Expand All @@ -80,75 +80,75 @@ public interface PropertyService {
List<JdbcConnectionInfo> getJdbcConnInfoList(List<String> dbNames);

/**
* ������ ���������� �����´�.
* 서버의 접속정보를 가져온다.
*
* @param serverName ���� �������� ��Ī
* @param serverName 서버 접속정보 별칭
* @return
*/
JschConnectionInfo getJschConnInfo(String serverName);

/**
* �������� ���������� �����´�.
* 서버들의 접속정보를 가져온다.
*
* @param serverNames
* @return
*/
List<JschConnectionInfo> getJschConnInfoList(List<String> serverNames);

/**
* �⺻������ ������ FileSize ������ ��ȯ�Ѵ�.
* 기본값으로 설정된 FileSize 단위를 반환한다.
*
* @return
*/
FileSize getDefaultFileSizeUnit();

/**
* �⺻������ ������ �ݿø� �ڸ����� ��ȯ�Ѵ�.
* 기본값으로 설정된 반올림 자릿수를 반환한다.
*
* @return
*/
RoundingDigits getDefaultRoundingDigits();

/**
* �⺻������ ������ ��뷮 �÷� UI Ÿ���� ��ȯ�Ѵ�.
* 기본값으로 설정된 사용량 컬럼 UI 타입을 반환한다.
*
* @return
*/
UsageUIType getDefaultUsageUIType();

/**
* ���� ���������� �����Ѵ�.
* 공통 설정정보를 저장한다.
*
* @param key �������� Ű
* @param value �������� ��
* @param key 설정정보 키
* @param value 설정정보 값
*/
void saveCommonConfig(String key, String value);

/**
* �ֱ� ����� �������� ���������� �����Ѵ�.
* 최근 사용한 접속정보 설정정보를 저장한다.
*
* @param filePath
*/
void saveLastUseConnectionInfoSetting(String filePath);

/**
* �������� ������ �߰��Ѵ�.
* 접속정보 설정을 추가한다.
*
* @param filePath
* @return
*/
String addConnectionInfoSetting(String filePath);

/**
* ����͸����� Preset ������ �߰��Ѵ�.
* 모니터링여부 Preset 설정을 추가한다.
*
* @param connInfoSetting
* @param presetName
*/
void addMonitoringPreset(String connInfoSetting, String presetName);

/**
* ����͸����� Preset ������ �����Ѵ�.
* 모니터링여부 Preset 설정을 저장한다.
*
* @param presetName
* @param settingedMonitoringYN
Expand All @@ -157,7 +157,7 @@ void saveMonitoringPresetSetting(String presetName,
Map<MonitoringType, Map<String, Boolean>> settingedMonitoringYN);

/**
* ������ AlertLog ����͸� Ŀ�ǵ� ������ �����´�.
* 설정된 AlertLog 모니터링 커맨드 정보를 가져온다.
*
* @param connInfoSetting
* @param serverName
Expand Down
Loading