overflow_server project shared

This commit is contained in:
geek 2017-06-28 14:19:04 +09:00
commit 2a33d44857
102 changed files with 4626 additions and 0 deletions

91
.gitignore vendored Normal file
View File

@ -0,0 +1,91 @@
# Created by .ignore support plugin (hsz.mobi)
### 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
### Maven template
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
14
# 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*
.idea/
*.iml
/target/
.settings/
.classpath
.project
.vscode/settings.json
.vscode/

28
docker-compose.yml Normal file
View File

@ -0,0 +1,28 @@
version: "3"
services:
# overFlow-dao:
# restart: always
# build: ./
# container_name: overFlow-dao
# volumes:
# ports:
# - "9080:80"
postgresql:
restart: always
image: postgres:9.6-alpine
container_name: overFlow-dao-postgres
environment:
- POSTGRES_DB=overflow
- POSTGRES_USER=overflow
- POSTGRES_PASSWORD=qwer5795
# - POSTGRES_INITDB_ARGS="--data-checksums"
ports:
- "5432:5432"
# docker-compose up -d
# docker-compose stop
# docker-compose rm
# or
# docker-compose -f ./docker-compose.yml up -d

147
pom.xml Normal file
View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.loafle</groupId>
<artifactId>maven_parent_jar</artifactId>
<version>1.0.0-RELEASE</version>
</parent>
<groupId>com.loafle.overflow</groupId>
<artifactId>overflow_server</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>com.loafle.overflow.overflow_server</name>
<properties>
<grpc.version>1.2.0</grpc.version>
<protoc.version>3.2.0</protoc.version>
<spring-test-version>4.3.9.RELEASE</spring-test-version>
<hibernate.version>4.3.10.Final</hibernate.version>
<spring-data-jpa>1.11.4.RELEASE</spring-data-jpa>
</properties>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<!-- Spring Dependency-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring-data-jpa}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring-test-version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1200-jdbc41</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.10.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.10.Final</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protoc.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,7 @@
package com.loafle.overflow;
public class OFMain {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}

View File

@ -0,0 +1,15 @@
package com.loafle.overflow.module.apikey.dao;
import com.loafle.overflow.module.apikey.model.ApiKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by root on 17. 6. 1.
*/
@Repository
public interface ApiKeyDAO extends JpaRepository<ApiKey, Long> {
ApiKey findByApiKey(String apiKey);
}

View File

@ -0,0 +1,81 @@
package com.loafle.overflow.module.apikey.model;
import com.loafle.overflow.module.domain.model.Domain;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "API_KEY", schema = "public", catalog = "postgres")
public class ApiKey {
private long id;
private String apiKey;
private Date createDate;
private Domain domain;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "API_KEY", nullable = false, length = 50)
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name="CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable=false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
//
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// TblApiKey tblApiKey = (TblApiKey) o;
//
// if (id != tblApiKey.id) return false;
// if (domainId != tblApiKey.domainId) return false;
// if (apiKey != null ? !apiKey.equals(tblApiKey.apiKey) : tblApiKey.apiKey != null) return false;
// if (createDate != null ? !createDate.equals(tblApiKey.createDate) : tblApiKey.createDate != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (int) (domainId ^ (domainId >>> 32));
// return result;
// }
}

View File

@ -0,0 +1,15 @@
package com.loafle.overflow.module.crawler.dao;//package com.loafle.overflow.module.crawler.dao;
//
//import com.loafle.overflow.module.crawler.model.Crawler;
//import org.springframework.data.jpa.repository.JpaRepository;
//import org.springframework.stereotype.Repository;
//
//import java.util.List;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//@Repository
//public interface CrawlerDAO extends JpaRepository<Crawler, Long> {
//// public List<Crawler> findAll();
//}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.crawler.dao;//package com.loafle.overflow.module.crawler.dao;
//
//import com.loafle.overflow.module.crawler.model.CrawlerInputItem;
//import org.springframework.data.jpa.repository.JpaRepository;
//import org.springframework.stereotype.Repository;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//@Repository
//public interface CrawlerInputItemDAO extends JpaRepository<CrawlerInputItem, Long> {
//}

View File

@ -0,0 +1,15 @@
package com.loafle.overflow.module.crawler.dao;//package com.loafle.overflow.module.crawler.dao;
//
//import com.loafle.overflow.module.crawler.model.CrawlerInputItemMapping;
//import org.springframework.data.jpa.repository.JpaRepository;
//import org.springframework.stereotype.Repository;
//
//import java.util.List;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//@Repository
//public interface CrawlerInputItemMappingDAO extends JpaRepository<CrawlerInputItemMapping, Long> {
//// public List<CrawlerInputItemMapping> findByCrawlerId(Crawler crawler);
//}

View File

@ -0,0 +1,27 @@
package com.loafle.overflow.module.crawler.dao;//package com.loafle.overflow.module.crawler.dao;
//
//import com.loafle.overflow.commons.dao.JPABaseDAO;
//import com.loafle.overflow.module.crawler.model.Crawler;
//
//import javax.persistence.Query;
//import java.util.List;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//public class JPACrawlerDAO extends JPABaseDAO<Crawler> implements CrawlerDAO {
// @Override
// public List<Crawler> findAll() {
// Query query = getEntityManager().createNativeQuery("SELECT c.* FROM CRAWLER c ", Crawler.class);
//
// List<Crawler> crs = null;
//
// try {
// crs = (List<Crawler>)query.getResultList();
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// return crs;
// }
// }
//}

View File

@ -0,0 +1,10 @@
package com.loafle.overflow.module.crawler.dao;//package com.loafle.overflow.module.crawler.dao;
//
//import com.loafle.overflow.commons.dao.JPABaseDAO;
//import com.loafle.overflow.module.crawler.model.CrawlerInputItem;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//public class JPACrawlerInputItemDAO extends JPABaseDAO<CrawlerInputItem> implements CrawlerInputItemDAO {
//}

View File

@ -0,0 +1,29 @@
package com.loafle.overflow.module.crawler.dao;//package com.loafle.overflow.module.crawler.dao;
//
//import com.loafle.overflow.commons.dao.JPABaseDAO;
//import com.loafle.overflow.module.crawler.model.Crawler;
//import com.loafle.overflow.module.crawler.model.CrawlerInputItemMapping;
//
//import javax.persistence.Query;
//import java.util.List;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//public class JPACrawlerInputItemMappingDAO extends JPABaseDAO<CrawlerInputItemMapping> implements CrawlerInputItemMappingDAO {
// @Override
// public List<CrawlerInputItemMapping> findByCrawlerId(Crawler crawler) {
// Query query = getEntityManager().createNativeQuery("SELECT m.* FROM CRAWLER_INPUT_ITEM_MAPPING m WHERE m.crawler_id = :crawler_id", CrawlerInputItemMapping.class);
// query.setParameter("crawler_id", crawler.getId());
//
// List<CrawlerInputItemMapping> crs = null;
//
// try {
// crs = (List<CrawlerInputItemMapping>)query.getResultList();
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// return crs;
// }
// }
//}

View File

