This commit is contained in:
crusader 2018-06-11 17:12:18 +09:00
parent 83e4f64e00
commit 607892cadb
10 changed files with 180 additions and 114 deletions

View File

@ -13,7 +13,7 @@
<groupId>com.loafle.overflow</groupId>
<artifactId>commons-java</artifactId>
<packaging>jar</packaging>
<version>1.0.25-SNAPSHOT</version>
<version>1.0.26-SNAPSHOT</version>
<name>com.loafle.overflow.commons-java</name>
<properties>

View File

@ -55,4 +55,23 @@ public class MetaEmailType {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public static enum Enum {
SIGNUP((short)1),
RESET_PASSWORD((short)2),
;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaEmailType to() {
return new MetaEmailType(this.value);
}
}
}

View File

@ -9,7 +9,7 @@ import java.util.Date;
@Entity
@Table(name = "META_INFRA_TYPE", schema = "public")
public class MetaInfraType {
private Integer id;
private Short id;
private String key;
private String name;
private Date createDate;
@ -17,16 +17,16 @@ public class MetaInfraType {
public MetaInfraType() {
}
public MetaInfraType(Integer id) {
public MetaInfraType(Short id) {
this.id = id;
}
@Id
public Integer getId() {
public Short getId() {
return id;
}
public void setId(Integer id) {
public void setId(Short id) {
this.id = id;
}
@ -58,4 +58,23 @@ public class MetaInfraType {
this.createDate = createDate;
}
public static enum Enum {
ZONE((short)1),
HOST((short)2),
SERVICE((short)3),
;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaInfraType to() {
return new MetaInfraType(this.value);
}
}
}

View File

@ -64,4 +64,25 @@ public class MetaMemberStatus {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public static enum Enum {
NOAUTH((short)1),
NORMAL((short)2),
DORMANCY((short)3),
WITHDRAWAL((short)4),
;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaMemberStatus to() {
return new MetaMemberStatus(this.value);
}
}
}

View File

@ -64,4 +64,25 @@ public class MetaNoAuthProbeStatus {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public static enum Enum {
ACCEPTED((short)1),
DENIED((short)2),
PROCESSING((short)3),
;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaNoAuthProbeStatus to() {
return new MetaNoAuthProbeStatus(this.value);
}
}
}

View File

@ -64,4 +64,23 @@ public class MetaProbeStatus {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public static enum Enum {
INITIAL((short)1),
NORMAL((short)2),
;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaProbeStatus to() {
return new MetaProbeStatus(this.value);
}
}
}

View File

@ -1,8 +1,5 @@
package com.loafle.overflow.model.meta;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.*;
/**
@ -12,54 +9,28 @@ import javax.persistence.*;
@Table(name = "META_TARGET_HOST_TYPE", schema = "public")
@DiscriminatorValue("2")
public class MetaTargetHostType extends MetaTargetType {
private static Map<String, Integer> mapping;
public MetaTargetHostType() {
}
public MetaTargetHostType(Integer id) {
this.setId(id);
}
static {
Map<String, Integer> mapping = new HashMap<>();
mapping.put("UNKNOWN", 100);
mapping.put("ALPINE_LINUX", 101);
mapping.put("AMAZON_LINUX", 102);
mapping.put("ANDROID", 103);
mapping.put("CENTOS", 104);
mapping.put("CISCO_IOS", 105);
mapping.put("COREOS", 106);
mapping.put("DARWIN", 107);
mapping.put("DEBIAN", 108);
mapping.put("FEDORA", 109);
mapping.put("FREEBSD", 110);
mapping.put("HP_UX", 111);
mapping.put("IBM_AIX", 112);
mapping.put("IBM_AS_400", 113);
mapping.put("IBM_POWER8", 114);
mapping.put("IOS", 115);
mapping.put("LINUX", 116);
mapping.put("MAC_OS_X", 117);
mapping.put("MAC_OS_X_SERVE", 118);
mapping.put("NETBSD", 119);
mapping.put("NOVELL_NETWARE", 120);
mapping.put("OPENBSD", 121);
mapping.put("ORACLE_LINUX", 122);
mapping.put("RASPBIAN", 123);
mapping.put("RHEL", 124);
mapping.put("SOLARIS", 125);
mapping.put("SUSE", 126);
mapping.put("UBUNTU", 127);
mapping.put("UBUNTU_SERVER", 128);
mapping.put("WINDOWS", 129);
mapping.put("WINDOWS_SERVER", 130);
public static enum Enum {
UNKNOWN(100),
;
MetaTargetHostType.mapping.putAll(mapping);
}
private final Integer value;
public static MetaTargetHostType toMetaTargetHostType(String key) {
Integer id = MetaTargetHostType.mapping.get(key);
if (null == id) {
return null;
/**
* @param value
*/
Enum(final Integer value) {
this.value = value;
}
public MetaTargetHostType to() {
return new MetaTargetHostType(this.value);
}
return new MetaTargetHostType(id);
}
}

View File

@ -12,78 +12,28 @@ import javax.persistence.*;
@Table(name = "META_TARGET_SERVICE_TYPE", schema = "public")
@DiscriminatorValue("3")
public class MetaTargetServiceType extends MetaTargetType {
private static Map<String, Integer> mapping;
public MetaTargetServiceType() {
}
public MetaTargetServiceType(Integer id) {
this.setId(id);
}
static {
Map<String, Integer> mapping = new HashMap<>();
mapping.put("UNKNOWN", 1000);
mapping.put("ACTIVE_DIRECTORY", 1001);
mapping.put("APACHE_HTTPD", 1002);
mapping.put("CASSANDRA", 1003);
mapping.put("COUCHBASE", 1004);
mapping.put("COUCHDB", 1005);
mapping.put("DB2", 1006);
mapping.put("DHCP", 1007);
mapping.put("DNS", 1008);
mapping.put("EXCHANGE_SERVER", 1009);
mapping.put("EXIM", 1010);
mapping.put("FIREBIRD", 1011);
mapping.put("FTP", 1012);
mapping.put("GLASSFISH", 1013);
mapping.put("HTTP", 1014);
mapping.put("HTTPS", 1015);
mapping.put("IMAP", 1016);
mapping.put("INFLUXDB", 1017);
mapping.put("INGRES", 1018);
mapping.put("JBOSS", 1019);
mapping.put("JMX", 1020);
mapping.put("LDAP", 1021);
mapping.put("LIGHTTPD", 1022);
mapping.put("MARIADB", 1023);
mapping.put("MEMCACHED", 1024);
mapping.put("IIS", 1025);
mapping.put("SQL_SERVER", 1026);
mapping.put("MONGODB", 1027);
mapping.put("MYSQL", 1028);
mapping.put("NETBIOS", 1029);
mapping.put("NGINX", 1030);
mapping.put("NNTP", 1031);
mapping.put("ORACLE", 1032);
mapping.put("POP", 1033);
mapping.put("POSTFIX", 1034);
mapping.put("POSTGRESQL", 1035);
mapping.put("REDIS", 1036);
mapping.put("REDIS_SENTINEL", 1037);
mapping.put("SENDMAIL", 1038);
mapping.put("SMB", 1039);
mapping.put("SMTP", 1040);
mapping.put("SNMP", 1041);
mapping.put("SNMP_V2", 1042);
mapping.put("SNMP_V3", 1043);
mapping.put("SQLITE", 1044);
mapping.put("SQUID_CACHE", 1045);
mapping.put("SQUID_PROXY", 1046);
mapping.put("SSH", 1047);
mapping.put("SYBASE", 1048);
mapping.put("TELNET", 1049);
mapping.put("TOMCAT", 1050);
mapping.put("VARNISH", 1051);
mapping.put("WEBSPHERE", 1052);
mapping.put("WMI", 1053);
mapping.put("ZIMBRA", 1054);
public static enum Enum {
UNKNOWN(1000),
;
MetaTargetServiceType.mapping.putAll(mapping);
}
private final Integer value;
public static MetaTargetServiceType toMetaTargetServiceType(String key) {
Integer id = MetaTargetServiceType.mapping.get(key);
if (null == id) {
return null;
/**
* @param value
*/
Enum(final Integer value) {
this.value = value;
}
public MetaTargetServiceType to() {
return new MetaTargetServiceType(this.value);
}
return new MetaTargetServiceType(id);
}
}

View File

@ -64,4 +64,25 @@ public class MetaTargetStatus {
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public static enum Enum {
UP((short)1),
DOWN((short)2),
WARN((short)3),
ERROR((short)4),
;
private final Short value;
/**
* @param value
*/
Enum(final Short value) {
this.value = value;
}
public MetaTargetStatus to() {
return new MetaTargetStatus(this.value);
}
}
}

View File

@ -9,4 +9,29 @@ import javax.persistence.*;
@Table(name = "META_TARGET_ZONE_TYPE", schema = "public")
@DiscriminatorValue("1")
public class MetaTargetZoneType extends MetaTargetType {
public MetaTargetZoneType() {
}
public MetaTargetZoneType(Integer id) {
this.setId(id);
}
public static enum Enum {
UNKNOWN(1),
ZONE(2),
;
private final Integer value;
/**
* @param value
*/
Enum(final Integer value) {
this.value = value;
}
public MetaTargetZoneType to() {
return new MetaTargetZoneType(this.value);
}
}
}