diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java index 062c136..629d007 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraDAO.java @@ -1,8 +1,8 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.Infra; -import com.loafle.overflow.central.module.probe.model.Probe; -import com.loafle.overflow.central.module.target.model.Target; +import com.loafle.overflow.model.infra.Infra; +import com.loafle.overflow.model.probe.Probe; +import com.loafle.overflow.model.target.Target; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDAO.java index 8ce27a1..da4480d 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraHostDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraHost; +import com.loafle.overflow.model.infra.InfraHost; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java index c497973..7765567 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraMachineDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraMachine; +import com.loafle.overflow.model.infra.InfraMachine; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java index 7d29d55..aea8887 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSApplicationDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraOSApplication; +import com.loafle.overflow.model.infra.InfraOSApplication; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java index 0f8ba0e..01d2ee4 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraOS; +import com.loafle.overflow.model.infra.InfraOS; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java index 756d06c..99744b5 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSDaemonDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraOSDaemon; +import com.loafle.overflow.model.infra.InfraOSDaemon; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java index 1d61c89..9d97b06 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraOSPortDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraOSPort; +import com.loafle.overflow.model.infra.InfraOSPort; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraServiceDAO.java b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraServiceDAO.java index 9c0ead9..9744c7a 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraServiceDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/dao/InfraServiceDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.infra.dao; -import com.loafle.overflow.central.module.infra.model.InfraService; +import com.loafle.overflow.model.infra.InfraService; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/Infra.java b/src/main/java/com/loafle/overflow/central/module/infra/model/Infra.java deleted file mode 100644 index d1064fc..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/Infra.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.loafle.overflow.central.module.infra.model; - - -import com.loafle.overflow.central.module.meta.model.MetaInfraType; -import com.loafle.overflow.central.module.probe.model.Probe; -import com.loafle.overflow.central.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; -// } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraHost.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraHost.java deleted file mode 100644 index 7763a31..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraHost.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraMachine.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraMachine.java deleted file mode 100644 index 7a0bc62..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraMachine.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} - diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOS.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOS.java deleted file mode 100644 index 52ae385..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOS.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.loafle.overflow.central.module.infra.model; - - -import com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSApplication.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSApplication.java deleted file mode 100644 index 3d8935b..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSApplication.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSDaemon.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSDaemon.java deleted file mode 100644 index 18c0175..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSDaemon.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSPort.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSPort.java deleted file mode 100644 index 316e48e..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraOSPort.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.loafle.overflow.central.module.infra.model; - - -import com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraService.java b/src/main/java/com/loafle/overflow/central/module/infra/model/InfraService.java deleted file mode 100644 index 7ecb14d..0000000 --- a/src/main/java/com/loafle/overflow/central/module/infra/model/InfraService.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.loafle.overflow.central.module.infra.model; - - -import com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraHostService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java similarity index 53% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraHostService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java index c1a9505..ad5c341 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraHostService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraHostService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraHostDAO; -import com.loafle.overflow.central.module.infra.model.InfraHost; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraHost; +import com.loafle.overflow.service.central.infra.InfraHostService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,20 +12,20 @@ import org.springframework.stereotype.Service; */ @Service("InfraHostService") -public class InfraHostService { +public class CentralInfraHostService implements InfraHostService { @Autowired InfraHostDAO infraHostDAO; - public InfraHost regist(InfraHost infraHost) { + public InfraHost regist(InfraHost infraHost) throws OverflowException { return this.infraHostDAO.save(infraHost); } - public InfraHost read(long id) { + public InfraHost read(long id) throws OverflowException { return this.infraHostDAO.findOne(id); } - public InfraHost readByIp(long ip) { + public InfraHost readByIp(long ip) throws OverflowException { return this.infraHostDAO.findByIp(ip); } } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraMachineService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraMachineService.java similarity index 60% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraMachineService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraMachineService.java index fc89ad6..59012a8 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraMachineService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraMachineService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraMachineDAO; -import com.loafle.overflow.central.module.infra.model.InfraMachine; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraMachine; +import com.loafle.overflow.service.central.infra.InfraMachineService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -9,11 +11,11 @@ import org.springframework.stereotype.Service; * Created by insanity on 17. 6. 28. */ @Service("InfraMachineService") -public class InfraMachineService { +public class CentralInfraMachineService implements InfraMachineService { @Autowired InfraMachineDAO infraMachineDAO; - public InfraMachine regist(InfraMachine infraMachine) { + public InfraMachine regist(InfraMachine infraMachine) throws OverflowException { return this.infraMachineDAO.save(infraMachine); } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSApplicationService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSApplicationService.java similarity index 60% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSApplicationService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSApplicationService.java index 26d65fd..2b4a729 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSApplicationService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSApplicationService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraOSApplicationDAO; -import com.loafle.overflow.central.module.infra.model.InfraOSApplication; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraOSApplication; +import com.loafle.overflow.service.central.infra.InfraOSApplicationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,16 +12,16 @@ import org.springframework.stereotype.Service; */ @Service("InfraOSApplicationService") -public class InfraOSApplicationService { +public class CentralInfraOSApplicationService implements InfraOSApplicationService { @Autowired InfraOSApplicationDAO infraOSApplicationDAO; - public InfraOSApplication regist(InfraOSApplication infraOSApplication) { + public InfraOSApplication regist(InfraOSApplication infraOSApplication) throws OverflowException { return this.infraOSApplicationDAO.save(infraOSApplication); } - public InfraOSApplication read(long id) { + public InfraOSApplication read(long id)throws OverflowException { return this.infraOSApplicationDAO.findOne(id); } } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSDaemonService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSDaemonService.java similarity index 54% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSDaemonService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSDaemonService.java index 755839a..de52515 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSDaemonService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSDaemonService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraOSDaemonDAO; -import com.loafle.overflow.central.module.infra.model.InfraOSDaemon; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraOSDaemon; +import com.loafle.overflow.service.central.infra.InfraOSDaemonService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,16 +12,16 @@ import org.springframework.stereotype.Service; */ @Service("InfraOSDaemonService") -public class InfraOSDaemonService { +public class CentralInfraOSDaemonService implements InfraOSDaemonService { @Autowired InfraOSDaemonDAO infraOSDaemonDAO; - public InfraOSDaemon regist(InfraOSDaemon infraOSDaemon) { + public InfraOSDaemon regist(InfraOSDaemon infraOSDaemon) throws OverflowException { return this.infraOSDaemonDAO.save(infraOSDaemon); } - public InfraOSDaemon read(long id) { + public InfraOSDaemon read(long id) throws OverflowException { return this.infraOSDaemonDAO.findOne(id); } } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSPortService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSPortService.java similarity index 58% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSPortService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSPortService.java index 7457d08..4503e29 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSPortService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSPortService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraOSPortDAO; -import com.loafle.overflow.central.module.infra.model.InfraOSPort; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraOSPort; +import com.loafle.overflow.service.central.infra.InfraOSPortService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,20 +12,20 @@ import org.springframework.stereotype.Service; */ @Service("InfraOSPortService") -public class InfraOSPortService { +public class CentralInfraOSPortService implements InfraOSPortService { @Autowired InfraOSPortDAO infraOSPortDAO; - public InfraOSPort regist(InfraOSPort infraOSPort) { + public InfraOSPort regist(InfraOSPort infraOSPort) throws OverflowException { return this.infraOSPortDAO.save(infraOSPort); } - public InfraOSPort read(long id) { + public InfraOSPort read(long id) throws OverflowException { return this.infraOSPortDAO.findOne(id); } - public InfraOSPort readByPort(long osId, int portNumber, String portType) { + public InfraOSPort readByPort(long osId, int portNumber, String portType) throws OverflowException { return this.infraOSPortDAO.findByPort(osId, portNumber, portType); } } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSService.java similarity index 55% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSService.java index 4e36bef..48048ae 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraOSService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraOSService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraOSDAO; -import com.loafle.overflow.central.module.infra.model.InfraOS; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraOS; +import com.loafle.overflow.service.central.infra.InfraOSService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -10,16 +12,16 @@ import org.springframework.stereotype.Service; */ @Service("InfraOSService") -public class InfraOSService { +public class CentralInfraOSService implements InfraOSService { @Autowired InfraOSDAO infraOSDAO; - public InfraOS regist(InfraOS infraOS) { + public InfraOS regist(InfraOS infraOS) throws OverflowException { return this.infraOSDAO.save(infraOS); } - public InfraOS read(long id) { + public InfraOS read(long id) throws OverflowException { return this.infraOSDAO.findOne(id); } } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java similarity index 76% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java index 974faa1..d6f2dad 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraService.java @@ -4,12 +4,14 @@ import com.loafle.overflow.central.commons.model.PageParams; import com.loafle.overflow.central.commons.utils.PageUtil; import com.loafle.overflow.central.module.domain.model.Domain; import com.loafle.overflow.central.module.infra.dao.InfraDAO; -import com.loafle.overflow.central.module.infra.model.Infra; import com.loafle.overflow.central.module.probe.exception.ProbeNotFoundException; -import com.loafle.overflow.central.module.probe.model.Probe; +import com.loafle.overflow.model.probe.Probe; import com.loafle.overflow.central.module.probe.service.ProbeService; import com.loafle.overflow.central.module.sensor.dao.SensorDAO; -import com.loafle.overflow.central.module.target.model.Target; +import com.loafle.overflow.model.target.Target; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.Infra; +import com.loafle.overflow.model.infra.InfraService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Service; @@ -21,7 +23,7 @@ import java.util.List; */ @Service("InfraService") -public class InfraService { +public class CentralInfraService implements InfraService { @Autowired InfraDAO infraDAO; @@ -32,21 +34,21 @@ public class InfraService { @Autowired private ProbeService probeService; - public Infra regist(Infra infra) { + public Infra regist(Infra infra) throws OverflowException { return this.infraDAO.save(infra); } - public Infra read(long id) { + public Infra read(long id) throws OverflowException { Infra infra = this.infraDAO.findOne(id); infra.getTarget().setSensors(this.sensorDAO.findAllByTarget(infra.getTarget())); return infra; } - public Page readAllByProbe(Probe probe, PageParams pageParams) { + public Page readAllByProbe(Probe probe, PageParams pageParams) throws OverflowException { return this.infraDAO.findAllByProbe(probe, PageUtil.getPageRequest(pageParams)); } - public Page readAllByDomain(Domain domain, PageParams pageParams) { + public Page readAllByDomain(Domain domain, PageParams pageParams) throws OverflowException { List probeList = this.probeService.readAllByDomain(domain); if(probeList == null || probeList.size() <= 0) { @@ -61,7 +63,7 @@ public class InfraService { } - public List readAllTargetByDomain(Domain domain) { + public List readAllTargetByDomain(Domain domain) throws OverflowException { List probeList = this.probeService.readAllByDomain(domain); @@ -72,12 +74,12 @@ public class InfraService { return this.infraDAO.findAllTargetByProbeList(probeList); } - public List readAllTargetByProbeList(List probeList) { + public List readAllTargetByProbeList(List probeList) throws OverflowException { return this.infraDAO.findAllTargetByProbeList(probeList); // return null; } - public Infra readByTarget(Target target) { + public Infra readByTarget(Target target) throws OverflowException { return this.infraDAO.findByTarget(target); } diff --git a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraServiceService.java b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraServiceService.java similarity index 58% rename from src/main/java/com/loafle/overflow/central/module/infra/service/InfraServiceService.java rename to src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraServiceService.java index 34a9413..7d6a724 100644 --- a/src/main/java/com/loafle/overflow/central/module/infra/service/InfraServiceService.java +++ b/src/main/java/com/loafle/overflow/central/module/infra/service/CentralInfraServiceService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.infra.service; import com.loafle.overflow.central.module.infra.dao.InfraServiceDAO; -import com.loafle.overflow.central.module.infra.model.InfraService; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.infra.InfraService; +import com.loafle.overflow.service.central.infra.InfraServiceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -9,19 +11,19 @@ import org.springframework.stereotype.Service; * Created by insanity on 17. 6. 28. */ @Service("InfraServiceService") -public class InfraServiceService { +public class CentralInfraServiceService implements InfraServiceService { @Autowired InfraServiceDAO infraServiceDAO; - public com.loafle.overflow.central.module.infra.model.InfraService regist(com.loafle.overflow.central.module.infra.model.InfraService infraService) { + public InfraService regist(InfraService infraService) throws OverflowException { return this.infraServiceDAO.save(infraService); } - public com.loafle.overflow.central.module.infra.model.InfraService read(long id) { + public InfraService read(long id) throws OverflowException { return this.infraServiceDAO.findOne(id); } - public InfraService readByService(long hostId, int portNumber, String portType) { + public InfraService readByService(long hostId, int portNumber, String portType) throws OverflowException { return this.infraServiceDAO.findByService(hostId, portNumber, portType); } } diff --git a/src/main/java/com/loafle/overflow/central/module/member/dao/MemberDAO.java b/src/main/java/com/loafle/overflow/central/module/member/dao/MemberDAO.java index d1c5c78..52e1419 100644 --- a/src/main/java/com/loafle/overflow/central/module/member/dao/MemberDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/member/dao/MemberDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.member.dao; -import com.loafle.overflow.central.module.member.model.Member; +import com.loafle.overflow.model.member.Member; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/com/loafle/overflow/central/module/member/dao/MemberTotpDAO.java b/src/main/java/com/loafle/overflow/central/module/member/dao/MemberTotpDAO.java index 38c531e..fe93b78 100644 --- a/src/main/java/com/loafle/overflow/central/module/member/dao/MemberTotpDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/member/dao/MemberTotpDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.member.dao; -import com.loafle.overflow.central.module.member.model.Member; -import com.loafle.overflow.central.module.member.model.MemberTotp; +import com.loafle.overflow.model.member.Member; +import com.loafle.overflow.model.member.MemberTotp; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/com/loafle/overflow/central/module/member/model/Member.java b/src/main/java/com/loafle/overflow/central/module/member/model/Member.java deleted file mode 100644 index e4288d7..0000000 --- a/src/main/java/com/loafle/overflow/central/module/member/model/Member.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.loafle.overflow.central.module.member.model; - - -import com.loafle.overflow.central.module.meta.model.MetaMemberStatus; -import org.codehaus.jackson.annotate.JsonIgnore; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by root on 17. 6. 22. - */ -@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; - private int signinFailCount; - private boolean totpType; - - 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; - } - - @Column(name = "SIGNIN_FAIL_COUNT", nullable = true, columnDefinition = "int default 0") - public int getSigninFailCount(){ - return this.signinFailCount; - } - - public void setSigninFailCount(int failCount) { - this.signinFailCount = failCount; - } - - @Basic - @Column(name = "TOTP_TYPE", nullable = false, columnDefinition = "boolean default false") - public boolean isTotpType() { - return totpType; - } - - public void setTotpType(boolean totpType) { - this.totpType = totpType; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/member/model/MemberTotp.java b/src/main/java/com/loafle/overflow/central/module/member/model/MemberTotp.java deleted file mode 100644 index 7787ebb..0000000 --- a/src/main/java/com/loafle/overflow/central/module/member/model/MemberTotp.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.loafle.overflow.central.module.member.model; - -import org.codehaus.jackson.annotate.JsonIgnore; - -import javax.persistence.*; -import java.util.Date; - -/** - * Created by geek on 18. 3. 8. - */ -@Entity -@Table(name = "MEMBER_TOTP", schema = "public") -public class MemberTotp { - private long id; - private Member member; - private String secretCode; - private Date createDate; - private Date updateDate; - private String otpAuth; - - public MemberTotp() { - } - - public MemberTotp(long id) { - this.id = id; - } - - @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - @OneToOne - @JoinColumn(name = "MEMBER_ID", nullable = false) - public Member getMember() { - return member; - } - - public void setMember(Member member) { - this.member = member; - } - - @Basic - @Column(name = "SECRET_CODE", nullable = false, length = 20) - public String getSecretCode() { - return secretCode; - } - - public void setSecretCode(String secretCode) { - this.secretCode = secretCode; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false) - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - - @Temporal(TemporalType.TIMESTAMP) - @Column(name = "UPDATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = true) - public Date getUpdateDate() { - return updateDate; - } - - public void setUpdateDate(Date updateDate) { - this.updateDate = updateDate; - } - - @Transient - public String getOtpAuth() { - return otpAuth; - } - - public void setOtpAuth(String otpAuthURL) { - this.otpAuth = otpAuthURL; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/member/service/MemberService.java b/src/main/java/com/loafle/overflow/central/module/member/service/CentralMemberService.java similarity index 85% rename from src/main/java/com/loafle/overflow/central/module/member/service/MemberService.java rename to src/main/java/com/loafle/overflow/central/module/member/service/CentralMemberService.java index 5313298..9011903 100644 --- a/src/main/java/com/loafle/overflow/central/module/member/service/MemberService.java +++ b/src/main/java/com/loafle/overflow/central/module/member/service/CentralMemberService.java @@ -5,16 +5,20 @@ import com.loafle.overflow.central.commons.stereotype.WebappAPI; import com.loafle.overflow.central.commons.utils.EmailSender; import com.loafle.overflow.central.module.apikey.model.ApiKey; import com.loafle.overflow.central.module.apikey.service.ApiKeyService; -import com.loafle.overflow.central.module.domain.model.Domain; -import com.loafle.overflow.central.module.domain.model.DomainMember; import com.loafle.overflow.central.module.domain.service.DomainMemberService; import com.loafle.overflow.central.module.email.service.EmailAuthService; import com.loafle.overflow.central.module.member.dao.MemberDAO; import com.loafle.overflow.central.module.member.exception.*; -import com.loafle.overflow.central.module.member.model.Member; -import com.loafle.overflow.central.module.meta.model.MetaMemberStatus; -import com.loafle.overflow.central.module.probe.model.Probe; + import com.loafle.overflow.central.module.probe.service.ProbeService; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.domain.Domain; +import com.loafle.overflow.model.domain.DomainMember; +import com.loafle.overflow.model.member.Member; +import com.loafle.overflow.model.probe.Probe; +import com.loafle.overflow.model.meta.MetaMemberStatus; + +import com.loafle.overflow.service.central.member.MemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.MailException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @@ -30,7 +34,7 @@ import java.util.regex.Pattern; * Created by geek on 17. 6. 28. */ @Service("MemberService") -public class MemberService { +public class CentralMemberService implements MemberService { @Autowired private MemberDAO memberDAO; @@ -52,7 +56,7 @@ public class MemberService { private BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); - public DomainMember signin(String signinId, String signinPw) { + public DomainMember signin(String signinId, String signinPw) throws OverflowException { Member m = this.memberDAO.findByEmail(signinId); if ( null == m ) { @@ -82,7 +86,7 @@ public class MemberService { return dm; } - public Member signup(Member member, String pw) throws UnsupportedEncodingException { + public Member signup(Member member, String pw) throws OverflowException { Member isMember = this.memberDAO.findByEmail(member.getEmail()); @@ -116,7 +120,7 @@ public class MemberService { return resMember; } - public Member sendEmailForPassword(String email) throws UnsupportedEncodingException { + public Member sendEmailForPassword(String email) throws OverflowException { Member member = this.memberDAO.findByEmail(email); if (null == member) { @@ -133,7 +137,7 @@ public class MemberService { return member; } - public Member resetPassword(String encodeEmail, String pw) throws UnsupportedEncodingException { + public Member resetPassword(String encodeEmail, String pw) throws OverflowException { String deStr = URLDecoder.decode(encodeEmail, "UTF-8"); String deEmail = this.emailSender.decrypt(deStr); @@ -161,7 +165,7 @@ public class MemberService { } @WebappAPI - public Member modify(Member member, String pw) { + public Member modify(Member member, String pw) throws OverflowException { String email = SessionMetadata.getTargetID(); Member preMember = this.memberDAO.findByEmail(member.getEmail()); @@ -189,11 +193,11 @@ public class MemberService { return this.modify(member); } - private Member modify(Member member) { + private Member modify(Member member) throws OverflowException { return this.memberDAO.save(member); } - public Member confirmPw(String signinId, String signinPw) { + public Member confirmPw(String signinId, String signinPw) throws OverflowException { Member preMember = this.memberDAO.findByEmail(signinId); String encodePw = passwordEncoder.encode(signinPw); @@ -206,7 +210,7 @@ public class MemberService { return preMember; } - public Member forgotPassword(String signinId, String newPw) { + public Member forgotPassword(String signinId, String newPw) throws OverflowException { Member preMember = this.memberDAO.findByEmail(signinId); if (null == preMember) { @@ -218,7 +222,7 @@ public class MemberService { return cMember; } - public Member read(long memberId) { + public Member read(long memberId) throws OverflowException { if (memberId <= 0) { throw new SignInIdNotExistException(); } @@ -228,13 +232,13 @@ public class MemberService { } @WebappAPI - public void withdrawal(Member member) { + public void withdrawal(Member member) throws OverflowException { String email = SessionMetadata.getTargetID(); // Todo DB delete? } - public List readAllByProbeKey(String probeKey) { + public List readAllByProbeKey(String probeKey) throws OverflowException { Probe probe = this.probeService.readByProbeKey(probeKey); @@ -245,7 +249,7 @@ public class MemberService { return this.domainMemberService.readAllMemberByDomain(probe.getDomain()); } - public List readAllByApiKey(String apikey) { + public List readAllByApiKey(String apikey) throws OverflowException { ApiKey apiKey = this.apiKeyService.readByApiKey(apikey); @@ -256,12 +260,12 @@ public class MemberService { return this.domainMemberService.readAllMemberByDomain(apiKey.getDomain()); } - public List readAllByDomain(Domain domain) { + public List readAllByDomain(Domain domain) throws OverflowException { return this.domainMemberService.readAllMemberByDomain(domain); } - public List readAllByDomainID(final long domainID) { + public List readAllByDomainID(final long domainID) throws OverflowException { return this.domainMemberService.readAllMemberByDomainID(domainID); } diff --git a/src/main/java/com/loafle/overflow/central/module/member/service/MemberTotpService.java b/src/main/java/com/loafle/overflow/central/module/member/service/CentralMemberTotpService.java similarity index 86% rename from src/main/java/com/loafle/overflow/central/module/member/service/MemberTotpService.java rename to src/main/java/com/loafle/overflow/central/module/member/service/CentralMemberTotpService.java index 846abd4..f051966 100644 --- a/src/main/java/com/loafle/overflow/central/module/member/service/MemberTotpService.java +++ b/src/main/java/com/loafle/overflow/central/module/member/service/CentralMemberTotpService.java @@ -4,8 +4,10 @@ import com.loafle.overflow.central.module.member.dao.MemberTotpDAO; import com.loafle.overflow.central.module.member.exception.SecretCodeNotExistException; import com.loafle.overflow.central.module.member.exception.SignInIdNotExistException; import com.loafle.overflow.central.module.member.exception.TotpCodeNotMatchException; -import com.loafle.overflow.central.module.member.model.Member; -import com.loafle.overflow.central.module.member.model.MemberTotp; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.member.Member; +import com.loafle.overflow.model.member.MemberTotp; +import com.loafle.overflow.service.central.member.MemberTotpService; import com.warrenstrange.googleauth.GoogleAuthenticator; import com.warrenstrange.googleauth.GoogleAuthenticatorKey; import org.apache.http.client.utils.URIBuilder; @@ -19,11 +21,11 @@ import java.util.Map; * Created by geek on 18. 3. 8. */ @Service("MemberTotpService") -public class MemberTotpService { +public class CentralMemberTotpService implements MemberTotpService { @Autowired private MemberTotpDAO totpDAO; - public void regist(Member member, String secretCode, String code) throws Exception { + public void regist(Member member, String secretCode, String code) throws OverflowException { if (null == member || 0 >= member.getId()) { throw new SignInIdNotExistException("Not Null Member ID"); @@ -40,7 +42,7 @@ public class MemberTotpService { this.totpDAO.save(totp); } - public MemberTotp modify(MemberTotp totp) { + public MemberTotp modify(MemberTotp totp) throws OverflowException { if ( null == totp.getSecretCode() || totp.getSecretCode().equals("")) { throw new SecretCodeNotExistException("No secret code exists"); } @@ -51,7 +53,7 @@ public class MemberTotpService { return this.totpDAO.save(totp); } - public void remove(long id) throws Exception { + public void remove(long id) throws OverflowException { this.totpDAO.delete(id); } @@ -59,7 +61,7 @@ public class MemberTotpService { return this.totpDAO.findOne(id); } - public boolean checkCodeForMember(Member member, String code) throws Exception { + public boolean checkCodeForMember(Member member, String code) throws OverflowException { MemberTotp totp = this.totpDAO.findByMember(member); if (null == totp && (totp.getSecretCode() == null || totp.getSecretCode().equals("")) ) { throw new SignInIdNotExistException("Error TotpMember"); @@ -67,7 +69,7 @@ public class MemberTotpService { return this.checkCode(totp.getSecretCode(), code); } - public boolean checkCode(String secretCode, String code) throws Exception { + public boolean checkCode(String secretCode, String code) throws OverflowException { GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(); int codeInt = Integer.parseInt(code); boolean isCheck = googleAuthenticator.authorize(secretCode, codeInt); @@ -79,7 +81,7 @@ public class MemberTotpService { return isCheck; } - public Map createTotp(Member member) { + public Map createTotp(Member member) throws OverflowException { Map returnMap = new HashMap<>(); GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(); @@ -99,7 +101,7 @@ public class MemberTotpService { return returnMap; } - private String formatLabel(String issuer, String accountName) { + private String formatLabel(String issuer, String accountName) throws OverflowException { if(accountName != null && accountName.trim().length() != 0) { StringBuilder sb = new StringBuilder(); if(issuer != null) { diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerDAO.java index 3cae4ec..8ae385c 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; +import com.loafle.overflow.model.meta.MetaCrawler; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerInputItemDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerInputItemDAO.java index b678fdd..992d831 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerInputItemDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaCrawlerInputItemDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; -import com.loafle.overflow.central.module.meta.model.MetaCrawlerInputItem; +import com.loafle.overflow.model.meta.MetaCrawler; +import com.loafle.overflow.model.meta.MetaCrawlerInputItem; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaHistoryTypeDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaHistoryTypeDAO.java index 53e5c67..6a2372e 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaHistoryTypeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaHistoryTypeDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaHistoryType; +import com.loafle.overflow.model.meta.MetaHistoryType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraTypeDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraTypeDAO.java index 6a23340..a3c89d5 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraTypeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraTypeDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaInfraType; +import com.loafle.overflow.model.meta.MetaInfraType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraVendorDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraVendorDAO.java index b22fe9c..2a9117a 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraVendorDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInfraVendorDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaInfraType; -import com.loafle.overflow.central.module.meta.model.MetaInfraVendor; +import com.loafle.overflow.model.meta.MetaInfraType; +import com.loafle.overflow.model.meta.MetaInfraVendor; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInputTypeDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInputTypeDAO.java index f71d625..fb3b4ad 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInputTypeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaInputTypeDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaInputType; +import com.loafle.overflow.model.meta.MetaInputType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaMemberStatusDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaMemberStatusDAO.java index 7238c24..3569056 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaMemberStatusDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaMemberStatusDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaMemberStatus; +import com.loafle.overflow.model.meta.MetaMemberStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNoAuthProbeStatusDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNoAuthProbeStatusDAO.java index a1d6b4c..99c0be5 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNoAuthProbeStatusDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNoAuthProbeStatusDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaNoAuthProbeStatus; +import com.loafle.overflow.model.meta.MetaNoAuthProbeStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNotificationDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNotificationDAO.java index 625a134..48f7f68 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNotificationDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaNotificationDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaNotification; +import com.loafle.overflow.model.meta.MetaNotification; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeArchitectureDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeArchitectureDAO.java index 8f3839d..f18aa5f 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeArchitectureDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeArchitectureDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaProbeArchitecture; +import com.loafle.overflow.model.meta.MetaProbeArchitecture; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeOsDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeOsDAO.java index 4f98e69..bab0c5d 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeOsDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeOsDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaProbeOs; +import com.loafle.overflow.model.meta.MetaProbeOs; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbePackageDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbePackageDAO.java index 8e4f4a8..9cfea56 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbePackageDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbePackageDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaProbeOs; -import com.loafle.overflow.central.module.meta.model.MetaProbePackage; +import com.loafle.overflow.model.meta.MetaProbeOs; +import com.loafle.overflow.model.meta.MetaProbePackage; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeStatusDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeStatusDAO.java index a5fc69d..111a8ab 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeStatusDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeStatusDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaProbeStatus; +import com.loafle.overflow.model.meta.MetaProbeStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeTaskTypeDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeTaskTypeDAO.java index 222eff0..b868898 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeTaskTypeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeTaskTypeDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaProbeTaskType; +import com.loafle.overflow.model.meta.MetaProbeTaskType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeVersionDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeVersionDAO.java index 419fe18..570322f 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeVersionDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaProbeVersionDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaProbeVersion; +import com.loafle.overflow.model.meta.MetaProbeVersion; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayItemDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayItemDAO.java index 9eeb283..b56a71d 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayItemDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayItemDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; -import com.loafle.overflow.central.module.meta.model.MetaSensorDisplayItem; +import com.loafle.overflow.model.meta.MetaCrawler; +import com.loafle.overflow.model.meta.MetaSensorDisplayItem; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayMappingDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayMappingDAO.java index 32ffeeb..0b69e87 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayMappingDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorDisplayMappingDAO.java @@ -1,8 +1,8 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaSensorDisplayItem; -import com.loafle.overflow.central.module.meta.model.MetaSensorDisplayMapping; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemKey; +import com.loafle.overflow.model.meta.MetaSensorDisplayItem; +import com.loafle.overflow.model.meta.MetaSensorDisplayMapping; +import com.loafle.overflow.model.meta.MetaSensorItemKey; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemDAO.java index c9b1f35..3e0e0fc 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaSensorItem; +import com.loafle.overflow.model.meta.MetaSensorItem; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemKeyDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemKeyDAO.java index 8ab5804..9ef4517 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemKeyDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemKeyDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemKey; +import com.loafle.overflow.model.meta.MetaCrawler; +import com.loafle.overflow.model.meta.MetaSensorItemKey; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemTypeDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemTypeDAO.java index 78f915c..cbe1704 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemTypeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemTypeDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemType; +import com.loafle.overflow.model.meta.MetaSensorItemType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemUnitDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemUnitDAO.java index 9e3a6ae..e41a889 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemUnitDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorItemUnitDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemUnit; +import com.loafle.overflow.model.meta.MetaSensorItemUnit; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorStatusDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorStatusDAO.java index 954d0ac..3293359 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorStatusDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaSensorStatusDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaSensorStatus; +import com.loafle.overflow.model.meta.MetaSensorStatus; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerDAO.java index 620d5c6..7036767 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaInfraVendor; -import com.loafle.overflow.central.module.meta.model.MetaVendorCrawler; +import com.loafle.overflow.model.meta.MetaInfraVendor; +import com.loafle.overflow.model.meta.MetaVendorCrawler; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerSensorItemDAO.java b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerSensorItemDAO.java index 59fd828..8121f83 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerSensorItemDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/dao/MetaVendorCrawlerSensorItemDAO.java @@ -1,6 +1,6 @@ package com.loafle.overflow.central.module.meta.dao; -import com.loafle.overflow.central.module.meta.model.MetaVendorCrawlerSensorItem; +import com.loafle.overflow.model.meta.MetaVendorCrawlerSensorItem; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaCrawler.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaCrawler.java deleted file mode 100644 index 841b6c6..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaCrawler.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.loafle.overflow.central.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; - - public MetaCrawler(short id) { - this.id = id; - } - - public MetaCrawler() { - - } - - @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; - } - - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaCrawlerInputItem.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaCrawlerInputItem.java deleted file mode 100644 index 785315c..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaCrawlerInputItem.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.loafle.overflow.central.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; -// } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaHistoryType.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaHistoryType.java deleted file mode 100644 index afb5045..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaHistoryType.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInfraType.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInfraType.java deleted file mode 100644 index 9dccf64..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInfraType.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInfraVendor.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInfraVendor.java deleted file mode 100644 index 9115dbc..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInfraVendor.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInputType.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInputType.java deleted file mode 100644 index 0ad039d..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaInputType.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaMemberStatus.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaMemberStatus.java deleted file mode 100644 index 7c8d5b6..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaMemberStatus.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaNoAuthProbeStatus.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaNoAuthProbeStatus.java deleted file mode 100644 index f14aaba..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaNoAuthProbeStatus.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaNotification.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaNotification.java deleted file mode 100644 index bddb57e..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaNotification.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeArchitecture.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeArchitecture.java deleted file mode 100644 index 118968c..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeArchitecture.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeOs.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeOs.java deleted file mode 100644 index 971947c..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeOs.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbePackage.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbePackage.java deleted file mode 100644 index cfbeb07..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbePackage.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeStatus.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeStatus.java deleted file mode 100644 index c03e9f3..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeStatus.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeTaskType.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeTaskType.java deleted file mode 100644 index faedfec..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeTaskType.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.loafle.overflow.central.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; - } - - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeVersion.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeVersion.java deleted file mode 100644 index 407ea4e..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaProbeVersion.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorDisplayItem.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorDisplayItem.java deleted file mode 100644 index 2345c92..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorDisplayItem.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.loafle.overflow.central.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 key; - private String displayName; - private String description; - private MetaCrawler crawler; - private MetaSensorItemUnit unit; - private Date createDate; - private boolean isDefault; - private MetaSensorItemType itemType; - - public MetaSensorDisplayItem() { - - } - public MetaSensorDisplayItem(long id) { - this.id = id; - } - - @Id - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - @Column(name = "KEY", nullable = false) - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - @Column(name = "DISPLAY_NAME", nullable = false) - public String getDisplayName() { - return displayName; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - @Column(name = "DESCRIPTION", nullable = false) - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - @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; - } - - - @Basic - @Column(name="IS_DEFAULT", nullable = false, columnDefinition = "boolean default false") - public boolean getDefault() { - return isDefault; - } - - public void setDefault(boolean aDefault) { - isDefault = aDefault; - } - - @ManyToOne - @JoinColumn(name = "TYPE_ID", nullable = false) - public MetaSensorItemType getItemType() { - return itemType; - } - - public void setItemType(MetaSensorItemType itemType) { - this.itemType = itemType; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorDisplayMapping.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorDisplayMapping.java deleted file mode 100644 index c741f2b..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorDisplayMapping.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.loafle.overflow.central.module.meta.model; - -import javax.persistence.*; - -/** - * Created by insanity on 17. 11. 7. - */ -@Entity -@Table(name = "META_SENSOR_DISPLAY_MAPPING", schema = "public") -public class MetaSensorDisplayMapping { - - private long id; - private MetaSensorDisplayItem displayItem; - private MetaSensorItemKey itemKey; - - @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - @ManyToOne - @JoinColumn(name = "DISPLAY_ITEM_ID", nullable = false) - public MetaSensorDisplayItem getDisplayItem() { - return displayItem; - } - - public void setDisplayItem(MetaSensorDisplayItem displayItem) { - this.displayItem = displayItem; - } - - @ManyToOne - @JoinColumn(name = "ITEM_KEY_ID", nullable = false) - public MetaSensorItemKey getItemKey() { - return itemKey; - } - - public void setItemKey(MetaSensorItemKey itemKey) { - this.itemKey = itemKey; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItem.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItem.java deleted file mode 100644 index 5638f01..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItem.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.loafle.overflow.central.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 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; -// } - - - @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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemKey.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemKey.java deleted file mode 100644 index 4647feb..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemKey.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.loafle.overflow.central.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; - - public MetaSensorItemKey() { - - } - - public MetaSensorItemKey(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 = "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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemType.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemType.java deleted file mode 100644 index 9cc09ca..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemType.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemUnit.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemUnit.java deleted file mode 100644 index e875c51..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorItemUnit.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.loafle.overflow.central.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; - - public MetaSensorItemUnit(short id) { - this.id = id; - } - - public MetaSensorItemUnit() { - - } - - @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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorStatus.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorStatus.java deleted file mode 100644 index b751c8d..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaSensorStatus.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.loafle.overflow.central.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; - } -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaVendorCrawler.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaVendorCrawler.java deleted file mode 100644 index 1c69c1f..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaVendorCrawler.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaVendorCrawlerSensorItem.java b/src/main/java/com/loafle/overflow/central/module/meta/model/MetaVendorCrawlerSensorItem.java deleted file mode 100644 index 982d4bd..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/model/MetaVendorCrawlerSensorItem.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerInputItemService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerInputItemService.java similarity index 59% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerInputItemService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerInputItemService.java index b1bde5c..42b5ec9 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerInputItemService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerInputItemService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaCrawlerInputItemDAO; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; -import com.loafle.overflow.central.module.meta.model.MetaCrawlerInputItem; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaCrawler; +import com.loafle.overflow.model.meta.MetaCrawlerInputItem; +import com.loafle.overflow.service.central.meta.MetaCrawlerInputItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -12,12 +14,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaCrawlerInputItemService") -public class MetaCrawlerInputItemService { +public class CentralMetaCrawlerInputItemService implements MetaCrawlerInputItemService { @Autowired private MetaCrawlerInputItemDAO crawlerInputItemDAO; - public List readAllByMetaCrawler(MetaCrawler metaCrawler) { + public List readAllByMetaCrawler(MetaCrawler metaCrawler) throws OverflowException { return this.crawlerInputItemDAO.findAllByCrawler(metaCrawler); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerService.java similarity index 82% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerService.java index 68bae7f..1669b09 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerService.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaCrawlerDAO; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; +import com.loafle.overflow.model.meta.MetaCrawler; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,7 +11,7 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaCrawlerService") -public class MetaCrawlerService { +public class CentralMetaCrawlerService { @Autowired private MetaCrawlerDAO crawlerDAO; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaHistoryTypeService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaHistoryTypeService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaHistoryTypeService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaHistoryTypeService.java index e802c81..b008e09 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaHistoryTypeService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaHistoryTypeService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaHistoryTypeDAO; -import com.loafle.overflow.central.module.meta.model.MetaHistoryType; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaHistoryType; +import com.loafle.overflow.service.central.meta.MetaHistoryTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,20 +13,20 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaHistoryTypeService") -public class MetaHistoryTypeService { +public class CentralMetaHistoryTypeService implements MetaHistoryTypeService { @Autowired private MetaHistoryTypeDAO hisotyTypeDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.hisotyTypeDAO.findAll(); } - public MetaHistoryType regist(MetaHistoryType type) { + public MetaHistoryType regist(MetaHistoryType type) throws OverflowException { return this.hisotyTypeDAO.save(type); } - public List registAll(List types) { + public List registAll(List types) throws OverflowException { return this.hisotyTypeDAO.save(types); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaInfraTypeService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraTypeService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaInfraTypeService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraTypeService.java index b0f3543..2b52888 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaInfraTypeService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraTypeService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaInfraTypeDAO; -import com.loafle.overflow.central.module.meta.model.MetaInfraType; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaInfraType; +import com.loafle.overflow.service.central.meta.MetaInfraTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaInfraTypeService") -public class MetaInfraTypeService { +public class CentralMetaInfraTypeService implements MetaInfraTypeService { @Autowired private MetaInfraTypeDAO infraTypeDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.infraTypeDAO.findAll(); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaInfraVendorService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraVendorService.java similarity index 59% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaInfraVendorService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraVendorService.java index 2770e83..e7c9692 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaInfraVendorService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraVendorService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaInfraVendorDAO; -import com.loafle.overflow.central.module.meta.model.MetaInfraType; -import com.loafle.overflow.central.module.meta.model.MetaInfraVendor; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaInfraType; +import com.loafle.overflow.model.meta.MetaInfraVendor; +import com.loafle.overflow.service.central.meta.MetaInfraVendorService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -12,12 +14,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaInfraVendorService") -public class MetaInfraVendorService { +public class CentralMetaInfraVendorService implements MetaInfraVendorService { @Autowired private MetaInfraVendorDAO infraVendorDAO; - public List readAllByMetaInfraType(MetaInfraType infraType) { + public List readAllByMetaInfraType(MetaInfraType infraType) throws OverflowException { return this.infraVendorDAO.findAllByInfraType(infraType); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaInputTypeService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInputTypeService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaInputTypeService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInputTypeService.java index beee828..2327cad 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaInputTypeService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaInputTypeService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaInputTypeDAO; -import com.loafle.overflow.central.module.meta.model.MetaInputType; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaInputType; +import com.loafle.overflow.service.central.meta.MetaInputTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaInputTypeService") -public class MetaInputTypeService { +public class CentralMetaInputTypeService implements MetaInputTypeService { @Autowired private MetaInputTypeDAO inputTypeDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.inputTypeDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaMemberStatusService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaMemberStatusService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaMemberStatusService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaMemberStatusService.java index 2da3199..424f22f 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaMemberStatusService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaMemberStatusService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaMemberStatusDAO; -import com.loafle.overflow.central.module.meta.model.MetaMemberStatus; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaMemberStatus; +import com.loafle.overflow.service.central.meta.MetaMemberStatusService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaMemberStatusService") -public class MetaMemberStatusService { +public class CentralMetaMemberStatusService implements MetaMemberStatusService { @Autowired private MetaMemberStatusDAO memberStatusDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.memberStatusDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaNoAuthProbeStatusService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaNoAuthProbeStatusService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaNoAuthProbeStatusService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaNoAuthProbeStatusService.java index 6c3ade5..fff4bc3 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaNoAuthProbeStatusService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaNoAuthProbeStatusService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaNoAuthProbeStatusDAO; -import com.loafle.overflow.central.module.meta.model.MetaNoAuthProbeStatus; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaNoAuthProbeStatus; +import com.loafle.overflow.service.central.meta.MetaNoAuthProbeStatusService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,11 +13,11 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaNoAuthProbeStatusService") -public class MetaNoAuthProbeStatusService { +public class CentralMetaNoAuthProbeStatusService implements MetaNoAuthProbeStatusService { @Autowired private MetaNoAuthProbeStatusDAO noAuthProbeStatusDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.noAuthProbeStatusDAO.findAll(); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeArchitectureService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeArchitectureService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeArchitectureService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeArchitectureService.java index b8b938c..7297a48 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeArchitectureService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeArchitectureService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaProbeArchitectureDAO; -import com.loafle.overflow.central.module.meta.model.MetaProbeArchitecture; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaProbeArchitecture; +import com.loafle.overflow.service.central.meta.MetaProbeArchitectureService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaProbeArchitectureService") -public class MetaProbeArchitectureService { +public class CentralMetaProbeArchitectureService implements MetaProbeArchitectureService { @Autowired private MetaProbeArchitectureDAO probeArchitectureDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.probeArchitectureDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeOsService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeOsService.java similarity index 58% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeOsService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeOsService.java index fec0600..8c93d16 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeOsService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeOsService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaProbeOsDAO; -import com.loafle.overflow.central.module.meta.model.MetaProbeOs; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaProbeOs; +import com.loafle.overflow.service.central.meta.MetaProbeOsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaProbeOsService") -public class MetaProbeOsService { +public class CentralMetaProbeOsService implements MetaProbeOsService { @Autowired private MetaProbeOsDAO probeOsDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.probeOsDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbePackageService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbePackageService.java similarity index 60% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbePackageService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbePackageService.java index 2870c42..07bb6c0 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbePackageService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbePackageService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaProbePackageDAO; -import com.loafle.overflow.central.module.meta.model.MetaProbeOs; -import com.loafle.overflow.central.module.meta.model.MetaProbePackage; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaProbeOs; +import com.loafle.overflow.model.meta.MetaProbePackage; +import com.loafle.overflow.service.central.meta.MetaProbePackageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -12,12 +14,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaProbePackageService") -public class MetaProbePackageService { +public class CentralMetaProbePackageService implements MetaProbePackageService { @Autowired private MetaProbePackageDAO probePackageDAO; - public List readAllByOs(MetaProbeOs metaProbeOs) { + public List readAllByOs(MetaProbeOs metaProbeOs) throws OverflowException { return this.probePackageDAO.findAllByOs(metaProbeOs); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeStatusService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeStatusService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeStatusService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeStatusService.java index bd8fbe4..ee1600a 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeStatusService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeStatusService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaProbeStatusDAO; -import com.loafle.overflow.central.module.meta.model.MetaProbeStatus; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaProbeStatus; +import com.loafle.overflow.service.central.meta.MetaProbeStatusService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaProbeStatusService") -public class MetaProbeStatusService { +public class CentralMetaProbeStatusService implements MetaProbeStatusService { @Autowired private MetaProbeStatusDAO probeStatusDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.probeStatusDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeTaskTypeService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeTaskTypeService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeTaskTypeService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeTaskTypeService.java index 3fd582d..684bbb7 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeTaskTypeService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeTaskTypeService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaProbeTaskTypeDAO; -import com.loafle.overflow.central.module.meta.model.MetaProbeTaskType; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaProbeTaskType; +import com.loafle.overflow.service.central.meta.MetaProbeTaskTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaProbeTaskTypeService") -public class MetaProbeTaskTypeService { +public class CentralMetaProbeTaskTypeService implements MetaProbeTaskTypeService { @Autowired private MetaProbeTaskTypeDAO probeTaskTypeDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.probeTaskTypeDAO.findAll(); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeVersionService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeVersionService.java similarity index 70% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeVersionService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeVersionService.java index 99a21e1..7c057c9 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaProbeVersionService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeVersionService.java @@ -1,7 +1,8 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaProbeVersionDAO; -import com.loafle.overflow.central.module.meta.model.MetaProbeVersion; +import com.loafle.overflow.model.meta.MetaProbeVersion; +import com.loafle.overflow.service.central.meta.MetaProbeVersionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,7 +12,7 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaProbeVersionService") -public class MetaProbeVersionService { +public class CentralMetaProbeVersionService implements MetaProbeVersionService { @Autowired private MetaProbeVersionDAO probeVersionDAO; diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorDisplayItemService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorDisplayItemService.java similarity index 60% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorDisplayItemService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorDisplayItemService.java index 50acbf0..eeeb54f 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorDisplayItemService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorDisplayItemService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorDisplayItemDAO; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; -import com.loafle.overflow.central.module.meta.model.MetaSensorDisplayItem; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaCrawler; +import com.loafle.overflow.model.meta.MetaSensorDisplayItem; +import com.loafle.overflow.service.central.meta.MetaSensorDisplayItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -13,19 +15,19 @@ import java.util.List; */ @Service("MetaSensorDisplayItemService") -public class MetaSensorDisplayItemService { +public class CentralMetaSensorDisplayItemService implements MetaSensorDisplayItemService { @Autowired private MetaSensorDisplayItemDAO displayItemDAO; - public MetaSensorDisplayItem regist(MetaSensorDisplayItem item) { + public MetaSensorDisplayItem regist(MetaSensorDisplayItem item) throws OverflowException { return this.displayItemDAO.save(item); } - public MetaSensorDisplayItem read(long id) { + public MetaSensorDisplayItem read(long id) throws OverflowException { return this.displayItemDAO.findOne(id); } - public List readAllByCrawler(MetaCrawler crawler) { + public List readAllByCrawler(MetaCrawler crawler) throws OverflowException { return this.displayItemDAO.findAllByCrawler(crawler); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorDisplayMappingService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorDisplayMappingService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorDisplayMappingService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorDisplayMappingService.java index 4f42465..384307c 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorDisplayMappingService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorDisplayMappingService.java @@ -1,9 +1,11 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorDisplayMappingDAO; -import com.loafle.overflow.central.module.meta.model.MetaSensorDisplayItem; -import com.loafle.overflow.central.module.meta.model.MetaSensorDisplayMapping; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemKey; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaSensorDisplayItem; +import com.loafle.overflow.model.meta.MetaSensorDisplayMapping; +import com.loafle.overflow.model.meta.MetaSensorItemKey; +import com.loafle.overflow.service.central.meta.MetaSensorDisplayMappingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -13,15 +15,15 @@ import java.util.List; * Created by insanity on 17. 11. 7. */ @Service("MetaSensorDisplayMappingService") -public class MetaSensorDisplayMappingService { +public class CentralMetaSensorDisplayMappingService implements MetaSensorDisplayMappingService { @Autowired private MetaSensorDisplayMappingDAO mappingDAO; - public MetaSensorDisplayMapping regist(MetaSensorDisplayMapping m) { + public MetaSensorDisplayMapping regist(MetaSensorDisplayMapping m) throws OverflowException { return this.mappingDAO.save(m); } - public List findAllByDisplayItem(MetaSensorDisplayItem displayItem) { + public List findAllByDisplayItem(MetaSensorDisplayItem displayItem) throws OverflowException { return this.mappingDAO.findAllByDisplayItem(displayItem); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemKeyService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemKeyService.java similarity index 70% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemKeyService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemKeyService.java index 50e785d..7e31e21 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemKeyService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemKeyService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorItemKeyDAO; -import com.loafle.overflow.central.module.meta.model.MetaCrawler; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemKey; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaCrawler; +import com.loafle.overflow.model.meta.MetaSensorItemKey; +import com.loafle.overflow.service.central.meta.MetaSensorItemKeyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -14,17 +16,17 @@ import java.util.Map; * Created by snoop on 17. 8. 29. */ @Service("MetaSensorItemKeyService") -public class MetaSensorItemKeyService { +public class CentralMetaSensorItemKeyService implements MetaSensorItemKeyService { @Autowired private MetaSensorItemKeyDAO metaSensorItemKeyDAO; - public List readAllByCrawler(MetaCrawler metaCrawler) { + public List readAllByCrawler(MetaCrawler metaCrawler) throws OverflowException { return this.metaSensorItemKeyDAO.findAllByCrawler(metaCrawler); } - public Map readAllMapByCrawler(MetaCrawler metaCrawler) { + public Map readAllMapByCrawler(MetaCrawler metaCrawler) throws OverflowException { Map resultMap = new HashMap<>(); diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemService.java similarity index 58% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemService.java index d0e6eff..f23004b 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorItemDAO; -import com.loafle.overflow.central.module.meta.model.MetaSensorItem; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaSensorItem; +import com.loafle.overflow.service.central.meta.MetaSensorItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,13 +13,13 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaSensorItemService") -public class MetaSensorItemService { +public class CentralMetaSensorItemService implements MetaSensorItemService { @Autowired private MetaSensorItemDAO metaSensorItemDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.metaSensorItemDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemTypeService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemTypeService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemTypeService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemTypeService.java index 33ac84b..8bba912 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemTypeService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemTypeService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorItemTypeDAO; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemType; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaSensorItemType; +import com.loafle.overflow.service.central.meta.MetaSensorItemTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,20 +13,20 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaSensorItemTypeService") -public class MetaSensorItemTypeService { +public class CentralMetaSensorItemTypeService implements MetaSensorItemTypeService { @Autowired private MetaSensorItemTypeDAO sensorItemTypeDAO; - public List readAll() { + public List readAll() throws OverflowException { return this.sensorItemTypeDAO.findAll(); } - public MetaSensorItemType regist(MetaSensorItemType type){ + public MetaSensorItemType regist(MetaSensorItemType type) throws OverflowException { return this.sensorItemTypeDAO.save(type); } - public List registAll(List list) { + public List registAll(List list) throws OverflowException { return this.sensorItemTypeDAO.save(list); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemUnitService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemUnitService.java similarity index 62% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemUnitService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemUnitService.java index 3c79284..e8f42b1 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorItemUnitService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorItemUnitService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorItemUnitDAO; -import com.loafle.overflow.central.module.meta.model.MetaSensorItemUnit; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaSensorItemUnit; +import com.loafle.overflow.service.central.meta.MetaSensorItemUnitService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -9,11 +11,11 @@ import org.springframework.stereotype.Service; * Created by insanity on 17. 9. 20. */ @Service("MetaSensorItemUnitService") -public class MetaSensorItemUnitService { +public class CentralMetaSensorItemUnitService implements MetaSensorItemUnitService { @Autowired private MetaSensorItemUnitDAO sensorItemUnitDAO; - public MetaSensorItemUnit regist(MetaSensorItemUnit sensorItemUnit) { + public MetaSensorItemUnit regist(MetaSensorItemUnit sensorItemUnit) throws OverflowException { return this.sensorItemUnitDAO.save(sensorItemUnit); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorStatusService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorStatusService.java similarity index 57% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorStatusService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorStatusService.java index 12a052c..5eb9328 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaSensorStatusService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaSensorStatusService.java @@ -1,7 +1,9 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaSensorStatusDAO; -import com.loafle.overflow.central.module.meta.model.MetaSensorStatus; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaSensorStatus; +import com.loafle.overflow.service.central.meta.MetaSensorStatusService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,12 +13,12 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaSensorStatusService") -public class MetaSensorStatusService { +public class CentralMetaSensorStatusService implements MetaSensorStatusService { @Autowired private MetaSensorStatusDAO sensorStatusDAO; - List readAll() { + public List readAll() throws OverflowException { return this.sensorStatusDAO.findAll(); } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaVendorCrawlerSensorItemService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaVendorCrawlerSensorItemService.java similarity index 51% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaVendorCrawlerSensorItemService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaVendorCrawlerSensorItemService.java index 0867450..10515de 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaVendorCrawlerSensorItemService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaVendorCrawlerSensorItemService.java @@ -1,12 +1,13 @@ package com.loafle.overflow.central.module.meta.service; +import com.loafle.overflow.service.central.meta.MetaVendorCrawlerSensorItemService; import org.springframework.stereotype.Service; /** * Created by snoop on 17. 7. 27. */ @Service("MetaVendorCrawlerSensorItemService") -public class MetaVendorCrawlerSensorItemService { +public class CentralMetaVendorCrawlerSensorItemService implements MetaVendorCrawlerSensorItemService { } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaVendorCrawlerService.java b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaVendorCrawlerService.java similarity index 61% rename from src/main/java/com/loafle/overflow/central/module/meta/service/MetaVendorCrawlerService.java rename to src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaVendorCrawlerService.java index 8796f85..498976a 100644 --- a/src/main/java/com/loafle/overflow/central/module/meta/service/MetaVendorCrawlerService.java +++ b/src/main/java/com/loafle/overflow/central/module/meta/service/CentralMetaVendorCrawlerService.java @@ -1,8 +1,10 @@ package com.loafle.overflow.central.module.meta.service; import com.loafle.overflow.central.module.meta.dao.MetaVendorCrawlerDAO; -import com.loafle.overflow.central.module.meta.model.MetaInfraVendor; -import com.loafle.overflow.central.module.meta.model.MetaVendorCrawler; +import com.loafle.overflow.core.exception.OverflowException; +import com.loafle.overflow.model.meta.MetaInfraVendor; +import com.loafle.overflow.model.meta.MetaVendorCrawler; +import com.loafle.overflow.service.central.meta.MetaVendorCrawlerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -12,17 +14,17 @@ import java.util.List; * Created by snoop on 17. 7. 27. */ @Service("MetaVendorCrawlerService") -public class MetaVendorCrawlerService { +public class CentralMetaVendorCrawlerService implements MetaVendorCrawlerService { @Autowired private MetaVendorCrawlerDAO crawlerDAO; - public List readAllByInfraVendor(MetaInfraVendor infraVendor) { + public List readAllByInfraVendor(MetaInfraVendor infraVendor) throws OverflowException { return this.crawlerDAO.findAllByInfraVendor(infraVendor); } - public MetaVendorCrawler regist(MetaVendorCrawler metaVendorCrawler) { + public MetaVendorCrawler regist(MetaVendorCrawler metaVendorCrawler) throws OverflowException { return this.crawlerDAO.save(metaVendorCrawler); } } diff --git a/src/main/java/com/loafle/overflow/central/module/meta/type/MetaCrawlerEnum.java b/src/main/java/com/loafle/overflow/central/module/meta/type/MetaCrawlerEnum.java deleted file mode 100644 index 8b8aa91..0000000 --- a/src/main/java/com/loafle/overflow/central/module/meta/type/MetaCrawlerEnum.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.loafle.overflow.central.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; - } - -} diff --git a/src/main/java/com/loafle/overflow/central/module/noauthprobe/dao/NoAuthProbeDAO.java b/src/main/java/com/loafle/overflow/central/module/noauthprobe/dao/NoAuthProbeDAO.java index 59c2ac6..e1b72e9 100644 --- a/src/main/java/com/loafle/overflow/central/module/noauthprobe/dao/NoAuthProbeDAO.java +++ b/src/main/java/com/loafle/overflow/central/module/noauthprobe/dao/NoAuthProbeDAO.java @@ -1,7 +1,7 @@ package com.loafle.overflow.central.module.noauthprobe.dao; import com.loafle.overflow.central.module.domain.model.Domain; -import com.loafle.overflow.central.module.noauthprobe.model.NoAuthProbe; +import com.loafle.overflow.model.noauthprobe.NoAuthProbe; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/com/loafle/overflow/central/module/noauthprobe/model/NoAuthProbe.java b/src/main/java/com/loafle/overflow/central/module/noauthprobe/model/NoAuthProbe.java deleted file mode 100644 index b6ecc12..0000000 --- a/src/main/java/com/loafle/overflow/central/module/noauthprobe/model/NoAuthProbe.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.loafle.overflow.central.module.noauthprobe.model; - - -import com.loafle.overflow.central.module.domain.model.Domain; -import com.loafle.overflow.central.module.meta.model.MetaNoAuthProbeStatus; -import com.loafle.overflow.central.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; -// } -} diff --git a/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeService.java b/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java similarity index 81% rename from src/main/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeService.java rename to src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java index 7b31efa..0866e13 100644 --- a/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeService.java +++ b/src/main/java/com/loafle/overflow/central/module/noauthprobe/service/CentralNoAuthProbeService.java @@ -1,30 +1,34 @@ package com.loafle.overflow.central.module.noauthprobe.service; + +import com.loafle.overflow.model.apikey.ApiKey; +import com.loafle.overflow.model.domain.DomainMember; +import com.loafle.overflow.model.member.Member; +import com.loafle.overflow.model.probe.Probe; +import com.loafle.overflow.model.domain.Domain; +import com.loafle.overflow.model.meta.MetaNoAuthProbeStatus; +import com.loafle.overflow.model.meta.MetaProbeStatus; +import com.loafle.overflow.model.noauthprobe.NoAuthProbe; + import com.loafle.overflow.central.commons.model.SessionMetadata; import com.loafle.overflow.central.commons.service.MessagePublisher; import com.loafle.overflow.central.commons.stereotype.ProbeAPI; import com.loafle.overflow.central.commons.stereotype.WebappAPI; import com.loafle.overflow.central.commons.utils.GenerateKey; -import com.loafle.overflow.central.module.apikey.model.ApiKey; + import com.loafle.overflow.central.module.apikey.service.ApiKeyService; -import com.loafle.overflow.central.module.domain.model.Domain; -import com.loafle.overflow.central.module.domain.model.DomainMember; import com.loafle.overflow.central.module.domain.service.DomainMemberService; -import com.loafle.overflow.central.module.member.model.Member; -import com.loafle.overflow.central.module.member.service.MemberService; -import com.loafle.overflow.central.module.meta.model.MetaNoAuthProbeStatus; -import com.loafle.overflow.central.module.meta.model.MetaProbeStatus; import com.loafle.overflow.central.module.noauthprobe.dao.NoAuthProbeDAO; -import com.loafle.overflow.central.module.noauthprobe.model.NoAuthProbe; -import com.loafle.overflow.central.module.probe.model.Probe; import com.loafle.overflow.central.module.probe.service.ProbeService; +import com.loafle.overflow.core.exception.OverflowException; + +import com.loafle.overflow.service.central.noauthprobe.NoAuthProbeService; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; -import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,7 +38,7 @@ import java.util.UUID; * Created by snoop on 17. 6. 28. */ @Service("NoAuthProbeService") -public class NoAuthProbeService { +public class CentralNoAuthProbeService implements NoAuthProbeService { @Autowired private NoAuthProbeDAO noAuthProbeDAO; @@ -55,7 +59,7 @@ public class NoAuthProbeService { private DomainMemberService domainMemberService; @ProbeAPI - public NoAuthProbe regist(NoAuthProbe noAuthProbe) { + public NoAuthProbe regist(NoAuthProbe noAuthProbe) throws OverflowException { ApiKey apiKey = apiKeyService.readByApiKey(noAuthProbe.getApiKey()); noAuthProbe.setDomain(apiKey.getDomain()); @@ -68,18 +72,17 @@ public class NoAuthProbeService { return this.noAuthProbeDAO.save(noAuthProbe); } - - public List readAllByDomain(Domain domain) { - + @Override + public List readAllByDomain(Domain domain) throws OverflowException { return this.noAuthProbeDAO.findAllByDomain(domain); } - public NoAuthProbe read(long id) { + public NoAuthProbe read(long id) throws OverflowException { return this.noAuthProbeDAO.findOne(id); } @WebappAPI - public List acceptNoAuthProbe(NoAuthProbe noAuthProbe) throws IOException { + public List acceptNoAuthProbe(NoAuthProbe noAuthProbe) throws OverflowException { String memberEmail = SessionMetadata.getTargetID(); // Todo domain injection & member injection @@ -125,7 +128,7 @@ public class NoAuthProbeService { } @WebappAPI - public List denyNoauthProbe(NoAuthProbe noAuthProbe) { + public List denyNoauthProbe(NoAuthProbe noAuthProbe) throws OverflowException{ noAuthProbe.setStatus(new MetaNoAuthProbeStatus((short) 2)); this.noAuthProbeDAO.save(noAuthProbe); @@ -134,7 +137,7 @@ public class NoAuthProbeService { return this.readAllByDomain(noAuthProbe.getDomain()); } - public NoAuthProbe readByTempKey(String tempKey) { + public NoAuthProbe readByTempKey(String tempKey) throws OverflowException { return this.noAuthProbeDAO.findByTempProbeKey(tempKey); } } diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerInputItemServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerInputItemServiceTest.java similarity index 95% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerInputItemServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerInputItemServiceTest.java index 8d7af39..fa0892c 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerInputItemServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerInputItemServiceTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaCrawlerInputItemServiceTest { +public class CentralMetaCrawlerInputItemServiceTest { @Autowired private MetaCrawlerInputItemService crawlerInputItemService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerServiceTest.java similarity index 95% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerServiceTest.java index 5057b6a..9c21c58 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaCrawlerServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaCrawlerServiceTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaCrawlerServiceTest { +public class CentralMetaCrawlerServiceTest { @Autowired private MetaCrawlerService service; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaHistoryTypeServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaHistoryTypeServiceTest.java similarity index 97% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaHistoryTypeServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaHistoryTypeServiceTest.java index 397fafa..6554473 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaHistoryTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaHistoryTypeServiceTest.java @@ -19,7 +19,7 @@ import java.util.List; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) @Ignore -public class MetaHistoryTypeServiceTest { +public class CentralMetaHistoryTypeServiceTest { @Autowired private MetaHistoryTypeService historyTypeService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaInfraTypeServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraTypeServiceTest.java similarity index 89% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaInfraTypeServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraTypeServiceTest.java index 076294e..65a05f7 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaInfraTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraTypeServiceTest.java @@ -18,10 +18,10 @@ import java.util.List; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) @Ignore -public class MetaInfraTypeServiceTest { +public class CentralMetaInfraTypeServiceTest { @Autowired - private MetaInfraTypeService infraTypeService; + private CentralMetaInfraTypeService infraTypeService; @Test public void readAll() throws Exception { diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaInfraVendorServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraVendorServiceTest.java similarity index 84% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaInfraVendorServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraVendorServiceTest.java index da06188..3c7e85d 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaInfraVendorServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInfraVendorServiceTest.java @@ -1,7 +1,5 @@ package com.loafle.overflow.central.module.meta.service; -import com.loafle.overflow.central.module.meta.model.MetaInfraType; -import com.loafle.overflow.central.module.meta.model.MetaInfraVendor; import com.loafle.overflow.central.spring.AppConfigTest; import org.junit.Assert; import org.junit.Test; @@ -19,7 +17,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaInfraVendorServiceTest { +public class CentralMetaInfraVendorServiceTest { @Autowired private MetaInfraVendorService infraVendorService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaInputTypeServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInputTypeServiceTest.java similarity index 95% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaInputTypeServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInputTypeServiceTest.java index a874846..b4e2fd5 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaInputTypeServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaInputTypeServiceTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaInputTypeServiceTest { +public class CentralMetaInputTypeServiceTest { @Autowired private MetaInputTypeService inputTypeService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaMemberStatusServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaMemberStatusServiceTest.java similarity index 94% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaMemberStatusServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaMemberStatusServiceTest.java index e6549f3..60a30b7 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaMemberStatusServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaMemberStatusServiceTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaMemberStatusServiceTest { +public class CentralMetaMemberStatusServiceTest { @Autowired private MetaMemberStatusService memberStatusService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaNoAuthProbeStatusServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaNoAuthProbeStatusServiceTest.java similarity index 94% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaNoAuthProbeStatusServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaNoAuthProbeStatusServiceTest.java index 2bee954..a198dc2 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaNoAuthProbeStatusServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaNoAuthProbeStatusServiceTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaNoAuthProbeStatusServiceTest { +public class CentralMetaNoAuthProbeStatusServiceTest { @Autowired private MetaNoAuthProbeStatusService noAuthProbeStatusService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaProbeArchitectureServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeArchitectureServiceTest.java similarity index 94% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaProbeArchitectureServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeArchitectureServiceTest.java index df95651..3184b8c 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaProbeArchitectureServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeArchitectureServiceTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaProbeArchitectureServiceTest { +public class CentralMetaProbeArchitectureServiceTest { @Autowired private MetaProbeArchitectureService probeArchitectureService; diff --git a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaProbeOsServiceTest.java b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeOsServiceTest.java similarity index 95% rename from src/test/java/com/loafle/overflow/central/module/meta/service/MetaProbeOsServiceTest.java rename to src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeOsServiceTest.java index 94bae79..6637851 100644 --- a/src/test/java/com/loafle/overflow/central/module/meta/service/MetaProbeOsServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/meta/service/CentralMetaProbeOsServiceTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.*; */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {AppConfigTest.class}) -public class MetaProbeOsServiceTest { +public class CentralMetaProbeOsServiceTest { @Autowired private MetaProbeOsService probeOsService;