project shared

This commit is contained in:
geek 2017-11-07 19:36:34 +09:00
commit d12ffc37f1
113 changed files with 4897 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/

97
pom.xml Normal file
View File

@ -0,0 +1,97 @@
<?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>commons_java</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>com.loafle.overflow.commons_java</name>
<properties>
<grpc.version>1.2.0</grpc.version>
<hibernate.version>5.2.10.Final</hibernate.version>
<jackson.mapper.version>1.9.13</jackson.mapper.version>
</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>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.mapper.version}</version>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>cz.habarta.typescript-generator</groupId>
<artifactId>typescript-generator-maven-plugin</artifactId>
<version>1.25.322</version>
<executions>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
<configuration>
<jsonLibrary>jackson2</jsonLibrary>
<classPatterns>
<classPattern>com.loafle.overflow.module.**.model.*</classPattern>
</classPatterns>
<outputKind>module</outputKind>
<outputFileType>implementationFile</outputFileType>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

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

View File

@ -0,0 +1,78 @@
package com.loafle.overflow.module.apikey.model;
import com.loafle.overflow.module.domain.model.Domain;
import javax.persistence.*;
import java.util.Date;
@Entity
@Table(name = "API_KEY", schema = "public")
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, unique = true,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,7 @@
package com.loafle.overflow.module.apikey.service;
/**
* Created by geek on 17. 11. 7.
*/
public interface ApiKeyService {
}

View File