@ -0,0 +1,76 @@
package com.loafle.overflow.module.crawler.model;//package com.loafle.overflow.module.crawler.model;
//
//import javax.persistence.*;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//@SuppressWarnings("serial")
////@Entity(name="CRAWLER")
//public class Crawler implements Serializable {
//
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// private Long id;
//
// @Column(name="NAME", nullable=false)
// private String name;
//
// @Column(name="DESCRIPTION")
// private String description;
//
// @Column(name="CRAWLER_TYPE")
// private String crawlerType;
//
// @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
// private Date createDate;
//
// public Crawler() {
// }
//
// public Crawler(Long id) {
// this.id = id;
// }
//
// public Long getId() {
// return id;
// }
//
// public void setId(Long id) {
// this.id = id;
// }
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public String getDescription() {
// return description;
// }
//
// public void setDescription(String description) {
// this.description = description;
// }
//
// public String getCrawlerType() {
// return crawlerType;
// }
//
// public void setCrawlerType(String crawlerType) {
// this.crawlerType = crawlerType;
// }
//
// public Date getCreateDate() {
// return createDate;
// }
//
// public void setCreateDate(Date createDate) {
// this.createDate = createDate;
// }
//}

View File

@ -0,0 +1,75 @@
package com.loafle.overflow.module.crawler.model;//package com.loafle.overflow.module.crawler.model;
//
//import javax.persistence.*;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//@SuppressWarnings("serial")
////@Entity(name="CRAWLER_INPUT_ITEM")
//public class CrawlerInputItem implements Serializable {
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// private Long id;
//
// @Column(name = "NAME")
// private String name;
//
// @Column(name = "DESCRIPTION")
// private String description;
//
// @Column(name = "DATA_TYPE")
// private String dataType;
//
// @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
// private Date createDate;
//
//
// public CrawlerInputItem(){}
//
// public CrawlerInputItem(Long id) {
// this.id = id;
// }
//
// public Long getId() {
// return id;
// }
//
// public void setId(Long id) {
// this.id = id;
// }
//
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
//
// public String getDescription() {
// return description;
// }
//
// public void setDescription(String description) {
// this.description = description;
// }
//
// public String getDataType() {
// return dataType;
// }
//
// public void setDataType(String dataType) {
// this.dataType = dataType;
// }
//
// public Date getCreateDate() {
// return createDate;
// }
//
// public void setCreateDate(Date createDate) {
// this.createDate = createDate;
// }
//}

View File

@ -0,0 +1,86 @@
package com.loafle.overflow.module.crawler.model;//package com.loafle.overflow.module.crawler.model;
//
//import javax.persistence.*;
//import java.io.Serializable;
//import java.util.Date;
//
///**
// * Created by geek@loafle.com on 17. 6. 8.
// */
//@SuppressWarnings("serial")
////@Entity(name="CRAWLER_INPUT_ITEM_MAPPING")
//public class CrawlerInputItemMapping implements Serializable {
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// private Long id;
//
// @ManyToOne
// @JoinColumn(name = "CRAWLER_ID", nullable=false)
// private Crawler crawler;
//
// @ManyToOne
// @JoinColumn(name = "CRAWLER_INPUT_ITEM_ID", nullable=false)
// private CrawlerInputItem crawlerInputItem;
//
// @Column(name = "PRIORITY")
// private short priority;
//
// @Column(name = "REQUIRED_TYPE")
// private boolean requiredType;
//
// @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
// private Date createDate;
//
// public CrawlerInputItemMapping(){}
// public CrawlerInputItemMapping(Long id){
// this.id = id;
// }
//
// public Long getId() {
// return id;
// }
//
// public void setId(Long id) {
// this.id = id;
// }
//
// public Crawler getCrawler() {
// return crawler;
// }
//
// public void setCrawler(Crawler crawler) {
// this.crawler = crawler;
// }
//
// public CrawlerInputItem getCrawlerInputItem() {
// return crawlerInputItem;
// }
//
// public void setCrawlerInputItem(CrawlerInputItem crawlerInputItem) {
// this.crawlerInputItem = crawlerInputItem;
// }
//
// public short getPriority() {
// return priority;
// }
//
// public void setPriority(short priority) {
// this.priority = priority;
// }
//
// public boolean isRequiredType() {
// return requiredType;
// }
//
// public void setRequiredType(boolean requiredType) {
// this.requiredType = requiredType;
// }
//
// public Date getCreateDate() {
// return createDate;
// }
//
// public void setCreateDate(Date createDate) {
// this.createDate = createDate;
// }
//}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.domain.dao;
import com.loafle.overflow.module.domain.model.Domain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by root on 17. 6. 23.
*/
@Repository
public interface DomainDAO extends JpaRepository<Domain, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.domain.dao;
import com.loafle.overflow.module.domain.model.DomainMember;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by root on 17. 6. 23.
*/
@Repository
public interface DomainMemberDAO extends JpaRepository<DomainMember, Long> {
}

View File

@ -0,0 +1,52 @@
package com.loafle.overflow.module.domain.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "DOMAIN", schema = "public", catalog = "postgres")
public class Domain {
private long id;
private String name;
private Date createDate;
public Domain() {
}
public Domain(long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,59 @@
package com.loafle.overflow.module.domain.model;
import com.loafle.overflow.module.member.model.Member;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "DOMAIN_MEMBER", schema = "public", catalog = "postgres")
public class DomainMember {
private long id;
private Timestamp createDate;
private Member member;
private Domain domain;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable = false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
}

View File

@ -0,0 +1,23 @@
package com.loafle.overflow.module.email.dao;
import com.loafle.overflow.module.email.model.EmailAuth;
import com.loafle.overflow.module.member.model.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by geek@loafle.com on 17. 6. 6.
*/
@Repository
public interface EmailAuthDAO extends JpaRepository<EmailAuth, Long> {
@Query("select e from EmailAuth e where e.emailAuthKey = :authKey")
EmailAuth findByEmailAuthKey(@Param("authKey") String emailAuthKey);
List<EmailAuth> findByMember(Member member);
}

View File

@ -0,0 +1,69 @@
package com.loafle.overflow.module.email.model;
import com.loafle.overflow.module.member.model.Member;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "EMAIL_AUTH", schema = "public", catalog = "postgres")
public class EmailAuth {
private long id;
private String emailAuthKey;
private Timestamp createDate;
private Timestamp authConfirmDate;
private Member member;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "EMAIL_AUTH_KEY", nullable = true, length = 50)
public String getEmailAuthKey() {
return emailAuthKey;
}
public void setEmailAuthKey(String emailAuthKey) {
this.emailAuthKey = emailAuthKey;
}
@Basic
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "AUTH_CONFIRM_DATE", nullable = true, insertable = true, updatable = false)
public Timestamp getAuthConfirmDate() {
return authConfirmDate;
}
public void setAuthConfirmDate(Timestamp authConfirmDate) {
this.authConfirmDate = authConfirmDate;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
}

View File

