88import java .util .List ;
99import java .util .stream .Collectors ;
1010
11+ import dnl .utils .text .table .TextTable ;
12+ import dnl .utils .text .table .csv .CsvTableModel ;
1113import root .common .database .contracts .AbstractDatabase ;
1214import root .common .database .implement .JdbcDatabase ;
1315import root .common .server .implement .JschServer ;
2931import root .core .usecase .constracts .ServerCheckUsecase ;
3032import root .core .usecase .implement .DBCheckUsecaseImpl ;
3133import root .core .usecase .implement .ServerCheckUsecaseImpl ;
34+ import root .utils .CsvUtils ;
3235import root .utils .DateUtils ;
3336import root .utils .PatternUtils ;
3437
@@ -123,9 +126,25 @@ public static void main(String[] args) throws IOException {
123126 }
124127 System .out .println (String .format ("์ ํ๋ ํ์ผ์ [%s] ์
๋๋ค." , selectedPreset ));
125128
126- // STEP4: ์ค์ ํ์ผ์ ์ ์์ ๋ณด๋ฅผ ์ฝ์ด DB,Server ๊ฐ์ฒด ์์ฑ
129+ // STEP4: ์ค์ ํ์ผ์ ์ ์์ ๋ณด๋ฅผ ์ฝ์ด DB,Server ๊ฐ์ฒด ์์ฑ ๋ฐ ์ถ๋ ฅ
127130 List <String > dbNames = propService .getMonitoringDBNameList ();
128131 List <JdbcConnectionInfo > jdbcConnectionList = propService .getJdbcConnInfoList (dbNames );
132+ System .out .println ("์ ์ฅ๋ DB์ ์์ ๋ณด๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค." );
133+ TextTable dbTable = new TextTable (
134+ new CsvTableModel (CsvUtils .toCsvString (jdbcConnectionList , JdbcConnectionInfo .class )));
135+ dbTable .printTable (System .out , 2 );
136+
137+ List <String > serverNames = propService .getMonitoringServerNameList ();
138+ List <JschConnectionInfo > jschConnectionList = propService .getJschConnInfoList (serverNames );
139+ System .out .println ("์ ์ฅ๋ Server์ ์์ ๋ณด๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค." );
140+ TextTable serverTable = new TextTable (
141+ new CsvTableModel (CsvUtils .toCsvString (jschConnectionList , JschConnectionInfo .class )));
142+ serverTable .printTable (System .out , 2 );
143+
144+ // TODO STEP5: ๋ชจ๋ํฐ๋ง์ฌ๋ถ ์ค์ ์ฝ๊ธฐ
145+
146+ // STEP6: ๋ชจ๋ํฐ๋ง ์ํ
147+ System .out .println ("DB ๋ชจ๋ํฐ๋ง์ ์ํํฉ๋๋ค." );
129148 for (JdbcConnectionInfo jdbc : jdbcConnectionList ) {
130149 System .out .println ("โ [ " + jdbc .getJdbcDBName () + " Monitoring Start ]\n " );
131150 AbstractDatabase db = new JdbcDatabase (jdbc );
@@ -139,8 +158,7 @@ public static void main(String[] args) throws IOException {
139158 System .out .println ("โ [ " + jdbc .getJdbcDBName () + " Monitoring End ]\n \n " );
140159 }
141160
142- List <String > serverNames = propService .getMonitoringServerNameList ();
143- List <JschConnectionInfo > jschConnectionList = propService .getJschConnInfoList (serverNames );
161+ System .out .println ("Server ๋ชจ๋ํฐ๋ง์ ์ํํฉ๋๋ค." );
144162 for (JschConnectionInfo jsch : jschConnectionList ) {
145163 System .out .println ("โ [ " + jsch .getServerName () + " Monitoring Start ]\n " );
146164 JschServer server = new JschServer (jsch );
0 commit comments