diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..95976ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# Created by .ignore support plugin (hsz.mobi) +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +.gitignore +.idea/ +crawler.sql.iml +sql.iml +target/ diff --git a/pom.xml b/pom.xml index 18d4871..9ae4a3a 100644 --- a/pom.xml +++ b/pom.xml @@ -11,10 +11,10 @@ com.loafle.overflow - sql + crawler.sql jar 1.0.0-SNAPSHOT - com.loafle.overflow.sql + com.loafle.overflow.crawler.sql @@ -31,7 +31,6 @@ 42.0.0 - com.microsoft.sqlserver mssql-jdbc @@ -47,7 +46,7 @@ - com.loafle + com.loafle.overflow crawler_java 1.0.0-SNAPSHOT diff --git a/sql_crawler.iml b/sql_crawler_java.iml similarity index 100% rename from sql_crawler.iml rename to sql_crawler_java.iml diff --git a/src/main/java/com/loafle/overflow/sql/DBMetaInfo.java b/src/main/java/com/loafle/overflow/crawler/sql/DBMetaInfo.java similarity index 82% rename from src/main/java/com/loafle/overflow/sql/DBMetaInfo.java rename to src/main/java/com/loafle/overflow/crawler/sql/DBMetaInfo.java index 682bfc2..ea98c00 100644 --- a/src/main/java/com/loafle/overflow/sql/DBMetaInfo.java +++ b/src/main/java/com/loafle/overflow/crawler/sql/DBMetaInfo.java @@ -1,4 +1,4 @@ -package com.loafle.overflow.sql; +package com.loafle.overflow.crawler.sql; /** * Created by insanity on 17. 4. 11. diff --git a/src/main/java/com/loafle/overflow/sql/SQLCrawler.java b/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java similarity index 81% rename from src/main/java/com/loafle/overflow/sql/SQLCrawler.java rename to src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java index 0a22696..d1ffb33 100644 --- a/src/main/java/com/loafle/overflow/sql/SQLCrawler.java +++ b/src/main/java/com/loafle/overflow/crawler/sql/SQLCrawler.java @@ -1,4 +1,4 @@ -package com.loafle.overflow.sql; +package com.loafle.overflow.crawler.sql; import com.loafle.overflow.crawler.Crawler; @@ -15,8 +15,10 @@ public class SQLCrawler extends Crawler { public SQLCrawler() {} - public Object get(String id) { - TargetInfo info = getTargetInfo(id); + + @Override + protected Object getInternal(Map config) { + TargetInfo info = getTargetInfo(config.get("id").toString()); return getMetrics(info); } @@ -24,17 +26,17 @@ public class SQLCrawler extends Crawler { TargetInfo info = new TargetInfo(); // //MySQL - info.setUrl("jdbc:mysql://192.168.1.215:3306"); - info.setId("root"); - info.setPw("qwe123"); - info.setSSL(false); - info.setQuery("show session status"); -// //MSSQL -// info.setUrl("jdbc:sqlserver://192.168.1.106:1433"); -// info.setId("sa"); +// info.setUrl("jdbc:mysql://192.168.1.215:3306"); // ?useSSL=true&verifyServerCertificate=false +// info.setId("root"); // info.setPw("qwe123"); // info.setSSL(false); -// info.setQuery("select * from master.dbo.sysprocesses"); +// info.setQuery("show session status"); +// //MSSQL + info.setUrl("jdbc:sqlserver://192.168.1.103:1433;integratedSecurity=SSPI;encrypt=false;trustServerCertificate=true"); + info.setId("sa"); + info.setPw("qwer5795"); + info.setSSL(true); + info.setQuery("select * from master.dbo.sysprocesses"); // //PGSQL // info.setUrl("jdbc:postgresql://192.168.1.107:5432/postgres"); // info.setId("postgres"); diff --git a/src/main/java/com/loafle/overflow/sql/TargetInfo.java b/src/main/java/com/loafle/overflow/crawler/sql/TargetInfo.java similarity index 95% rename from src/main/java/com/loafle/overflow/sql/TargetInfo.java rename to src/main/java/com/loafle/overflow/crawler/sql/TargetInfo.java index cb067bc..f83aba6 100644 --- a/src/main/java/com/loafle/overflow/sql/TargetInfo.java +++ b/src/main/java/com/loafle/overflow/crawler/sql/TargetInfo.java @@ -1,4 +1,4 @@ -package com.loafle.overflow.sql; +package com.loafle.overflow.crawler.sql; /** * Created by insanity on 17. 4. 11. diff --git a/src/test/java/com/loafle/overflow/AppTest.java b/src/test/java/com/loafle/overflow/AppTest.java index d5e0d13..1f448ab 100644 --- a/src/test/java/com/loafle/overflow/AppTest.java +++ b/src/test/java/com/loafle/overflow/AppTest.java @@ -1,7 +1,7 @@ package com.loafle.overflow; -import com.loafle.overflow.sql.SQLCrawler; +import com.loafle.overflow.crawler.sql.SQLCrawler; import org.junit.Test; import java.util.List;