@ -0,0 +1,72 @@
package com.loafle.overflow.module.auth.model;
import com.loafle.overflow.module.meta.model.MetaCrawler;
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 geek on 17. 11. 7.
*/
@Entity
@Table(name = "AUTH_CRAWLER", schema = "public")
public class AuthCrawler {
private long id;
private MetaCrawler crawler;
private Target target;
private String authJson;
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
@JoinColumn(name = "TARGET_ID", nullable = false)
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
@Column(name = "AUTH_JSON", nullable = false)
public String getAuthJson() {
return authJson;
}
public void setAuthJson(String authJson) {
this.authJson = authJson;
}
@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,7 @@
package com.loafle.overflow.module.auth.service;
/**
* Created by geek on 17. 11. 7.
*/
public interface AuthCrawlerService {
}

View File

@ -0,0 +1,43 @@
package com.loafle.overflow.module.commons.model;
/**
* Created by geek on 17. 11. 7.
*/
public class PageParams {
private int pageNo;
private int countPerPage;
private String sortCol;
private String sortDirection;
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getCountPerPage() {
return countPerPage;
}
public void setCountPerPage(int countPerPage) {
this.countPerPage = countPerPage;
}
public String getSortCol() {
return sortCol;
}
public void setSortCol(String sortCol) {
this.sortCol = sortCol;
}
public String getSortDirection() {
return sortDirection;
}
public void setSortDirection(String sortDirection) {
this.sortDirection = sortDirection;
}
}

View File

@ -0,0 +1,74 @@
package com.loafle.overflow.module.commons.model;
import java.util.ArrayList;
import java.util.List;
/**
* Created by geek on 17. 11. 7.
*/
public class PublishMessage {
private List<String> targets;
private PublishMessageBody message;
public void setTargets(List<String> targets) {
this.targets = targets;
}
public void addTarget(String target) {
if (null == targets) {
targets = new ArrayList<>();
}
targets.add(target);
}
public List<String> getTargets() {
return targets;
}
public void setMessage(PublishMessageBody message) {
this.message = message;
}
public PublishMessageBody getMessage() {
return message;
}
public static class PublishMessageBody {
private String method;
private List<String> params;
public PublishMessageBody() {
}
public PublishMessageBody(String method) {
this.method = method;
}
public PublishMessageBody(String method, List<String> params) {
this(method);
this.params = params;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public List<String> getParams() {
return params;
}
public void setParams(List<String> params) {
this.params = params;
}
public void addParams(String param) {
if (null == this.params) {
this.params = new ArrayList<>();
}
this.params.add(param);
}
}
}

View File

@ -0,0 +1,15 @@
package com.loafle.overflow.module.commons.model;
import io.grpc.Context;
import io.grpc.Metadata;
import static io.grpc.Metadata.ASCII_STRING_MARSHALLER;
public class SessionMetadata {
public static final Context.Key<String> CTX_EMAIL_KEY = Context.key("email");
public static final Metadata.Key<String> METADATA_EMAIL_KEY = Metadata.Key.of("email", ASCII_STRING_MARSHALLER);
public static String getEmail() {
return CTX_EMAIL_KEY.get();
}
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.commons.service;
/**
* Created by geek on 17. 11. 7.
*/
public interface MessagePublisher {
}

View File

@ -0,0 +1,63 @@
package com.loafle.overflow.module.discovery.model;
import java.util.List;
/**
* Created by geek on 17. 11. 7.
*/
public class DiscoeveryStartInfo {
String startIp;
String endIP;
String excludeIp;
String startPort;
String endPort;
List<String> services;
public String getStartIp() {
return startIp;
}
public void setStartIp(String startIp) {
this.startIp = startIp;
}
public String getEndIP() {
return endIP;
}
public void setEndIP(String endIP) {
this.endIP = endIP;
}
public String getExcludeIp() {
return excludeIp;
}
public void setExcludeIp(String excludeIp) {
this.excludeIp = excludeIp;
}
public String getStartPort() {
return startPort;
}
public void setStartPort(String startPort) {
this.startPort = startPort;
}
public String getEndPort() {
return endPort;
}
public void setEndPort(String endPort) {
this.endPort = endPort;
}
public List<String> getServices() {
return services;
}
public void setServices(List<String> services) {
this.services = services;
}
}

View File

@ -0,0 +1,100 @@
package com.loafle.overflow.module.discovery.model;
import java.util.Date;
import java.util.List;
/**
* Created by root on 17. 6. 4.
*/
public class Host {
private long id;
private long ip;
private long mac;
private Date createDate;
private Date updateDate;
private String os;
private boolean target;
private List<Port> ports;
public List<Port> getPorts() {
return ports;
}
public void setPorts(List<Port> ports) {
this.ports = ports;
}
public Host(){}
public Host(long ip, long mac){
this.ip = ip;
this.mac = mac;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getIp() {
return ip;
}
public void setIp(long ip) {
this.ip = ip;
}
public long getMac() {
return mac;
}
public void setMac(long mac) {
this.mac = mac;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getOs() {
return os;
}
public void setOs(String os) {
this.os = os;
}
public boolean isTarget() {
return target;
}
public void setTarget(boolean target) {
this.target = target;
}
}

View File

@ -0,0 +1,122 @@
package com.loafle.overflow.module.discovery.model;
/**
* Created by snoop on 17. 6. 27.
*/
import com.loafle.overflow.module.discovery.type.PortType;
import java.util.Date;
import java.util.List;
/**
* Created by root on 17. 6. 4.
*/
public class Port {
private long id;
private Host host;
public Host getHost() {
return host;
}
public void setHost(Host host) {
this.host = host;
}
private PortType portType;
private int portNumber;
private List<Service> services;
public List<Service> getServices() {
return services;
}
public void setServices(List<Service> services) {
this.services = services;
}
private Date createDate;
private Date updateDate;
public Port() {}
public Port(PortType type, int portNumber) {
this.portType = type;
this.portNumber = portNumber;
}
public Port(Host host, PortType type, int portNumber) {
this.host = host;
this.portType = type;
this.portNumber = portNumber;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public PortType getPortType() {
return portType;
}
public void setPortType(PortType portType) {
this.portType = portType;
}
public int getPortNumber() {
return portNumber;
}
public void setPortNumber(int portNumber) {
this.portNumber = portNumber;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public void mappingChildren(Host discoveryHost) {
this.setHost(discoveryHost);
List<Service> discoveryServices = this.getServices();
if (discoveryServices != null) {
for (int z = 0 ; z < discoveryServices.size() ; ++z) {
discoveryServices.get(z).setPort(this);
}
}
}
}

View File

@ -0,0 +1,97 @@
package com.loafle.overflow.module.discovery.model;
import com.loafle.overflow.module.discovery.type.PortType;
import java.util.Date;
/**
* Created by root on 17. 6. 4.
*/
public class Service {
private long id;
private Port port;
public Port getPort() {
return port;
}
public void setPort(Port port) {
this.port = port;
}
private PortType portType;
private String serviceName;
private Date createDate;
private Date updateDate;
private boolean target;
public Service() {}
public Service(Port port, PortType t, String serviceName) {
this.port = port;
this.portType = t;
this.serviceName = serviceName;
}
public PortType getPortType() {
return portType;
}
public void setPortType(PortType portType) {
this.portType = portType;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public boolean isTarget() {
return target;
}
public void setTarget(boolean target) {
this.target = target;
}
}

View File

@ -0,0 +1,70 @@
package com.loafle.overflow.module.discovery.model;
/**
* Created by snoop on 17. 10. 31.
*/
public class Zone {
private long id;
private String network;
private String ip;
private String iface;
private String mac;
private long firstScanRange;
private long lastScanRange;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getNetwork() {
return network;
}
public void setNetwork(String network) {
this.network = network;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getIface() {
return iface;
}
public void setIface(String iface) {
this.iface = iface;
}
public String getMac() {
return mac;
}
public void setMac(String mac) {
this.mac = mac;
}
public long getFirstScanRange() {
return firstScanRange;
}
public void setFirstScanRange(long firstScanRange) {
this.firstScanRange = firstScanRange;
}
public long getLastScanRange() {
return lastScanRange;
}
public void setLastScanRange(long lastScanRange) {
this.lastScanRange = lastScanRange;
}
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.discovery.service;
/**
* Created by snoop on 17. 9. 28.
*/
public interface DiscoveryService {
}

View File

@ -0,0 +1,18 @@
package com.loafle.overflow.module.discovery.type;
/**
* Created by snoop on 17. 6. 27.
*/
public enum PortType {
TCP("TCP"),
UDP("UDP"),
TLS("TLS");
private String stringValue;
PortType(String string) {stringValue = string;}
@Override
public String toString() {
return stringValue;
}
}

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")
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")
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,8 @@
package com.loafle.overflow.module.domain.service;
/**
* Created by snoop on 17. 6. 28.
*/
public interface DomainMemberService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.domain.service;
/**
* Created by snoop on 17. 6. 28.
*/
public interface DomainService {
}

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.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity
@Table(name = "EMAIL_AUTH", schema = "public")
public class EmailAuth {
private long id;
private String emailAuthKey;
private Date createDate;
private Date 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 Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Basic
@Column(name = "AUTH_CONFIRM_DATE", nullable = true, insertable = true, updatable = true)
public Date getAuthConfirmDate() {
return authConfirmDate;
}
public void setAuthConfirmDate(Date 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,8 @@
package com.loafle.overflow.module.email.service;
/**
* Created by geek on 17. 6. 28.
*/
public interface EmailAuthService {
}

View File

@ -0,0 +1,116 @@
package com.loafle.overflow.module.history.model;
import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.member.model.Member;
import com.loafle.overflow.module.meta.model.MetaHistoryType;
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 = "HISTORY", schema = "public")
public class History {
private long id;
private Date createDate;
private MetaHistoryType type;
private String message;
private Probe probe;
private Member member;
private Domain domain;
//private MetaResultType resultType; // i'm not sure this is necessary
@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 = "TYPE_ID", nullable = false)
public MetaHistoryType getType() {
return type;
}
public void setType(MetaHistoryType type) {
this.type = type;
}
@Column(name = "MESSAGE", nullable = false, length = 255)
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@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;
}
@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,4 @@
package com.loafle.overflow.module.history.service;
public interface HistoryService {
}

View File

@ -0,0 +1,183 @@
package com.loafle.overflow.module.infra.model;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.target.model.Target;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA")
@Table(name = "INFRA", schema = "public")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "INFRA_TYPE", discriminatorType = DiscriminatorType.INTEGER)
public abstract class Infra {
private long id;
private MetaInfraType infraType;
// private long childId;
private Date createDate;
private Probe probe;
private Target target;
// private InfraChild infraChild;
// private InfraHost infraHost;
// private InfraMachine infraMachine;
// private InfraOS infraOS;
/*
private long id;
private MetaInfraType infraType;
private long childId;
private Date createDate;
private Probe probeId;
private Target targetId;
*/
// @ManyToOne
// @JoinColumn(name = "CHILD_ID", nullable = false, insertable = false, updatable = false)
// public InfraHost getInfraChild() {
// return infraChild;
// }
//
// public void setInfraChild(InfraChild infraChild) {
// this.infraChild = infraChild;
// }
// @OneToOne
// @JoinColumn(name = "CHILD_ID")
// public InfraChild getInfraChild() {
// return infraChild;
// }
//
// public void setInfraChild(InfraChild infraChild) {
// this.infraChild = infraChild;
// }
// @ManyToOne
// @JoinColumn(name = "HOST_ID")
// public InfraHost getInfraHost() {
// return infraHost;
// }
//
// public void setInfraHost(InfraHost infraHost) {
// this.infraHost = infraHost;
// }
// @ManyToOne
// @JoinColumn(name = "MACHINE_ID")
// public InfraMachine getInfraMachine() {
// return infraMachine;
// }
//
// public void setInfraMachine(InfraMachine infraMachine) {
// this.infraMachine = infraMachine;
// }
//
// @ManyToOne
// @JoinColumn(name = "OS_ID")
// public InfraOS getInfraOS() {
// return infraOS;
// }
//
// public void setInfraOS(InfraOS infraOS) {
// this.infraOS = infraOS;
// }
@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 getInfraType() {
return infraType;
}
public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType;
}
// @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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@ManyToOne
@JoinColumn(name = "PROBE_ID", nullable = true)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@ManyToOne
@JoinColumn(name = "TARGET_ID", nullable = true)
public Target getTarget() {
return target;
}
public void setTarget(Target target) {
this.target = target;
}
// public static Infra CreateInfraByType(long id, Class c) {
//
// Infra infra = new Infra();
//// infra.setChildId(id);
//
// MetaInfraType infraType = new MetaInfraType();
// if(c == InfraMachine.class) {
// infraType.setId(1);
// }
// else if(c == InfraHost.class) {
// infraType.setId(2);
// }
// else if(c == InfraOS.class) {
// infraType.setId(3);
// }
// else if(c == InfraOSApplication.class) {
// infraType.setId(4);
// }
// else if(c == InfraOSDaemon.class) {
// infraType.setId(5);
// }
// else if(c == InfraOSPort.class) {
// infraType.setId(6);
// }
// else if(c == InfraService.class) {
// infraType.setId(7);
// }
//
// infra.setInfraType(infraType);
//
// return infra;
// }
}

View File

@ -0,0 +1,69 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA_HOST")
@Table(name = "INFRA_HOST", schema = "public")
@DiscriminatorValue("2")
public class InfraHost extends Infra {
// private long id;
private InfraOS os;
private long ip;
private long mac;
private Date createDate;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = true)
public InfraOS getOs() {
return os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Basic
@Column(name = "IP", nullable = true)
public long getIp() {
return ip;
}
public void setIp(long ip) {
this.ip = ip;
}
@Basic
@Column(name = "MAC", nullable = true)
public long getMac() {
return mac;
}
public void setMac(long mac) {
this.mac = mac;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = true, 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,55 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA_MACHINE")
@Table(name = "INFRA_MACHINE", schema = "public")
@DiscriminatorValue("1")
public class InfraMachine extends Infra {
// private long id;
private String meta;
private Date createDate;
/*
private long id;
private String meta;
private Date createDate;
*/
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@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", insertable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,72 @@
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(name = "INFRA_OS")
@Table(name = "INFRA_OS", schema = "public")
@DiscriminatorValue("3")
public class InfraOS extends Infra {
// private long id;
private InfraMachine machine;
private String meta;
private Date createDate;
private MetaInfraVendor vendor;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "MACHINE_ID", nullable = true)
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 = true, 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 = "VENDOR_ID", nullable = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
}

View File

@ -0,0 +1,58 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA_OS_APPLICATION")
@Table(name = "INFRA_OS_APPLICATION", schema = "public")
@DiscriminatorValue("4")
public class InfraOSApplication extends Infra {
// private long id;
private InfraOS os;
private String name;
private Date createDate;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = true)
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 = true, 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,57 @@
package com.loafle.overflow.module.infra.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by root on 17. 6. 22.
*/
@Entity(name = "INFRA_OS_DAEMON")
@Table(name = "INFRA_OS_DAEMON", schema = "public")
@DiscriminatorValue("5")
public class InfraOSDaemon extends Infra {
// private long id;
private InfraOS os;
private String name;
private Date createDate;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = true)
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 = true, 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,94 @@
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(name = "INFRA_OS_PORT")
@Table(name = "INFRA_OS_PORT", schema = "public")
@DiscriminatorValue("6")
public class InfraOSPort extends Infra {
// private long id;
private InfraOS os;
private Date createDate;
private Integer port;
private String portType;
private MetaInfraVendor vendor;
private boolean tlsType;
//
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "OS_ID", nullable = true)
public InfraOS getOs() {
return this.os;
}
public void setOs(InfraOS os) {
this.os = os;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = true, 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 = "PORT", nullable = true)
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
@Basic
@Column(name = "PORT_TYPE", nullable = true)
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 = true)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

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(name = "INFRA_SERVICE")
@Table(name = "INFRA_SERVICE", schema = "public")
@DiscriminatorValue("7")
public class InfraService extends Infra {
// private long id;
private InfraHost host;
private String portType;
private Integer port;
private MetaInfraVendor vendor;
private Date createDate;
private boolean tlsType;
// @Id
// @GeneratedValue(strategy= GenerationType.IDENTITY)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
@ManyToOne
@JoinColumn(name = "HOST_ID", nullable = true)
public InfraHost getHost() {
return host;
}
public void setHost(InfraHost host) {
this.host = host;
}
@Basic
@Column(name = "PORT_TYPE", nullable = true)
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 = true)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATE_DATE", nullable = true, 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 = "TLS_TYPE", nullable = true)
public boolean isTlsType() {
return tlsType;
}
public void setTlsType(boolean tlsType) {
this.tlsType = tlsType;
}
}

View File

@ -0,0 +1,9 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraHostService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraMachineService {
}

View File

@ -0,0 +1,9 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraOSApplicationService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraOSDaemonService {
}

View File

@ -0,0 +1,9 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraOSPortService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraOSService {
}

View File

@ -0,0 +1,9 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.infra.service;
/**
* Created by insanity on 17. 6. 28.
*/
public interface InfraServiceService {
}

View File

@ -0,0 +1,114 @@
package com.loafle.overflow.module.member.model;
import com.loafle.overflow.module.meta.model.MetaMemberStatus;
import org.codehaus.jackson.annotate.JsonIgnore;
import javax.persistence.*;
import java.util.Date;
/**
* Created by geek on 17. 11. 7.
*/
@Entity
@Table(name = "MEMBER", schema = "public")
public class Member {
private long id;
private String email;
private String pw;
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
@JsonIgnore
@Column(name = "PW", nullable = true, length = 64)
public String getPw() {
return pw;
}
public void setPw(String pw) {
this.pw = pw;
}
@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,7 @@
package com.loafle.overflow.module.member.service;
/**
* Created by geek on 17. 11. 7.
*/
public interface MemberService {
}

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")
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")
public class MetaCrawlerInputItem {
private int id;
private MetaInputType inputType;
private MetaCrawler crawler;
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 getInputType() {
return inputType;
}
public void setInputType(MetaInputType inputType) {
this.inputType = inputType;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@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,53 @@
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_HISTORY_TYPE", schema = "public")
public class MetaHistoryType {
private int id;
private String name;
private Date createDate;
public MetaHistoryType() {
}
public MetaHistoryType(int id) {
this.id = id;
}
@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;
}
}

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")
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,106 @@
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")
public class MetaInfraVendor {
private int id;
private String name;
private Date createDate;
private MetaInfraType infraType;
@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;
}
@ManyToOne
@JoinColumn(name = "TYPE_ID", nullable=false)
public MetaInfraType getInfraType() {
return infraType;
}
public void setInfraType(MetaInfraType infraType) {
this.infraType = infraType;
}
public static MetaInfraVendor CreateInfraVendorByOS(String osName) {
MetaInfraVendor vendor = new MetaInfraVendor();
if(osName == null || osName.length() <= 0) {
vendor.setId(28); // FIXME: Unknown
return vendor;
}
if(osName.equals("Windows")) {
vendor.setId(26);
}
else if(osName.equals("Linux")) {
vendor.setId(28); // ubuntu
} else {
vendor.setId(28); // FIXME: Unknown
}
return vendor;
}
public static MetaInfraVendor CreateInfraVendorByPort(int portNumber) {
return null;
}
public static MetaInfraVendor CreateInfraVendorByService(String serviceName) {
MetaInfraVendor vendor = new MetaInfraVendor();
if(serviceName.equals("mysql")) {
vendor.setId(39);
}
else if(serviceName.equals("portgresql")) {
vendor.setId(39);
}
else if(serviceName.equals("wmi")) {
vendor.setId(39);
}
else if(serviceName.equals("snmpv2")) {
vendor.setId(39);
}
else {
vendor.setId(43); // unknown
}
return vendor;
}
}

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")
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")
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")
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")
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")
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")
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")
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")
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")
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")
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,80 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by insanity on 17. 9. 20.
*/
@Entity
@Table(name = "META_SENSOR_DISPLAY_ITEM", schema = "public")
public class MetaSensorDisplayItem {
private long id;
private String name;
private MetaCrawler crawler;
private MetaSensorItemUnit unit;
private Date createDate;
private MetaSensorItemType itemType;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Column(name = "NAME", nullable = false, length = 50)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@ManyToOne
@JoinColumn(name = "UNIT_ID", nullable = true)
public MetaSensorItemUnit getUnit() {
return unit;
}
public void setUnit(MetaSensorItemUnit unit) {
this.unit = unit;
}
@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 = "TYPE_ID", nullable = false)
public MetaSensorItemType getItemType() {
return itemType;
}
public void setItemType(MetaSensorItemType itemType) {
this.itemType = itemType;
}
}

View File

@ -0,0 +1,74 @@
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")
public class MetaSensorItem {
private int id;
private MetaSensorItemType itemType;
private String key;
private String name;
private Date createDate;
@Id
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 getItemType() {
return itemType;
}
public void setItemType(MetaSensorItemType itemType) {
this.itemType = itemType;
}
@Column(name = "KEY", nullable = true, length = 100)
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
@Column(name = "NAME", nullable = true, length = 100)
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,97 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by snoop on 17. 8. 29.
*/
@Entity
@Table(name = "META_SENSOR_ITEM_KEY", schema = "public")
public class MetaSensorItemKey {
private long id;
private MetaSensorItem item;
private String key;
private String froms;
private String option;
private MetaCrawler crawler;
private Date createDate;
private MetaSensorItemUnit unit;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getItem() {
return item;
}
public void setItem(MetaSensorItem item) {
this.item = item;
}
@Column(name = "KEY", nullable = false, length = 100)
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
@Column(name = "FROMS", nullable = false, length = 100)
public String getFroms() {
return froms;
}
public void setFroms(String froms) {
this.froms = froms;
}
@Column(name = "OPTION_JSON", nullable = true)
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
@ManyToOne
@JoinColumn(name = "CRAWLER_ID", nullable = false)
public MetaCrawler getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@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 = "UNIT_ID", nullable = true)
public MetaSensorItemUnit getUnit() {
return unit;
}
public void setUnit(MetaSensorItemUnit unit) {
this.unit = unit;
}
}

View File

@ -0,0 +1,63 @@
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")
public class MetaSensorItemType {
private short id;
private String name;
private String description;
private Date createDate;
public MetaSensorItemType() {
}
public MetaSensorItemType(short id) {
this.id = id;
}
@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,53 @@
package com.loafle.overflow.module.meta.model;
import javax.persistence.*;
import java.util.Date;
/**
* Created by insanity on 17. 9. 19.
*/
@Entity
@Table(name = "META_SENSOR_ITEM_UNIT", schema = "public")
public class MetaSensorItemUnit {
private short id;
private String unit;
private Date createDate;
private String mark;
@Id
public short getId() {
return id;
}
public void setId(short id) {
this.id = id;
}
@Column(name = "UNIT", nullable = false)
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
@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 = "MARK", nullable = false)
public String getMark() {
return mark;
}
public void setMark(String mark) {
this.mark = mark;
}
}

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")
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")
public class MetaVendorCrawler {
private int id;
private MetaCrawler crawler;
private MetaInfraVendor infraVendor;
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 getCrawler() {
return crawler;
}
public void setCrawler(MetaCrawler crawler) {
this.crawler = crawler;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getInfraVendor() {
return infraVendor;
}
public void setInfraVendor(MetaInfraVendor infraVendor) {
this.infraVendor = infraVendor;
}
// @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, 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,91 @@
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")
public class MetaVendorCrawlerSensorItem {
private long id;
private String interval;
private String warnCondition;
private Date createDate;
private MetaSensorItem sensorItem;
private MetaInfraVendor vendor;
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;
}
@ManyToOne
@JoinColumn(name = "ITEM_ID", nullable = false)
public MetaSensorItem getSensorItem() {
return sensorItem;
}
public void setSensorItem(MetaSensorItem sensorItem) {
this.sensorItem = sensorItem;
}
@ManyToOne
@JoinColumn(name = "VENDOR_ID", nullable = false)
public MetaInfraVendor getVendor() {
return vendor;
}
public void setVendor(MetaInfraVendor vendor) {
this.vendor = vendor;
}
@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,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaCrawlerInputItemService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaCrawlerService {
}

View File

@ -0,0 +1,9 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaHistoryTypeService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaInfraTypeService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaInfraVendorService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaInputTypeService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaMemberStatusService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaNoAuthProbeStatusService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaProbeArchitectureService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaProbeOsService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaProbePackageService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaProbeStatusService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaProbeTaskTypeService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaProbeVersionService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by insanity on 17. 9. 20.
*/
public interface MetaSensorDisplayItemService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 8. 29.
*/
public interface MetaSensorItemKeyService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaSensorItemService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaSensorItemTypeService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by insanity on 17. 9. 20.
*/
public interface MetaSensorItemUnitService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaSensorStatusService {
}

View File

@ -0,0 +1,8 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaVendorCrawlerSensorItemService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.meta.service;
/**
* Created by snoop on 17. 7. 27.
*/
public interface MetaVendorCrawlerService {
}

View File

@ -0,0 +1,44 @@
package com.loafle.overflow.module.meta.type;
/**
* Created by snoop on 17. 9. 8.
*/
public enum MetaCrawlerEnum {
ACTIVEDIRECTORY_CRAWLER((short)1),
CASSANDRA_CRAWLER((short)2),
DHCP_CRAWLER((short)3),
DNS_CRAWLER((short)4),
FTP_CRAWLER((short)5),
HTTP_CRAWLER((short)6),
IMAP_CRAWLER((short)7),
LDAP_CRAWLER((short)8),
MONGODB_CRAWLER((short)9),
MSSQL_CRAWLER((short)10),
MYSQL_CRAWLER((short)11),
NETBIOS_CRAWLER((short)12),
ORACLE_CRAWLER((short)13),
POP_CRAWLER((short)14),
POSTGRESQL_CRAWLER((short)15),
REDIS_CRAWLER((short)16),
JMX_CRAWLER((short)17),
SMB_CRAWLER((short)18),
SMTP_CRAWLER((short)19),
SNMP_CRAWLER((short)20),
SSH_CRAWLER((short)21),
TELNET_CRAWLER((short)22),
WMI_CRAWLER((short)23),
UNKNOWN_CRAWLER((short)24);
private short value;
private MetaCrawlerEnum(short value) {
this.value = value;
}
public short getValue() {
return this.value;
}
}

View File

@ -0,0 +1,138 @@
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")
public class NoAuthProbe {
private long id;
private String description;
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 = "DESCRIPTION", nullable = true, length = 1000)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@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,7 @@
package com.loafle.overflow.module.noauthprobe.service;
/**
* Created by snoop on 17. 6. 28.
*/
public interface NoAuthProbeService {
}

View File

@ -0,0 +1,89 @@
package com.loafle.overflow.module.notification.model;
import com.loafle.overflow.module.member.model.Member;
import javax.persistence.*;
import java.util.Date;
/**
* Created by insanity on 17. 8. 25.
*/
@Entity
@Table(name = "NOTIFICATION", schema = "public")
public class Notification {
private long id;
private Date createDate;
private String title;
private String message;
private Member member;
private Date confirmDate;
private String url;
@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 = "TITLE", nullable = false, length = 50)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Column(name = "MESSAGE", nullable = false, length = 255)
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@ManyToOne
@JoinColumn(name = "MEMBER_ID", nullable = false)
public Member getMember() {
return member;
}
public void setMember(Member member) {
this.member = member;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CONFIRM_DATE", nullable = true)
public Date getConfirmDate() {
return confirmDate;
}
public void setConfirmDate(Date confirmDate) {
this.confirmDate = confirmDate;
}
@Column(name = "URL", nullable = false, length = 255)
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.notification.service;
/**
* Created by insanity on 17. 8. 25.
*/
public interface NotificationService {
}

View File

@ -0,0 +1,175 @@
package com.loafle.overflow.module.probe.model;
import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.member.model.Member;
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")
public class Probe {
private long id;
private MetaProbeStatus status;
private String description;
private Date createDate;
private Domain domain;
private String probeKey;
private String encryptionKey;
private int targetCount;
private int sensorCount;
private String displayName;
private String cidr;
private Date authorizeDate;
private Member authorizeMember;
// private InfraHost host;
public Probe() {
}
public Probe(long id) {
this.id = id;
}
@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;
}
@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 = 100, unique = true)
public String getEncryptionKey() {
return encryptionKey;
}
public void setEncryptionKey(String encryptionKey) {
this.encryptionKey = encryptionKey;
}
@Column(name = "TARGET_COUNT", nullable = false)
public int getTargetCount() {
return targetCount;
}
public void setTargetCount(int targetCount) {
this.targetCount = targetCount;
}
@Column(name = "SENSOR_COUNT", nullable = false)
public int getSensorCount() {
return sensorCount;
}
public void setSensorCount(int sensorCount) {
this.sensorCount = sensorCount;
}
@Column(name = "DISPLAY_NAME")
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Column(name = "CIDR")
public String getCidr() {
return cidr;
}
public void setCidr(String cidr) {
this.cidr = cidr;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "AUTHORIZE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
public Date getAuthorizeDate() {
return authorizeDate;
}
public void setAuthorizeDate(Date authorizeDate) {
this.authorizeDate = authorizeDate;
}
@ManyToOne
@JoinColumn(name = "AUTHORIZE_MEMBER_ID", nullable = false)
public Member getAuthorizeMember() {
return authorizeMember;
}
public void setAuthorizeMember(Member authorizeMember) {
this.authorizeMember = authorizeMember;
}
//
// @ManyToOne
// @JoinColumn(name = "HOST_ID", nullable = false)
// public InfraHost getHost() {
// return host;
// }
//
// public void setHost(InfraHost host) {
// this.host = host;
// }
}

View File

@ -0,0 +1,48 @@
package com.loafle.overflow.module.probe.model;
import com.loafle.overflow.module.infra.model.InfraHost;
import javax.persistence.*;
/**
* Created by insanity on 17. 8. 21.
*/
@Entity
@Table(name = "PROBE_INFRAHOST", schema = "public")
public class ProbeHost {
private long id;
private Probe probe;
private InfraHost host;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@OneToOne
@JoinColumn(name = "PROBE_ID", nullable = false)
public Probe getProbe() {
return probe;
}
public void setProbe(Probe probe) {
this.probe = probe;
}
@OneToOne
@JoinColumn(name = "HOST_ID", nullable = false)
public InfraHost getHost() {
return host;
}
public void setHost(InfraHost infraHost) {
this.host = infraHost;
}
}

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")
public class ProbeTask {
private long id;
private MetaProbeTaskType taskType;
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 getTaskType() {
return taskType;
}
public void setTaskType(MetaProbeTaskType taskType) {
this.taskType = taskType;
}
@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,7 @@
package com.loafle.overflow.module.probe.service;
/**
* Created by snoop on 17. 8. 21.
*/
public interface ProbeHostService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.probe.service;
/**
* Created by snoop on 17. 6. 28.
*/
public interface ProbeService {
}

View File

@ -0,0 +1,7 @@
package com.loafle.overflow.module.probe.service;
/**
* Created by snoop on 17. 6. 28.
*/
public interface ProbeTaskService {
}

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