@ -0,0 +1,54 @@
package com.loafle.overflow.module.history;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "HISTORY", schema = "public", catalog = "postgres")
public class History {
private long id;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
History that = (History) o;
if (id != that.id) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@ -0,0 +1,14 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.Infra;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraDAO extends JpaRepository<Infra, Long> {
// @Query("select m from Member m WHERE m.email = :#{#m2.email}")
// Member findByEmail(@Param("m2") Member member);
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraHost;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraHostDAO extends JpaRepository<InfraHost, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraMachine;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraMachineDAO extends JpaRepository<InfraMachine, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraOSApplication;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraOSApplicationDAO extends JpaRepository<InfraOSApplication, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraOS;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraOSDAO extends JpaRepository<InfraOS, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraOSDaemon;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraOSDaemonDAO extends JpaRepository<InfraOSDaemon, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraOSPort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraOSPortDAO extends JpaRepository<InfraOSPort, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.infra.dao;
import com.loafle.overflow.module.infra.model.InfraService;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface InfraServiceDAO extends JpaRepository<InfraService, Long> {
}

View File

@ -0,0 +1,60 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA", schema = "public", catalog = "postgres")
public class Infra {
private long id;
private MetaInfraType type;
private long childId;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInfraType getType() {
return type;
}
public void setType(MetaInfraType type) {
this.type = type;
}
@Basic
@Column(name = "CHILD_ID", nullable = false)
public long getChildId() {
return childId;
}
public void setChildId(long childId) {
this.childId = childId;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,68 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_HOST", schema = "public", catalog = "postgres")
public class InfraHost {
private long id;
private InfraOS os;
private int ip;
private int mac;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "IP", nullable = false)
public int getIp() {
return ip;
}
public void setIp(int ip) {
this.ip = ip;
}
@Basic
@Column(name = "MAC", nullable = false)
public int getMac() {
return mac;
}
public void setMac(int mac) {
this.mac = mac;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,59 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.probe.model.Probe;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_MACHINE", schema = "public", catalog = "postgres")
public class InfraMachine {
private long id;
private Probe probe;
private String meta;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@Basic
@Column(name = "META", nullable = true, length = 255)
public String getMeta() {
return meta;
}
public void setMeta(String meta) {
this.meta = meta;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,71 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS", schema = "public", catalog = "postgres")
public class InfraOS {
private long id;
private InfraMachine machine;
private String meta;
private Date createDate;
private MetaInfraVendor vendor;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "MACHINE_ID", nullable = false)
public InfraMachine getMachine() {
return machine;
}
public void setMachine(InfraMachine machine) {
this.machine = machine;
}
@Basic
@Column(name = "META", nullable = true, length = 255)
public String getMeta() {
return meta;
}
public void setMeta(String meta) {
this.meta = meta;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
}

View File

@ -0,0 +1,57 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_APPLICATION", schema = "public", catalog = "postgres")
public class InfraOSApplication {
private long id;
private InfraOS os;
private String name;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,56 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_DAEMON", schema = "public", catalog = "postgres")
public class InfraOSDaemon {
private long id;
private InfraOS os;
private String name;
private Date createDate;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,93 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_OS_PORT", schema = "public", catalog = "postgres")
public class InfraOSPort {
private long id;
private InfraOS os;
private Date createDate;
private Integer port;
private String portType;
private MetaInfraVendor vendor;
private boolean tlsType;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public InfraOS getOs() {
return this.os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "PORT", nullable = true)
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
@Basic
@Column(name = "PORT_TYPE", nullable = false)
public String getPortType() {
return portType;
}
public void setPortType(String portType) {
this.portType = portType;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Basic
@Column(name = "TLS_TYPE", nullable = false)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

View File

@ -0,0 +1,92 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "INFRA_SERVICE", schema = "public", catalog = "postgres")
public class InfraService {
private long id;
private InfraHost host;
private String portType;
private Integer port;
private MetaInfraVendor vendor;
private Date createDate;
private boolean tlsType;
@Id
@Column(name = "ID", nullable = false)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "HOST_ID", nullable = false)
public InfraHost getHost() {
return host;
}
public void setHost(InfraHost host) {
this.host = host;
}
@Basic
@Column(name = "PORT_TYPE", nullable = false)
public String getPortType() {
return portType;
}
public void setPortType(String portType) {
this.portType = portType;
}
@Basic
@Column(name = "PORT", nullable = true)
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "TLS_TYPE", nullable = false)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

View File

@ -0,0 +1,16 @@
package com.loafle.overflow.module.member.dao;
import com.loafle.overflow.module.member.model.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 5. 25.
*/
@Repository
public interface MemberDAO extends JpaRepository<Member, Long> {
@Query("select m from Member m WHERE m.email = :#{#m2.email}")
Member findByEmail(@Param("m2") Member member);
}

View File

@ -0,0 +1,123 @@
package com.loafle.overflow.module.member.model;
import com.loafle.overflow.module.meta.model.MetaMemberStatus;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "MEMBER", schema = "public", catalog = "postgres")
public class Member {
private long id;
private String email;
private String pw;
private String pwSalt;
private String name;
private String phone;
private String companyName;
private Date createDate;
private MetaMemberStatus status;
public Member() {
}
public Member(long id) {
this.id = id;
}
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "EMAIL", nullable = false, length = 50)
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Basic
@Column(name = "PW", nullable = true, length = 32)
public String getPw() {
return pw;
}
public void setPw(String pw) {
this.pw = pw;
}
@Basic
@Column(name = "PW_SALT", nullable = true, length = 32)
public String getPwSalt() {
return pwSalt;
}
public void setPwSalt(String pwSalt) {
this.pwSalt = pwSalt;
}
@Basic
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "PHONE", nullable = true, length = 50)
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Basic
@Column(name = "COMPANY_NAME", nullable = true, length = 50)
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "STATUS_ID", nullable = false)
public MetaMemberStatus getStatus() {
return status;
}
public void setStatus(MetaMemberStatus status) {
this.status = status;
}
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaCrawler;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaCrawlerDAO extends JpaRepository<MetaCrawler, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaCrawlerInputItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaCrawlerInputItemDAO extends JpaRepository<MetaCrawlerInputItem, Integer> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaInfraTypeDAO extends JpaRepository<MetaInfraType, Integer> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaInfraVendorDAO extends JpaRepository<MetaInfraVendor, Integer> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaInputType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaInputTypeDAO extends JpaRepository<MetaInputType, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaMemberStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaMemberStatusDAO extends JpaRepository<MetaMemberStatus, Short> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by snoop on 17. 6. 26.
*/
@Repository
public interface MetaNoAuthProbeStatusDAO extends JpaRepository<MetaNoAuthProbeStatus, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaNotification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaNotificationDAO extends JpaRepository<MetaNotification, Long> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaProbeArchitecture;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaProbeArchitectureDAO extends JpaRepository<MetaProbeArchitecture, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaProbeOs;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaProbeOsDAO extends JpaRepository<MetaProbeOs, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaProbePackage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaProbePackageDAO extends JpaRepository<MetaProbePackage, Long> {
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaProbeStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by snoop on 17. 6. 26.
*/
@Repository
public interface MetaProbeStatusDAO extends JpaRepository<MetaProbeStatus, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaProbeTaskType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaProbeTaskTypeDAO extends JpaRepository<MetaProbeTaskType, Short>{
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaProbeVersion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaProbeVersionDAO extends JpaRepository<MetaProbeVersion, Short>{
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaSensorItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaSensorItemDAO extends JpaRepository<MetaSensorItem, Integer>{
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaSensorItemType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaSensorItemTypeDAO extends JpaRepository<MetaSensorItemType, Short>{
}

View File

@ -0,0 +1,12 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaSensorStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by snoop on 17. 6. 26.
*/
@Repository
public interface MetaSensorStatusDAO extends JpaRepository<MetaSensorStatus, Short> {
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaVendorCrawler;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaVendorCrawlerDAO extends JpaRepository<MetaVendorCrawler, Integer>{
}

View File

@ -0,0 +1,13 @@
package com.loafle.overflow.module.meta.dao;
import com.loafle.overflow.module.meta.model.MetaVendorCrawlerSensorItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by insanity on 17. 6. 23.
*/
@Repository
public interface MetaVendorCrawlerSensorItemDAO extends JpaRepository<MetaVendorCrawlerSensorItem, Long>{
}

View File

@ -0,0 +1,55 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_CRAWLER", schema = "public", catalog = "postgres")
public class MetaCrawler {
private short id;
private Date createDate;
private String name;
private String description;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name="CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "DESCRIPTION", nullable = true, length = 100)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -0,0 +1,167 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_CRAWLER_INPUT_ITEM", schema = "public", catalog = "postgres")
public class MetaCrawlerInputItem {
private int id;
private MetaInputType metaInputType;
private MetaCrawler metaCrawler;
private String description;
private String name;
private Date createDate;
private boolean required;
private String defaultValue;
private String pattern;
private String keyName;
private String keyValue;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaInputType getMetaInputType() {
return metaInputType;
}
public void setMetaInputType(MetaInputType metaInputType) {
this.metaInputType = metaInputType;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getMetaCrawler() {
return metaCrawler;
}
public void setMetaCrawler(MetaCrawler metaCrawler) {
this.metaCrawler = metaCrawler;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "REQUIRED", nullable = false)
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
@Column(name = "DEFAULT_VALUE", nullable = true, length = 50)
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
@Column(name = "PATTERN", nullable = true, length = 50)
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
@Column(name = "KEY_NAME", nullable = true, length = 50)
public String getKeyName() {
return keyName;
}
public void setKeyName(String keyName) {
this.keyName = keyName;
}
@Column(name = "KEY_VALUE", nullable = true, length = 50)
public String getKeyValue() {
return keyValue;
}
public void setKeyValue(String keyValue) {
this.keyValue = keyValue;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// MetaCrawlerInputItem that = (MetaCrawlerInputItem) o;
//
// if (id != that.id) return false;
// if (typeId != that.typeId) return false;
// if (crawlerId != that.crawlerId) return false;
// if (required != that.required) return false;
// if (desc != null ? !desc.equals(that.desc) : that.desc != null) return false;
// if (name != null ? !name.equals(that.name) : that.name != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
// if (defaultValue != null ? !defaultValue.equals(that.defaultValue) : that.defaultValue != null) return false;
// if (pattern != null ? !pattern.equals(that.pattern) : that.pattern != null) return false;
// if (keyName != null ? !keyName.equals(that.keyName) : that.keyName != null) return false;
// if (keyValue != null ? !keyValue.equals(that.keyValue) : that.keyValue != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = id;
// result = 31 * result + (int) typeId;
// result = 31 * result + (int) crawlerId;
// result = 31 * result + (desc != null ? desc.hashCode() : 0);
// result = 31 * result + (name != null ? name.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (required ? 1 : 0);
// result = 31 * result + (defaultValue != null ? defaultValue.hashCode() : 0);
// result = 31 * result + (pattern != null ? pattern.hashCode() : 0);
// result = 31 * result + (keyName != null ? keyName.hashCode() : 0);
// result = 31 * result + (keyValue != null ? keyValue.hashCode() : 0);
// return result;
// }
}

View File

@ -0,0 +1,45 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INFRA_TYPE", schema = "public", catalog = "postgres")
public class MetaInfraType {
private int id;
private String name;
private Date createDate;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,90 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INFRA_VENDOR", schema = "public", catalog = "postgres")
public class MetaInfraVendor {
private int id;
private String name;
private Date createDate;
private MetaInfraType metaInfraType;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
// @Basic
// @Column(name = "TYPE_ID", nullable = false)
// public int getTypeId() {
// return typeId;
// }
//
// public void setTypeId(int typeId) {
// this.typeId = typeId;
// }
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable=false)
public MetaInfraType getMetaInfraType() {
return metaInfraType;
}
public void setMetaInfraType(MetaInfraType metaInfraType) {
this.metaInfraType = metaInfraType;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// MetaInfraVendor that = (MetaInfraVendor) o;
//
// if (id != that.id) return false;
// if (typeId != that.typeId) return false;
// if (name != null ? !name.equals(that.name) : that.name != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = id;
// result = 31 * result + (name != null ? name.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + typeId;
// return result;
// }
}

View File

@ -0,0 +1,55 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_INPUT_TYPE", schema = "public", catalog = "postgres")
public class MetaInputType {
private short id;
private String name;
private String description;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,44 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_MEMBER_STATUS", schema = "public", catalog = "postgres")
public class MetaMemberStatus {
private short id;
private String name;
public MetaMemberStatus() {
}
public MetaMemberStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,43 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by snoop on 17. 6. 26.
*/
@Entity
@Table(name = "META_NOAUTH_PROBE_STATUS", schema = "public", catalog = "postgres")
public class MetaNoAuthProbeStatus {
private short id;
private String name;
public MetaNoAuthProbeStatus() {
}
public MetaNoAuthProbeStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,54 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_NOTIFICATION", schema = "public", catalog = "postgres")
public class MetaNotification {
private long id;
private Date createDate;
private String name;
private String description;
@Id
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -0,0 +1,45 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_PROBE_ARCHITECTURE", schema = "public", catalog = "postgres")
public class MetaProbeArchitecture {
private short id;
private String architecture;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "ARCHITECTURE", nullable = true, length = 10)
public String getArchitecture() {
return architecture;
}
public void setArchitecture(String architecture) {
this.architecture = architecture;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,45 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_PROBE_OS", schema = "public", catalog = "postgres")
public class MetaProbeOs {
private short id;
private String name;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,68 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_PROBE_PACKAGE", schema = "public", catalog = "postgres")
public class MetaProbePackage {
private long id;
private MetaProbeVersion version;
private MetaProbeOs os;
private MetaProbeArchitecture architecture;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "VERSION_ID", nullable = false)
public MetaProbeVersion getVersion() {
return version;
}
public void setVersion(MetaProbeVersion version) {
this.version = version;
}
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = false)
public MetaProbeOs getOs() {
return os;
}
public void setOs(MetaProbeOs os) {
this.os = os;
}
@ManyToOne
@JoinColumn(name = "ARCHITECTURE_ID", nullable = false)
public MetaProbeArchitecture getArchitecture() {
return architecture;
}
public void setArchitecture(MetaProbeArchitecture architecture) {
this.architecture = architecture;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,43 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by snoop on 17. 6. 26.
*/
@Entity
@Table(name = "META_PROBE_STATUS", schema = "public", catalog = "postgres")
public class MetaProbeStatus {
private short id;
private String name;
public MetaProbeStatus() {
}
public MetaProbeStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,56 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_PROBE_TASK_TYPE", schema = "public", catalog = "postgres")
public class MetaProbeTaskType {
private short id;
private String name;
private String description;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "NAME", nullable = false, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "DESCRIPTION", nullable = false, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,46 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_PROBE_VERSION", schema = "public", catalog = "postgres")
public class MetaProbeVersion {
private short id;
private String version;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "VERSION", nullable = true, length = 10)
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,75 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_SENSOR_ITEM", schema = "public", catalog = "postgres")
public class MetaSensorItem {
private int id;
private MetaSensorItemType metaSensorItemType;
private String key;
private String name;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
// @Column(name = "TYPE_ID", nullable = false)
// public short getTypeId() {
// return typeId;
// }
//
// public void setTypeId(short typeId) {
// this.typeId = typeId;
// }
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaSensorItemType getMetaSensorItemType() {
return metaSensorItemType;
}
public void setMetaSensorItemType(MetaSensorItemType metaSensorItemType) {
this.metaSensorItemType = metaSensorItemType;
}
@Column(name = "KEY", nullable = true, length = 50)
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,56 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_SENSOR_ITEM_TYPE", schema = "public", catalog = "postgres")
public class MetaSensorItemType {
private short id;
private String name;
private String description;
private Date createDate;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "NAME", nullable = true, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,43 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created by snoop on 17. 6. 26.
*/
@Entity
@Table(name = "META_SENSOR_STATUS", schema = "public", catalog = "postgres")
public class MetaSensorStatus {
private short id;
private String name;
public MetaSensorStatus() {
}
public MetaSensorStatus(short id) {
this.id = id;
}
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "Name", nullable = false, length = 10)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,76 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_VENDOR_CRAWLER", schema = "public", catalog = "postgres")
public class MetaVendorCrawler {
private int id;
private MetaCrawler metaCrawler;
private MetaInfraVendor metaInfraVendor;
private Date createDate;
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getMetaCrawler() {
return metaCrawler;
}
public void setMetaCrawler(MetaCrawler metaCrawler) {
this.metaCrawler = metaCrawler;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getMetaInfraVendor() {
return metaInfraVendor;
}
public void setMetaInfraVendor(MetaInfraVendor metaInfraVendor) {
this.metaInfraVendor = metaInfraVendor;
}
// @Basic
// @Column(name = "CRAWLER_ID", nullable = false)
// public short getCrawlerId() {
// return crawlerId;
// }
//
// public void setCrawlerId(short crawlerId) {
// this.crawlerId = crawlerId;
// }
//
// @Basic
// @Column(name = "VENDOR_ID", nullable = false)
// public int getVendorId() {
// return vendorId;
// }
//
// public void setVendorId(int vendorId) {
// this.vendorId = vendorId;
// }
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,111 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "META_VENDOR_CRAWLER_SENSOR_ITEM", schema = "public", catalog = "postgres")
public class MetaVendorCrawlerSensorItem {
private long id;
private String interval;
private String warnCondition;
private Date createDate;
private MetaSensorItem metaSensorItem;
private MetaInfraVendor metaInfraVendor;
private short crawlerId;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "INTERVAL", nullable = true, length = 50)
public String getInterval() {
return interval;
}
public void setInterval(String interval) {
this.interval = interval;
}
@Column(name = "WARN_CONDITION", nullable = true, length = 50)
public String getWarnCondition() {
return warnCondition;
}
public void setWarnCondition(String warnCondition) {
this.warnCondition = warnCondition;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
// @Basic
// @Column(name = "ITEM_ID", nullable = false)
// public int getItemId() {
// return itemId;
// }
//
// public void setItemId(int itemId) {
// this.itemId = itemId;
// }
//
// @Basic
// @Column(name = "VENDOR_ID", nullable = false)
// public int getVendorId() {
// return vendorId;
// }
//
// public void setVendorId(int vendorId) {
// this.vendorId = vendorId;
// }
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getMetaSensorItem() {
return metaSensorItem;
}
public void setMetaSensorItem(MetaSensorItem metaSensorItem) {
this.metaSensorItem = metaSensorItem;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getMetaInfraVendor() {
return metaInfraVendor;
}
public void setMetaInfraVendor(MetaInfraVendor metaInfraVendor) {
this.metaInfraVendor = metaInfraVendor;
}
@Basic
@Column(name = "CRAWLER_ID", nullable = false)
public short getCrawlerId() {
return crawlerId;
}
public void setCrawlerId(short crawlerId) {
this.crawlerId = crawlerId;
}
}

View File

@ -0,0 +1,25 @@
package com.loafle.overflow.module.noauthprobe.dao;
import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.noauthprobe.model.NoAuthProbe;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by root on 17. 5. 30.
*/
@Repository
public interface NoAuthProbeDAO extends JpaRepository<NoAuthProbe, Long> {
// NoAuthProbeDeprecate findByTempKey(NoAuthProbeDeprecate noAuthAgent);
// List<NoAuthProbeDeprecate> findAllByNoAuth(NoAuthProbeDeprecate noAuthAgent);
// @Query("SELECT n FROM NoAuthProbe n WHERE n.tempProbeKey = :tempProbeKey")
NoAuthProbe findByTempProbeKey(String tempProbeKey);
// @Query("select m from Member m WHERE m.email = :#{#m2.email}")
@Query("SELECT n FROM NoAuthProbe n WHERE n.domain.id = :#{#domain.id} and n.status.id = 3") // 3 = Process
List<NoAuthProbe> findAllByDomain(@Param("domain") Domain domain);
}

View File

@ -0,0 +1,160 @@
package com.loafle.overflow.module.noauthprobe.model;
import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus;
import com.loafle.overflow.module.probe.model.Probe;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "NOAUTH_PROBE", schema = "public", catalog = "postgres")
public class NoAuthProbe {
private long id;
private String hostName;
private long macAddress;
private long ipAddress;
private MetaNoAuthProbeStatus status;
private String tempProbeKey;
private Date createDate;
private String apiKey;
private Domain domain;
private Probe probe;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "HOST_NAME", nullable = true, length = 50)
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
@Column(name = "MAC_ADDRESS", nullable = true)
public long getMacAddress() {
return macAddress;
}
public void setMacAddress(long macAddress) {
this.macAddress = macAddress;
}
@Column(name = "IP_ADDRESS", nullable = true)
public long getIpAddress() {
return ipAddress;
}
public void setIpAddress(long ipAddress) {
this.ipAddress = ipAddress;
}
@ManyToOne
@JoinColumn(name = "STATUS", nullable = false)
public MetaNoAuthProbeStatus getStatus() {
return status;
}
public void setStatus(MetaNoAuthProbeStatus status) {
this.status = status;
}
@Column(name = "TEMP_PROBE_KEY", nullable = false, length = 50, unique = true)
public String getTempProbeKey() {
return tempProbeKey;
}
public void setTempProbeKey(String tempProbeKey) {
this.tempProbeKey = tempProbeKey;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "API_KEY", nullable = true, length = 50)
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable=false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = true)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// NoAuthProbe that = (NoAuthProbe) o;
//
// if (id != that.id) return false;
// if (domainId != that.domainId) return false;
// if (hostName != null ? !hostName.equals(that.hostName) : that.hostName != null) return false;
// if (macAddress != null ? !macAddress.equals(that.macAddress) : that.macAddress != null) return false;
// if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) return false;
// if (status != null ? !status.equals(that.status) : that.status != null) return false;
// if (tempProbeKey != null ? !tempProbeKey.equals(that.tempProbeKey) : that.tempProbeKey != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
// if (apiKey != null ? !apiKey.equals(that.apiKey) : that.apiKey != null) return false;
// if (probeId != null ? !probeId.equals(that.probeId) : that.probeId != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
// result = 31 * result + (macAddress != null ? macAddress.hashCode() : 0);
// result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
// result = 31 * result + (status != null ? status.hashCode() : 0);
// result = 31 * result + (tempProbeKey != null ? tempProbeKey.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (apiKey != null ? apiKey.hashCode() : 0);
// result = 31 * result + (int) (domainId ^ (domainId >>> 32));
// result = 31 * result + (probeId != null ? probeId.hashCode() : 0);
// return result;
// }
}

View File

@ -0,0 +1,19 @@
package com.loafle.overflow.module.noauthprobe.type;
/**
* Created by root on 17. 5. 31.
*/
public enum AuthType {
A("ACCEPT"),
D("DENY"),
P("PROCESS");
private String stringValue;
AuthType(String string) {stringValue = string;}
@Override
public String toString() {
return stringValue;
}
}

View File

@ -0,0 +1,21 @@
package com.loafle.overflow.module.probe.dao;
import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.probe.model.Probe;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by insanity on 17. 5. 29.
*/
@Repository
public interface ProbeDAO extends JpaRepository<Probe, Long> {
// public List<Agent> findAgentListByMemberId(Member member);
Probe findByProbeKey(String probeKey);
List<Probe> findAllByDomain(Domain domain);
}

View File

@ -0,0 +1,17 @@
package com.loafle.overflow.module.probe.dao;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.probe.model.ProbeTask;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by snoop on 17. 6. 26.
*/
@Repository
public interface ProbeTaskDAO extends JpaRepository<ProbeTask, Long> {
List<ProbeTask> findAllByProbe(Probe probe);
}

View File

@ -0,0 +1,139 @@
package com.loafle.overflow.module.probe.model;
import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.meta.model.MetaProbeStatus;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "PROBE", schema = "public", catalog = "postgres")
public class Probe {
private long id;
private MetaProbeStatus status;
private String description;
private Date createDate;
private Date lastPollingDate;
private Date nextPollingDate;
private Domain domain;
private String probeKey;
private String encryptionKey;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "STATUS", nullable = false)
public MetaProbeStatus getStatus() {
return status;
}
public void setStatus(MetaProbeStatus status) {
this.status = status;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LAST_POLLING_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getLastPollingDate() {
return lastPollingDate;
}
public void setLastPollingDate(Date lastPollingDate) {
this.lastPollingDate = lastPollingDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "NEXT_POLLING_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
public Date getNextPollingDate() {
return nextPollingDate;
}
public void setNextPollingDate(Date nextPollingDate) {
this.nextPollingDate = nextPollingDate;
}
@ManyToOne
@JoinColumn(name = "DOMAIN_ID", nullable = false)
public Domain getDomain() {
return domain;
}
public void setDomain(Domain domain) {
this.domain = domain;
}
@Column(name = "PROBE_KEY", nullable = false, unique = true)
public String getProbeKey() {
return probeKey;
}
public void setProbeKey(String probeKey) {
this.probeKey = probeKey;
}
@Column(name = "ENCRYPTION_KEY", nullable = false, length = 50, unique = true)
public String getEncryptionKey() {
return encryptionKey;
}
public void setEncryptionKey(String encryptionKey) {
this.encryptionKey = encryptionKey;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// Probe tblProbe = (Probe) o;
//
// if (id != tblProbe.id) return false;
// if (domain != tblProbe.domain) return false;
// if (status != null ? !status.equals(tblProbe.status) : tblProbe.status != null) return false;
// if (description != null ? !description.equals(tblProbe.description) : tblProbe.description != null)
// return false;
// if (createDate != null ? !createDate.equals(tblProbe.createDate) : tblProbe.createDate != null) return false;
// if (lastPollingDate != null ? !lastPollingDate.equals(tblProbe.lastPollingDate) : tblProbe.lastPollingDate != null)
// return false;
// if (nextPollingDate != null ? !nextPollingDate.equals(tblProbe.nextPollingDate) : tblProbe.nextPollingDate != null)
// return false;
// if (probeKey != null ? !probeKey.equals(tblProbe.probeKey) : tblProbe.probeKey != null) return false;
// if (encryptionKey != null ? !encryptionKey.equals(tblProbe.encryptionKey) : tblProbe.encryptionKey != null)
// return false;
//
// return true;
// }
}

View File

@ -0,0 +1,143 @@
package com.loafle.overflow.module.probe.model;
import com.loafle.overflow.module.meta.model.MetaProbeTaskType;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "PROBE_TASK", schema = "public", catalog = "postgres")
public class ProbeTask {
private long id;
private MetaProbeTaskType metaProbeTaskType;
private Probe probe;
private String data;
private Date createDate;
private Date sendDate;
private Date startDate;
private Date endDate;
private Boolean succeed;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable = false)
public MetaProbeTaskType getMetaProbeTaskType() {
return metaProbeTaskType;
}
public void setMetaProbeTaskType(MetaProbeTaskType metaProbeTaskType) {
this.metaProbeTaskType = metaProbeTaskType;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@Column(name = "DATA", nullable = true, length = 255)
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "SEND_DATE", nullable = true)
public Date getSendDate() {
return sendDate;
}
public void setSendDate(Date sendDate) {
this.sendDate = sendDate;
}
@Column(name = "START_DATE", nullable = true)
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
@Column(name = "END_DATE", nullable = true)
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Column(name = "SUCCEED", nullable = true)
public Boolean getSucceed() {
return succeed;
}
public void setSucceed(Boolean succeed) {
this.succeed = succeed;
}
// @Override
// public boolean equals(Object o) {
// if (this == o) return true;
// if (o == null || getClass() != o.getClass()) return false;
//
// ProbeTask that = (ProbeTask) o;
//
// if (id != that.id) return false;
// if (typeId != that.typeId) return false;
// if (probeId != that.probeId) return false;
// if (data != null ? !data.equals(that.data) : that.data != null) return false;
// if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
// if (sendDate != null ? !sendDate.equals(that.sendDate) : that.sendDate != null) return false;
// if (startDate != null ? !startDate.equals(that.startDate) : that.startDate != null) return false;
// if (endDate != null ? !endDate.equals(that.endDate) : that.endDate != null) return false;
// if (succeed != null ? !succeed.equals(that.succeed) : that.succeed != null) return false;
//
// return true;
// }
//
// @Override
// public int hashCode() {
// int result = (int) (id ^ (id >>> 32));
// result = 31 * result + (int) typeId;
// result = 31 * result + (int) (probeId ^ (probeId >>> 32));
// result = 31 * result + (data != null ? data.hashCode() : 0);
// result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
// result = 31 * result + (sendDate != null ? sendDate.hashCode() : 0);
// result = 31 * result + (startDate != null ? startDate.hashCode() : 0);
// result = 31 * result + (endDate != null ? endDate.hashCode() : 0);
// result = 31 * result + (succeed != null ? succeed.hashCode() : 0);
// return result;
// }
}

View File

@ -0,0 +1,18 @@
package com.loafle.overflow.module.probe.type;
/**
* Created by root on 17. 6. 23.
*/
public enum ProbeStatusType {
I("INITIAL"),
N("NORMAL");
private String stringValue;
ProbeStatusType(String string) {stringValue = string;}
@Override
public String toString() {
return stringValue;
}
}

View File

@ -0,0 +1,17 @@
package com.loafle.overflow.module.sensor.dao;
import com.loafle.overflow.module.sensor.model.Sensor;
import com.loafle.overflow.module.target.model.Target;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by root on 17. 6. 9.
*/
@Repository
public interface SensorDAO extends JpaRepository<Sensor, Long> {
List<Sensor> findAllByTarget(Target target);
}

View File

@ -0,0 +1,16 @@
package com.loafle.overflow.module.sensor.dao;
import com.loafle.overflow.module.sensor.model.Sensor;
import com.loafle.overflow.module.sensor.model.SensorItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by root on 17. 6. 9.
*/
@Repository
public interface SensorItemDAO extends JpaRepository<SensorItem, Long> {
List<SensorItem> findAllBySensor(Sensor sensor);
}

View File

@ -0,0 +1,95 @@
package com.loafle.overflow.module.sensor.model;
import com.loafle.overflow.module.meta.model.MetaCrawler;
import com.loafle.overflow.module.meta.model.MetaSensorStatus;
import com.loafle.overflow.module.target.model.Target;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "SENSOR", schema = "public", catalog = "postgres")
public class Sensor {
private long id;
private Date createDate;
private String description;
private MetaSensorStatus status;
private Target target;
private MetaCrawler crawler;
private String crawlerInputItems;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Column(name = "DESCRIPTION", nullable = true, length = 50)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@ManyToOne
@JoinColumn(name = "STATUS")
public MetaSensorStatus getStatus() {
return status;
}
public void setStatus(MetaSensorStatus status) {
this.status = status;
}
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "TARGET_ID", nullable = false)
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@Column(name = "CRAWLER_INPUT_ITEMS", nullable = true, length = 50)
public String getCrawlerInputItems() {
return crawlerInputItems;
}
public void setCrawlerInputItems(String crawlerInputItems) {
this.crawlerInputItems = crawlerInputItems;
}
}

View File

@ -0,0 +1,62 @@
package com.loafle.overflow.module.sensor.model;
import com.loafle.overflow.module.meta.model.MetaSensorItem;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "SENSOR_ITEM", schema = "public", catalog = "postgres")
public class SensorItem {
private long id;
private Sensor sensor;
private MetaSensorItem item;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "SENSOR_ID", nullable = false)
@OnDelete(action = OnDeleteAction.CASCADE)
public Sensor getSensor() {
return this.sensor;
}
public void setSensor(Sensor sensor) {
this.sensor = sensor;
}
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getItem() {
return item;
}
public void setItem(MetaSensorItem item) {
this.item = item;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,15 @@
package com.loafle.overflow.module.target.dao;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.target.model.Target;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* Created by root on 17. 6. 5.
*/
public interface TargetDAO extends JpaRepository<Target, Long> {
List<Target> findAllByProbe(Probe probe);
}

View File

@ -0,0 +1,64 @@
package com.loafle.overflow.module.target.model;
import com.loafle.overflow.module.infra.model.Infra;
import com.loafle.overflow.module.probe.model.Probe;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "TARGET", schema = "public", catalog = "postgres")
public class Target {
private long id;
private Date createDate;
private Probe probe;
private Infra infra;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
@OnDelete(action = OnDeleteAction.CASCADE)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@ManyToOne
@JoinColumn(name = "INFRA_ID", nullable = false)
public Infra getInfra() {
return infra;
}
public void setInfra(Infra infra) {
this.infra = infra;
}
}

View File

@ -0,0 +1,54 @@
package com.loafle.overflow.module.websocket;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "UI_WEBSOCKET", schema = "public", catalog = "postgres")
public class UiWebsocket {
private long id;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Basic
@Column(name = "CREATE_DATE", nullable = true)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UiWebsocket that = (UiWebsocket) o;
if (id != that.id) return false;
if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (id ^ (id >>> 32));
result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
return result;
}
}

View File

@ -0,0 +1,25 @@
package com.loafle.overflow.spring;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.io.ClassPathResource;
/**
* Created by insanity on 17. 6. 13.
*/
@Configuration
@ComponentScan(basePackages = {"com.loafle.overflow"}, excludeFilters = @ComponentScan.Filter({Configuration.class}))
@PropertySource({"classpath:database.properties"})
public class AppConfig {
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setLocation(new ClassPathResource("database.properties"));
ppc.setIgnoreUnresolvablePlaceholders(true);
return ppc;
}
}

View File

@ -0,0 +1,95 @@
package com.loafle.overflow.spring;
import org.hibernate.cfg.Environment;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.jdbc.datasource.init.DataSourceInitializer;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.TransactionManagementConfigurer;
import javax.persistence.EntityManager;
import javax.sql.DataSource;
import java.util.Properties;
/**
* Created by root on 17. 6. 13.
*/
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = {"com.loafle.overflow"})
public class JdbcConfiguration implements TransactionManagementConfigurer {
@Value("${datasource.driver-class-name}")
private String driver;
@Value("${datasource.url}")
private String url;
@Value("${datasource.username}")
private String username;
@Value("${datasource.password}")
private String password;
@Value("${jpa.hibernate.dialect}")
private String dialect;
@Value("${jpa.hibernate.ddl-auto}")
private String hbm2ddlAuto;
@Bean
public DataSource configureDataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(driver);
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
return dataSource;
}
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(configureDataSource());
entityManagerFactoryBean.setPackagesToScan("com.loafle.overflow");
entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
Properties jpaProperties = new Properties();
jpaProperties.put(Environment.DIALECT, dialect);
jpaProperties.put(Environment.HBM2DDL_AUTO, hbm2ddlAuto);
jpaProperties.put(Environment.SHOW_SQL, true);
entityManagerFactoryBean.setJpaProperties(jpaProperties);
return entityManagerFactoryBean;
}
@Bean
@Qualifier(value = "transactionManager")
public PlatformTransactionManager annotationDrivenTransactionManager() {
return new JpaTransactionManager();
}
@Bean
public EntityManager entityManager() {
return entityManagerFactory().getObject().createEntityManager();
}
@Bean
public DataSourceInitializer dataSourceInitializer(DataSource dataSource) {
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
databasePopulator.addScript(new ClassPathResource("/init.sql"));
databasePopulator.setIgnoreFailedDrops(true);
DataSourceInitializer initializer = new DataSourceInitializer();
initializer.setDataSource(dataSource);
initializer.setDatabasePopulator(databasePopulator);
return initializer;
}
}

20
src/main/proto/grpc.proto Normal file
View File

@ -0,0 +1,20 @@
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.loafle.overflow.server.api";
option java_generic_services = true;
message DBInput {
string targetDao = 1;
string method = 2;
map<string, string> params = 3;
}
message DBOutput {
string result = 1;
}
service DB {
rpc exec(DBInput) returns (DBOutput) {}
}

0
src/main/resources/_ Normal file
View File

View File

@ -0,0 +1,11 @@
datasource.url=jdbc:postgresql://192.168.1.103:5432/overflow
datasource.username=overflow
datasource.password=qwer5795
datasource.driver-class-name=org.postgresql.Driver
jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
jpa.database=postgresql
jpa.hibernate.ddl-auto=create
#jpa.hibernate.ddl-auto=update
jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
jpa.show-sql=true

281
src/main/resources/init.sql Normal file
View File

@ -0,0 +1,281 @@
INSERT INTO public.meta_member_status (id,"name") VALUES (
1,'NOAUTH');
INSERT INTO public.meta_member_status (id,"name") VALUES (
2,'NORMAL');
INSERT INTO public.meta_member_status (id,"name") VALUES (
3,'DIAPAUSE');
INSERT INTO public.meta_member_status (id,"name") VALUES (
4,'WITHDRAWAL');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
1,'2017-06-25 17:31:42.770','MACHINE');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
2,'2017-06-25 17:31:42.894','HOST');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
3,'2017-06-25 17:31:42.906','OS');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
4,'2017-06-25 17:31:42.906','OS_APPLICATION');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
5,'2017-06-25 17:31:42.906','OS_DAEMON');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
6,'2017-06-25 17:31:42.906','OS_PORT');
INSERT INTO public.meta_infra_type (id,create_date,"name") VALUES (
7,'2017-06-25 17:31:42.906','OS_SERVICE');
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
1,'2017-06-25 17:31:42.916','APPLE',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
2,'2017-06-25 17:31:42.937','MICROSOFT',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
3,'2017-06-25 17:31:42.949','ASUS',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
4,'2017-06-25 17:31:42.960','HP',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
5,'2017-06-25 17:31:42.972','DELL',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
6,'2017-06-25 17:31:42.982','LENOVO',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
7,'2017-06-25 17:31:42.993','ACER',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
8,'2017-06-25 17:31:43.004','SAMSUNG',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
9,'2017-06-25 17:31:43.023','LG',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
10,'2017-06-25 17:31:43.036','CISCO',1);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
11,'2017-06-25 17:31:43.052','Windows',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
12,'2017-06-25 17:31:43.070','Mac OS',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
13,'2017-06-25 17:31:43.084','Ubuntu',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
14,'2017-06-25 17:31:43.102','Cent OS',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
15,'2017-06-25 17:31:43.116','Fedora',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
16,'2017-06-25 17:31:43.130','Red Hat',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
17,'2017-06-25 17:31:43.144','Debian',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
18,'2017-06-25 17:31:43.156','SUSE',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
19,'2017-06-25 17:31:43.169','Core OS',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
20,'2017-06-25 17:31:43.181','Amazon Linux',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
21,'2017-06-25 17:31:43.192','Kubernetes',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
22,'2017-06-25 17:31:43.202','Docker',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
23,'2017-06-25 17:31:43.214','iOS',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
24,'2017-06-25 17:31:43.229','Android',2);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
25,'2017-06-25 17:31:43.242','Windows',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
26,'2017-06-25 17:31:43.255','Mac OS',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
27,'2017-06-25 17:31:43.271','Ubuntu',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
28,'2017-06-25 17:31:43.285','Cent OS',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
29,'2017-06-25 17:31:43.298','Fedora',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
30,'2017-06-25 17:31:43.312','Red Hat',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
31,'2017-06-25 17:31:43.324','Debian',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
32,'2017-06-25 17:31:43.336','SUSE',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
33,'2017-06-25 17:31:43.347','Core OS',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
34,'2017-06-25 17:31:43.361','Amazon Linux',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
35,'2017-06-25 17:31:43.375','Kubernetes',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
36,'2017-06-25 17:31:43.387','Docker',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
37,'2017-06-25 17:31:43.399','iOS',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
38,'2017-06-25 17:31:43.410','Android',3);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
39,'2017-06-26 20:59:36.255','MySql',7);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
40,'2017-06-26 20:59:36.364','PostgreSQL',7);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
41,'2017-06-26 20:59:36.385','WMI',7);
INSERT INTO public.meta_infra_vendor (id,create_date,"name",type_id) VALUES (
42,'2017-06-26 20:59:36.414','SNMP_V2',7);
INSERT INTO public.meta_crawler (id,create_date,description,"name") VALUES (
1,'2017-06-25 17:00:43.869','WMI','WMI_CRAWLER');
INSERT INTO public.meta_crawler (id,create_date,description,"name") VALUES (
2,'2017-06-25 17:00:43.919','SNMPV2','SNMP_V2_CRAWLER');
INSERT INTO public.meta_crawler (id,create_date,description,"name") VALUES (
3,'2017-06-25 17:00:43.941','SNMPV3','SNMP_V3_CRAWLER');
INSERT INTO public.meta_crawler (id,create_date,description,"name") VALUES (
4,'2017-06-25 17:00:43.969','MYSQL','MYSQL_CRAWLER');
INSERT INTO public.meta_input_type (id,create_date,description,"name") VALUES (
1,'2017-06-25 17:00:53.861','TEXT','TEXT_TYPE');
INSERT INTO public.meta_input_type (id,create_date,description,"name") VALUES (
2,'2017-06-25 17:00:53.893','PASSWORD','PASSWORD_TYPE');
INSERT INTO public.meta_input_type (id,create_date,description,"name") VALUES (
3,'2017-06-25 17:00:53.901','NUMBER','NUMBER_TYPE');
INSERT INTO public.meta_input_type (id,create_date,description,"name") VALUES (
4,'2017-06-25 17:00:53.910','BOOLEAN','BOOLEAN_TYPE');
INSERT INTO public.meta_input_type (id,create_date,description,"name") VALUES (
5,'2017-06-25 17:00:53.920','SELECT','SELECT_TYPE');
INSERT INTO public.meta_crawler_input_item (id,create_date,default_value,description,key_name,key_value,"name",pattern,required,crawler_id,type_id) VALUES (
1,'2017-06-25 17:01:01.961','Loafle','Windows Account ID',NULL,NULL,'ID','',true,1,1);
INSERT INTO public.meta_crawler_input_item (id,create_date,default_value,description,key_name,key_value,"name",pattern,required,crawler_id,type_id) VALUES (
2,'2017-06-25 17:01:02.008','','Windows Account PW',NULL,NULL,'PassWord','',true,1,2);
INSERT INTO public.meta_crawler_input_item (id,create_date,default_value,description,key_name,key_value,"name",pattern,required,crawler_id,type_id) VALUES (
3,'2017-06-25 17:01:02.023','public','SNMP V2 Community',NULL,NULL,'Community','',true,2,1);
INSERT INTO public.meta_crawler_input_item (id,create_date,default_value,description,key_name,key_value,"name",pattern,required,crawler_id,type_id) VALUES (
4,'2017-06-25 17:01:02.046','mysqldb','MYSQL DB Name',NULL,NULL,'DB Name','',true,4,1);
INSERT INTO public.meta_crawler_input_item (id,create_date,default_value,description,key_name,key_value,"name",pattern,required,crawler_id,type_id) VALUES (
5,'2017-06-25 17:01:02.067','Loafle','MYSQL Account ID',NULL,NULL,'ID','',true,4,1);
INSERT INTO public.meta_crawler_input_item (id,create_date,default_value,description,key_name,key_value,"name",pattern,required,crawler_id,type_id) VALUES (
6,'2017-06-25 17:01:02.078','','MYSQL Account PW',NULL,NULL,'PassWord','',true,4,2);
INSERT INTO public.meta_probe_architecture (id,architecture,create_date) VALUES (
1,'x86-64bit','2017-06-25 16:48:15.317');
INSERT INTO public.meta_probe_architecture (id,architecture,create_date) VALUES (
2,NULL,'2017-06-25 16:48:15.350');
INSERT INTO public.meta_probe_os (id,create_date,"name") VALUES (
1,'2017-06-25 16:48:28.617','Windows');
INSERT INTO public.meta_probe_os (id,create_date,"name") VALUES (
2,'2017-06-25 16:48:28.683','Debian');
INSERT INTO public.meta_probe_os (id,create_date,"name") VALUES (
3,'2017-06-25 16:48:28.699','Ubuntu');
INSERT INTO public.meta_probe_os (id,create_date,"name") VALUES (
4,'2017-06-25 16:48:28.708','Fedora');
INSERT INTO public.meta_probe_version (id,create_date,"version") VALUES (
1,'2017-06-25 16:48:00.520','1.0.0');
INSERT INTO public.meta_probe_version (id,create_date,"version") VALUES (
2,'2017-06-25 16:48:00.558','1.1.0');
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
1,'2017-06-25 16:59:59.194',1,1,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
2,'2017-06-25 16:59:59.216',1,2,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
3,'2017-06-25 16:59:59.255',1,3,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
4,'2017-06-25 16:59:59.268',1,4,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
5,'2017-06-25 16:59:59.279',2,1,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
6,'2017-06-25 16:59:59.307',2,2,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
7,'2017-06-25 16:59:59.317',2,3,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
8,'2017-06-25 16:59:59.330',2,4,1);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
9,'2017-06-25 16:59:59.363',1,1,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
10,'2017-06-25 16:59:59.395',1,2,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
11,'2017-06-25 16:59:59.416',1,3,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
12,'2017-06-25 16:59:59.446',1,4,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
13,'2017-06-25 16:59:59.468',2,1,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
14,'2017-06-25 16:59:59.484',2,2,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
15,'2017-06-25 16:59:59.507',2,3,2);
INSERT INTO public.meta_probe_package (id,create_date,architecture_id,os_id,version_id) VALUES (
16,'2017-06-25 16:59:59.522',2,4,2);
INSERT INTO public.meta_probe_status (id,"name") VALUES (
1,'INITIAL');
INSERT INTO public.meta_probe_status (id,"name") VALUES (
2,'NORMAL');
INSERT INTO public.meta_noauth_probe_status (id,"name") VALUES (
1,'ACCEPT');
INSERT INTO public.meta_noauth_probe_status (id,"name") VALUES (
2,'DENY');
INSERT INTO public.meta_noauth_probe_status (id,"name") VALUES (
3,'PROCESS');
INSERT INTO public.meta_probe_task_type (id,create_date,description,"name") VALUES (
1,'2017-06-26 15:58:02.397','DISCOVERY START','DISCOVERY');
INSERT INTO public.meta_sensor_status (id,"name") VALUES (
1,'RUNNING');
INSERT INTO public.meta_sensor_status (id,"name") VALUES (
2,'STOPPED');
INSERT INTO public.meta_sensor_item_type (id,create_date,description,"name") VALUES (
1,'2017-06-26 19:49:39.690','CPU blah blah blah','CPU');
INSERT INTO public.meta_sensor_item_type (id,create_date,description,"name") VALUES (
2,'2017-06-26 19:49:39.811','MEMORY blah blah blah','MEMORY');
INSERT INTO public.meta_sensor_item_type (id,create_date,description,"name") VALUES (
3,'2017-06-26 19:49:39.824','DISK blah blah blah','DISK');
INSERT INTO public.meta_sensor_item (id,create_date,"key","name",type_id) VALUES (
1,'2017-06-26 20:10:08.269','cpu.usage','CPU USAGE',1);
INSERT INTO public.meta_sensor_item (id,create_date,"key","name",type_id) VALUES (
2,'2017-06-26 20:10:08.361','cpu.free','CPU FREE',1);
INSERT INTO public.meta_sensor_item (id,create_date,"key","name",type_id) VALUES (
3,'2017-06-26 20:10:08.376','mem.usage','MEMORY USAGE',2);
INSERT INTO public.meta_sensor_item (id,create_date,"key","name",type_id) VALUES (
4,'2017-06-26 20:10:08.394','mem.free','MEMORY FREE',2);
--
--
--
--
--
INSERT INTO public."member" (id,company_name,create_date,email,"name",phone,pw,pw_salt,status_id) VALUES (
1,'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','qwer5795','abcdabcdabcdabcd',2);
INSERT INTO public."member" (id,company_name,create_date,email,"name",phone,pw,pw_salt,status_id) VALUES (
2,'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','qwer5795','abcdabcdabcdabcd',1);
INSERT INTO public.email_auth (id,auth_confirm_date,create_date,email_auth_key,member_id) VALUES (
1,NULL,'2017-06-26 15:28:48.895','dbseogns1234',1);
INSERT INTO public."domain" (id,create_date,"name") VALUES (
1,'2017-06-26 11:25:44.866','overFlow''s domain');
INSERT INTO public.domain_member (id,create_date,domain_id,member_id) VALUES (
1,'2017-06-26 11:27:43.023',1,1);
INSERT INTO public.api_key (id,api_key,create_date,domain_id) VALUES (
1,'52abd6fd57e511e7ac52080027658d13','2017-06-26 13:02:28.347',1);
INSERT INTO public.noauth_probe (id,api_key,create_date,host_name,ip_address,mac_address,temp_probe_key,domain_id,probe_id,status) VALUES (
1,'52abd6fd57e511e7ac52080027658d13','2017-06-26 12:43:46.877','snoop',3232235980,8796753988883,'1cf2555c57d511e79714080027658d13',1,NULL,3);
INSERT INTO public.probe (id,create_date,description,encryption_key,last_polling_date,next_polling_date,probe_key,domain_id,status) VALUES (
1,'2017-06-26 12:44:59.813','snoop probe','9c8d41ab57de11e7a2c9080027658d13',NULL,NULL,'a1e1710557de11e78799080027658d13',1,1);
INSERT INTO public.infra_machine (id,create_date,meta,probe_id) VALUES (
0,'2017-06-26 12:12:11.698',NULL,1);
INSERT INTO public.infra (id,child_id,create_date,type_id) VALUES (
1,0,'2017-06-26 12:12:11.809',1);
INSERT INTO public.target (id,create_date,infra_id,probe_id) VALUES (
1,'2017-06-26 12:37:22.854',1,1);
INSERT INTO public.sensor (id,crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES (
1,NULL,'2017-06-26 20:19:07.009','My sensor',1,1,1);
INSERT INTO public.sensor (id,crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES (
2,NULL,'2017-06-26 20:19:07.074','My sensor',1,1,1);
INSERT INTO public.sensor_item (id,create_date,item_id,sensor_id) VALUES (
1,'2017-06-26 20:21:16.626',1,1);
INSERT INTO public.sensor_item (id,create_date,item_id,sensor_id) VALUES (
2,'2017-06-26 20:21:50.988',2,2);

View File

@ -0,0 +1,14 @@
package com.loafle.overflow;
import static org.junit.Assert.*;
import org.junit.Ignore;
import org.junit.Test;
@Ignore
public class OFMainTest {
@Test
public void testSum() {
fail("Not yet implemented");
}
}

Some files were not shown because too many files have changed in this diff Show More