This commit is contained in:
geek 2018-04-24 18:36:04 +09:00
parent d86dcc3562
commit b9d7d2f742
69 changed files with 64 additions and 83 deletions

View File

@ -17,7 +17,6 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface HistoryDAO extends JpaRepository<History, Long> { public interface HistoryDAO extends JpaRepository<History, Long> {
Page<History> findAllByProbe(Probe probe, Pageable pageable); Page<History> findAllByProbe(Probe probe, Pageable pageable);
@Query("SELECT h FROM History h WHERE h.probe.id = :#{#probe.id} and h.type.id = :#{#type.id}") @Query("SELECT h FROM History h WHERE h.probe.id = :#{#probe.id} and h.type.id = :#{#type.id}")

View File

@ -15,7 +15,6 @@ import org.springframework.stereotype.Service;
@Service("HistoryService") @Service("HistoryService")
public class CentralHistoryService implements HistoryService { public class CentralHistoryService implements HistoryService {
@Autowired @Autowired
private HistoryDAO historyDAO; private HistoryDAO historyDAO;

View File

@ -29,6 +29,5 @@ public interface InfraDAO extends JpaRepository<Infra, Long> {
List<Target> findAllTargetByProbeList(@Param("probeList") List<Probe> probeList); List<Target> findAllTargetByProbeList(@Param("probeList") List<Probe> probeList);
Infra findByTarget(Target target); Infra findByTarget(Target target);
// List<Infra> findAllByProbe(List<Probe> probeList); // List<Infra> findAllByProbe(List<Probe> probeList);
} }

View File

@ -10,4 +10,5 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface InfraHostDAO extends JpaRepository<InfraHost, Long> { public interface InfraHostDAO extends JpaRepository<InfraHost, Long> {
InfraHost findByIp(long ip); InfraHost findByIp(long ip);
} }

View File

@ -9,4 +9,5 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraMachineDAO extends JpaRepository<InfraMachine, Long> { public interface InfraMachineDAO extends JpaRepository<InfraMachine, Long> {
} }

View File

@ -9,4 +9,5 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraOSApplicationDAO extends JpaRepository<InfraOSApplication, Long> { public interface InfraOSApplicationDAO extends JpaRepository<InfraOSApplication, Long> {
} }

View File

@ -9,4 +9,5 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraOSDAO extends JpaRepository<InfraOS, Long> { public interface InfraOSDAO extends JpaRepository<InfraOS, Long> {
} }

View File

@ -9,4 +9,5 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraOSDaemonDAO extends JpaRepository<InfraOSDaemon, Long> { public interface InfraOSDaemonDAO extends JpaRepository<InfraOSDaemon, Long> {
} }

View File

@ -11,7 +11,6 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraOSPortDAO extends JpaRepository<InfraOSPort, Long> { public interface InfraOSPortDAO extends JpaRepository<InfraOSPort, Long> {
@Query("SELECT p from com.loafle.overflow.central.module.infra.model.InfraOSPort p WHERE p.os.id = (:osId) AND p.port = (:portNumber) AND p.portType = (:portType)") @Query("SELECT p from com.loafle.overflow.central.module.infra.model.InfraOSPort p WHERE p.os.id = (:osId) AND p.port = (:portNumber) AND p.portType = (:portType)")
InfraOSPort findByPort(@Param("osId") long osId,@Param("portNumber") int portNumber,@Param("portType") String portType); InfraOSPort findByPort(@Param("osId") long osId,@Param("portNumber") int portNumber,@Param("portType") String portType);
} }

View File

@ -11,7 +11,6 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraServiceDAO extends JpaRepository<InfraService, Long> { public interface InfraServiceDAO extends JpaRepository<InfraService, Long> {
@Query("SELECT ins from com.loafle.overflow.central.module.infra.model.InfraService ins WHERE ins.host.id = (:hostId) AND ins.port = (:portNumber) AND ins.portType = (:portType)") @Query("SELECT ins from com.loafle.overflow.central.module.infra.model.InfraService ins WHERE ins.host.id = (:hostId) AND ins.port = (:portNumber) AND ins.portType = (:portType)")
InfraService findByService(@Param("hostId") long hostId,@Param("portNumber") int portNumber,@Param("portType") String portType); InfraService findByService(@Param("hostId") long hostId,@Param("portNumber") int portNumber,@Param("portType") String portType);
} }

View File

@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
@Service("InfraHostService") @Service("InfraHostService")
public class CentralInfraHostService implements InfraHostService { public class CentralInfraHostService implements InfraHostService {
@Autowired @Autowired
InfraHostDAO infraHostDAO; InfraHostDAO infraHostDAO;

View File

@ -22,5 +22,4 @@ public class CentralInfraMachineService implements InfraMachineService {
public InfraMachine read(long id) { public InfraMachine read(long id) {
return this.infraMachineDAO.findOne(id); return this.infraMachineDAO.findOne(id);
} }
} }

View File

@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
@Service("InfraOSApplicationService") @Service("InfraOSApplicationService")
public class CentralInfraOSApplicationService implements InfraOSApplicationService { public class CentralInfraOSApplicationService implements InfraOSApplicationService {
@Autowired @Autowired
InfraOSApplicationDAO infraOSApplicationDAO; InfraOSApplicationDAO infraOSApplicationDAO;

View File

@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
@Service("InfraOSDaemonService") @Service("InfraOSDaemonService")
public class CentralInfraOSDaemonService implements InfraOSDaemonService { public class CentralInfraOSDaemonService implements InfraOSDaemonService {
@Autowired @Autowired
InfraOSDaemonDAO infraOSDaemonDAO; InfraOSDaemonDAO infraOSDaemonDAO;

View File

@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
@Service("InfraOSPortService") @Service("InfraOSPortService")
public class CentralInfraOSPortService implements InfraOSPortService { public class CentralInfraOSPortService implements InfraOSPortService {
@Autowired @Autowired
InfraOSPortDAO infraOSPortDAO; InfraOSPortDAO infraOSPortDAO;

View File

@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
@Service("InfraOSService") @Service("InfraOSService")
public class CentralInfraOSService implements InfraOSService { public class CentralInfraOSService implements InfraOSService {
@Autowired @Autowired
InfraOSDAO infraOSDAO; InfraOSDAO infraOSDAO;

View File

@ -1,17 +1,17 @@
package com.loafle.overflow.central.module.infra.service; package com.loafle.overflow.central.module.infra.service;
import com.loafle.overflow.central.commons.model.PageParams;
import com.loafle.overflow.central.commons.utils.PageUtil; 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.dao.InfraDAO;
import com.loafle.overflow.central.module.probe.exception.ProbeNotFoundException; import com.loafle.overflow.central.module.probe.exception.ProbeNotFoundException;
import com.loafle.overflow.core.model.PageParams;
import com.loafle.overflow.model.domain.Domain;
import com.loafle.overflow.model.probe.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.sensor.dao.SensorDAO;
import com.loafle.overflow.model.target.Target; import com.loafle.overflow.model.target.Target;
import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.model.infra.Infra; import com.loafle.overflow.model.infra.Infra;
import com.loafle.overflow.model.infra.InfraService; import com.loafle.overflow.service.central.infra.InfraService;
import com.loafle.overflow.service.central.probe.ProbeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -52,7 +52,7 @@ public class CentralInfraService implements InfraService {
List<Probe> probeList = this.probeService.readAllByDomain(domain); List<Probe> probeList = this.probeService.readAllByDomain(domain);
if(probeList == null || probeList.size() <= 0) { if(probeList == null || probeList.size() <= 0) {
throw new ProbeNotFoundException(); throw new OverflowException("ProbeNotFoundException", new Throwable());
} }
Page<Infra> infraList = this.infraDAO.findAllByProbeList(probeList, PageUtil.getPageRequest(pageParams)); Page<Infra> infraList = this.infraDAO.findAllByProbeList(probeList, PageUtil.getPageRequest(pageParams));
@ -68,7 +68,7 @@ public class CentralInfraService implements InfraService {
List<Probe> probeList = this.probeService.readAllByDomain(domain); List<Probe> probeList = this.probeService.readAllByDomain(domain);
if(probeList == null || probeList.size() <= 0) { if(probeList == null || probeList.size() <= 0) {
throw new ProbeNotFoundException(); throw new OverflowException("ProbeNotFoundException", new Throwable());
} }
return this.infraDAO.findAllTargetByProbeList(probeList); return this.infraDAO.findAllTargetByProbeList(probeList);

View File

@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
*/ */
@Service("InfraServiceService") @Service("InfraServiceService")
public class CentralInfraServiceService implements InfraServiceService { public class CentralInfraServiceService implements InfraServiceService {
@Autowired @Autowired
InfraServiceDAO infraServiceDAO; InfraServiceDAO infraServiceDAO;

View File

@ -9,6 +9,7 @@ import org.springframework.stereotype.Repository;
/** /**
* Created by insanity on 17. 5. 25. * Created by insanity on 17. 5. 25.
*/ */
@Repository @Repository
public interface MemberDAO extends JpaRepository<Member, Long> { public interface MemberDAO extends JpaRepository<Member, Long> {
@Query("select m from Member m WHERE m.email = :signinId") @Query("select m from Member m WHERE m.email = :signinId")

View File

@ -15,6 +15,5 @@ public interface MemberTotpDAO extends JpaRepository<MemberTotp, Long> {
@Query("select m from MemberTotp m WHERE m.secretCode = :secretCode") @Query("select m from MemberTotp m WHERE m.secretCode = :secretCode")
MemberTotp findBySecretCode(@Param("secretCode") String secretCode); MemberTotp findBySecretCode(@Param("secretCode") String secretCode);
MemberTotp findByMember(Member member); MemberTotp findByMember(Member member);
} }

View File

@ -1,30 +1,29 @@
package com.loafle.overflow.central.module.member.service; package com.loafle.overflow.central.module.member.service;
import com.loafle.overflow.central.commons.model.SessionMetadata;
import com.loafle.overflow.central.commons.stereotype.WebappAPI; import com.loafle.overflow.central.commons.stereotype.WebappAPI;
import com.loafle.overflow.central.commons.utils.EmailSender; 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.service.DomainMemberService;
import com.loafle.overflow.central.module.email.service.EmailAuthService; 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.dao.MemberDAO;
import com.loafle.overflow.central.module.member.exception.*; import com.loafle.overflow.central.module.member.exception.*;
import com.loafle.overflow.central.module.probe.service.ProbeService;
import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.model.apikey.ApiKey;
import com.loafle.overflow.model.domain.Domain; import com.loafle.overflow.model.domain.Domain;
import com.loafle.overflow.model.domain.DomainMember; import com.loafle.overflow.model.domain.DomainMember;
import com.loafle.overflow.model.member.Member; import com.loafle.overflow.model.member.Member;
import com.loafle.overflow.model.probe.Probe; import com.loafle.overflow.model.probe.Probe;
import com.loafle.overflow.model.meta.MetaMemberStatus; import com.loafle.overflow.model.meta.MetaMemberStatus;
import com.loafle.overflow.service.central.apikey.ApiKeyService;
import com.loafle.overflow.service.central.domain.DomainMemberService;
import com.loafle.overflow.service.central.member.MemberService; import com.loafle.overflow.service.central.member.MemberService;
import com.loafle.overflow.service.central.probe.ProbeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailException; import org.springframework.mail.MailException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -60,21 +59,21 @@ public class CentralMemberService implements MemberService {
Member m = this.memberDAO.findByEmail(signinId); Member m = this.memberDAO.findByEmail(signinId);
if ( null == m ) { if ( null == m ) {
throw new SignInIdNotExistException(); throw new OverflowException("SignInIdNotExistException()", new Throwable());
} }
if ( m.getStatus().getId() == 1 ) { if ( m.getStatus().getId() == 1 ) {
throw new EmailNotConfirmedException(); throw new OverflowException("EmailNotConfirmedException()", new Throwable());
} }
Boolean match = passwordEncoder.matches(signinPw, m.getPw()); Boolean match = passwordEncoder.matches(signinPw, m.getPw());
if(!match) { if(!match) {
if (m.getSigninFailCount() > 10) { if (m.getSigninFailCount() > 10) {
throw new SigninOverFailedException("Login failed 10 times"); throw new OverflowException("SigninOverFailedException()", new Throwable());
} }
m.setSigninFailCount(m.getSigninFailCount()+1); m.setSigninFailCount(m.getSigninFailCount()+1);
this.modify(m); this.modify(m);
throw new SignInPwNotMatchException(); throw new OverflowException("SignInPwNotMatchException()", new Throwable());
} }
m.setSigninFailCount(0); m.setSigninFailCount(0);
@ -91,16 +90,17 @@ public class CentralMemberService implements MemberService {
Member isMember = this.memberDAO.findByEmail(member.getEmail()); Member isMember = this.memberDAO.findByEmail(member.getEmail());
if (null != isMember && isMember.getId() > 0) { if (null != isMember && isMember.getId() > 0) {
throw new JoinedEmailException(); throw new OverflowException("JoinedEmailException()", new Throwable());
} }
boolean checkPass = this.isPasswordStrong(pw); boolean checkPass = this.isPasswordStrong(pw);
if (!checkPass) { if (!checkPass) {
throw new PasswordNotStrongException( throw new OverflowException("PasswordNotStrongException()", new Throwable());
"Passwords must contain at least one uppercase letter, " + // (
"special character, lowercase letter, and number, " + // "Passwords must contain at least one uppercase letter, " +
"and must be at least 6 characters long."); // "special character, lowercase letter, and number, " +
// "and must be at least 6 characters long.");
} }
member.setPw(passwordEncoder.encode(pw)); member.setPw(passwordEncoder.encode(pw));
@ -112,7 +112,7 @@ public class CentralMemberService implements MemberService {
try { try {
this.emailAuthService.sendEmailByMember(member.getId(), member.getEmail()); this.emailAuthService.sendEmailByMember(member.getId(), member.getEmail());
} catch (MailException e) { } catch (Exception e) {
// Todo ReSend Mail // Todo ReSend Mail
e.printStackTrace(); e.printStackTrace();
} }
@ -124,7 +124,7 @@ public class CentralMemberService implements MemberService {
Member member = this.memberDAO.findByEmail(email); Member member = this.memberDAO.findByEmail(email);
if (null == member) { if (null == member) {
throw new SignInIdNotExistException(); throw new OverflowException("SignInIdNotExistException()", new Throwable());
} }
try { try {
@ -138,7 +138,13 @@ public class CentralMemberService implements MemberService {
} }
public Member resetPassword(String encodeEmail, String pw) throws OverflowException { public Member resetPassword(String encodeEmail, String pw) throws OverflowException {
String deStr = URLDecoder.decode(encodeEmail, "UTF-8"); String deStr = null;
try {
deStr = URLDecoder.decode(encodeEmail, "UTF-8");
}catch (Exception e) {
}
String deEmail = this.emailSender.decrypt(deStr); String deEmail = this.emailSender.decrypt(deStr);
Member member = this.memberDAO.findByEmail(deEmail); Member member = this.memberDAO.findByEmail(deEmail);
@ -150,10 +156,10 @@ public class CentralMemberService implements MemberService {
boolean checkPass = this.isPasswordStrong(pw); boolean checkPass = this.isPasswordStrong(pw);
if (!checkPass) { if (!checkPass) {
throw new PasswordNotStrongException( throw new OverflowException("PasswordNotStrongException()", new Throwable());
"Passwords must contain at least one uppercase letter, " + // "Passwords must contain at least one uppercase letter, " +
"special character, lowercase letter, and number, " + // "special character, lowercase letter, and number, " +
"and must be at least 6 characters long."); // "and must be at least 6 characters long.");
} }
member.setPw(passwordEncoder.encode(pw)); member.setPw(passwordEncoder.encode(pw));
@ -173,10 +179,10 @@ public class CentralMemberService implements MemberService {
boolean checkPass = this.isPasswordStrong(pw); boolean checkPass = this.isPasswordStrong(pw);
if (!checkPass) { if (!checkPass) {
throw new PasswordNotStrongException( throw new OverflowException("PasswordNotStrongException()", new Throwable());
"Passwords must contain at least one uppercase letter, " + // "Passwords must contain at least one uppercase letter, " +
"special character, lowercase letter, and number, " + // "special character, lowercase letter, and number, " +
"and must be at least 6 characters long."); // "and must be at least 6 characters long.");
} }
Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw()); Boolean match = passwordEncoder.matches(member.getPw(), preMember.getPw());
@ -204,7 +210,7 @@ public class CentralMemberService implements MemberService {
Boolean match = passwordEncoder.matches(encodePw, preMember.getPw()); Boolean match = passwordEncoder.matches(encodePw, preMember.getPw());
if (!match) { if (!match) {
throw new SignInPwNotMatchException(); throw new OverflowException("SignInPwNotMatchException", new Throwable());
} }
return preMember; return preMember;
@ -214,7 +220,7 @@ public class CentralMemberService implements MemberService {
Member preMember = this.memberDAO.findByEmail(signinId); Member preMember = this.memberDAO.findByEmail(signinId);
if (null == preMember) { if (null == preMember) {
throw new SignInIdNotExistException(); throw new OverflowException("SignInIdNotExistException()", new Throwable());
} }
Member cMember = this.modify(preMember, newPw); Member cMember = this.modify(preMember, newPw);
@ -224,7 +230,7 @@ public class CentralMemberService implements MemberService {
public Member read(long memberId) throws OverflowException { public Member read(long memberId) throws OverflowException {
if (memberId <= 0) { if (memberId <= 0) {
throw new SignInIdNotExistException(); throw new OverflowException("SignInIdNotExistException()", new Throwable());
} }
Member resMember = this.memberDAO.findOne(memberId); Member resMember = this.memberDAO.findOne(memberId);

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaCrawlerDAO extends JpaRepository<MetaCrawler, Short> { public interface MetaCrawlerDAO extends JpaRepository<MetaCrawler, Short> {
} }

View File

@ -12,6 +12,5 @@ import java.util.List;
*/ */
@Repository @Repository
public interface MetaCrawlerInputItemDAO extends JpaRepository<MetaCrawlerInputItem, Integer> { public interface MetaCrawlerInputItemDAO extends JpaRepository<MetaCrawlerInputItem, Integer> {
List<MetaCrawlerInputItem> findAllByCrawler(MetaCrawler crawler); List<MetaCrawlerInputItem> findAllByCrawler(MetaCrawler crawler);
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaHistoryTypeDAO extends JpaRepository<MetaHistoryType, Integer> { public interface MetaHistoryTypeDAO extends JpaRepository<MetaHistoryType, Integer> {
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaInfraTypeDAO extends JpaRepository<MetaInfraType, Integer> { public interface MetaInfraTypeDAO extends JpaRepository<MetaInfraType, Integer> {
} }

View File

@ -12,6 +12,5 @@ import java.util.List;
*/ */
@Repository @Repository
public interface MetaInfraVendorDAO extends JpaRepository<MetaInfraVendor, Integer> { public interface MetaInfraVendorDAO extends JpaRepository<MetaInfraVendor, Integer> {
List<MetaInfraVendor> findAllByInfraType(MetaInfraType infraType); List<MetaInfraVendor> findAllByInfraType(MetaInfraType infraType);
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaInputTypeDAO extends JpaRepository<MetaInputType, Short> { public interface MetaInputTypeDAO extends JpaRepository<MetaInputType, Short> {
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaMemberStatusDAO extends JpaRepository<MetaMemberStatus, Short> { public interface MetaMemberStatusDAO extends JpaRepository<MetaMemberStatus, Short> {
} }

View File

@ -9,4 +9,5 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaNoAuthProbeStatusDAO extends JpaRepository<MetaNoAuthProbeStatus, Short> { public interface MetaNoAuthProbeStatusDAO extends JpaRepository<MetaNoAuthProbeStatus, Short> {
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaNotificationDAO extends JpaRepository<MetaNotification, Long> { public interface MetaNotificationDAO extends JpaRepository<MetaNotification, Long> {
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaProbeArchitectureDAO extends JpaRepository<MetaProbeArchitecture, Short> { public interface MetaProbeArchitectureDAO extends JpaRepository<MetaProbeArchitecture, Short> {
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaProbeOsDAO extends JpaRepository<MetaProbeOs, Short> { public interface MetaProbeOsDAO extends JpaRepository<MetaProbeOs, Short> {
} }

View File

@ -12,6 +12,5 @@ import java.util.List;
*/ */
@Repository @Repository
public interface MetaProbePackageDAO extends JpaRepository<MetaProbePackage, Long> { public interface MetaProbePackageDAO extends JpaRepository<MetaProbePackage, Long> {
List<MetaProbePackage> findAllByOs(MetaProbeOs metaProbeOs); List<MetaProbePackage> findAllByOs(MetaProbeOs metaProbeOs);
} }

View File

@ -10,3 +10,4 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface MetaProbeStatusDAO extends JpaRepository<MetaProbeStatus, Short> { public interface MetaProbeStatusDAO extends JpaRepository<MetaProbeStatus, Short> {
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaProbeTaskTypeDAO extends JpaRepository<MetaProbeTaskType, Short>{ public interface MetaProbeTaskTypeDAO extends JpaRepository<MetaProbeTaskType, Short>{
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaProbeVersionDAO extends JpaRepository<MetaProbeVersion, Short>{ public interface MetaProbeVersionDAO extends JpaRepository<MetaProbeVersion, Short>{
} }

View File

@ -13,5 +13,4 @@ import java.util.List;
@Repository @Repository
public interface MetaSensorDisplayItemDAO extends JpaRepository<MetaSensorDisplayItem, Long> { public interface MetaSensorDisplayItemDAO extends JpaRepository<MetaSensorDisplayItem, Long> {
public List<MetaSensorDisplayItem> findAllByCrawler(MetaCrawler crawler); public List<MetaSensorDisplayItem> findAllByCrawler(MetaCrawler crawler);
} }

View File

@ -15,7 +15,6 @@ import java.util.List;
*/ */
@Repository @Repository
public interface MetaSensorDisplayMappingDAO extends JpaRepository<MetaSensorDisplayMapping, Short> { public interface MetaSensorDisplayMappingDAO extends JpaRepository<MetaSensorDisplayMapping, Short> {
@Query("SELECT m.itemKey from MetaSensorDisplayMapping m where m.displayItem = (:displayItem)") @Query("SELECT m.itemKey from MetaSensorDisplayMapping m where m.displayItem = (:displayItem)")
public List<MetaSensorItemKey> findAllByDisplayItem(@Param("displayItem") MetaSensorDisplayItem displayItem); public List<MetaSensorItemKey> findAllByDisplayItem(@Param("displayItem") MetaSensorDisplayItem displayItem);
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaSensorItemDAO extends JpaRepository<MetaSensorItem, Integer>{ public interface MetaSensorItemDAO extends JpaRepository<MetaSensorItem, Integer>{
} }

View File

@ -12,7 +12,6 @@ import java.util.List;
*/ */
@Repository @Repository
public interface MetaSensorItemKeyDAO extends JpaRepository<MetaSensorItemKey, Long> { public interface MetaSensorItemKeyDAO extends JpaRepository<MetaSensorItemKey, Long> {
// @Query("SELECT msik.item.id, msik.key from MetaSensorItemKey msik WHERE msik.crawler.id = (:metaCrawler.id)") // @Query("SELECT msik.item.id, msik.key from MetaSensorItemKey msik WHERE msik.crawler.id = (:metaCrawler.id)")
List<MetaSensorItemKey> findAllByCrawler(MetaCrawler metaCrawler); List<MetaSensorItemKey> findAllByCrawler(MetaCrawler metaCrawler);
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaSensorItemTypeDAO extends JpaRepository<MetaSensorItemType, Short>{ public interface MetaSensorItemTypeDAO extends JpaRepository<MetaSensorItemType, Short>{
} }

View File

@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
/** /**
* Created by insanity on 17. 9. 20. * Created by insanity on 17. 9. 20.
*/ */
@Repository @Repository
public interface MetaSensorItemUnitDAO extends JpaRepository<MetaSensorItemUnit, Short> { public interface MetaSensorItemUnitDAO extends JpaRepository<MetaSensorItemUnit, Short> {
} }

View File

@ -7,6 +7,7 @@ import org.springframework.stereotype.Repository;
/** /**
* Created by snoop on 17. 6. 26. * Created by snoop on 17. 6. 26.
*/ */
@Repository @Repository
public interface MetaSensorStatusDAO extends JpaRepository<MetaSensorStatus, Short> { public interface MetaSensorStatusDAO extends JpaRepository<MetaSensorStatus, Short> {
} }

View File

@ -12,6 +12,5 @@ import java.util.List;
*/ */
@Repository @Repository
public interface MetaVendorCrawlerDAO extends JpaRepository<MetaVendorCrawler, Integer>{ public interface MetaVendorCrawlerDAO extends JpaRepository<MetaVendorCrawler, Integer>{
List<MetaVendorCrawler> findAllByInfraVendor(MetaInfraVendor infraVendor); List<MetaVendorCrawler> findAllByInfraVendor(MetaInfraVendor infraVendor);
} }

View File

@ -9,5 +9,4 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface MetaVendorCrawlerSensorItemDAO extends JpaRepository<MetaVendorCrawlerSensorItem, Long>{ public interface MetaVendorCrawlerSensorItemDAO extends JpaRepository<MetaVendorCrawlerSensorItem, Long>{
} }

View File

@ -22,5 +22,4 @@ public class CentralMetaCrawlerInputItemService implements MetaCrawlerInputItemS
public List<MetaCrawlerInputItem> readAllByMetaCrawler(MetaCrawler metaCrawler) throws OverflowException { public List<MetaCrawlerInputItem> readAllByMetaCrawler(MetaCrawler metaCrawler) throws OverflowException {
return this.crawlerInputItemDAO.findAllByCrawler(metaCrawler); return this.crawlerInputItemDAO.findAllByCrawler(metaCrawler);
} }
} }

View File

@ -1,6 +1,7 @@
package com.loafle.overflow.central.module.meta.service; package com.loafle.overflow.central.module.meta.service;
import com.loafle.overflow.central.module.meta.dao.MetaCrawlerDAO; import com.loafle.overflow.central.module.meta.dao.MetaCrawlerDAO;
import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.model.meta.MetaCrawler; import com.loafle.overflow.model.meta.MetaCrawler;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -16,7 +17,7 @@ public class CentralMetaCrawlerService {
@Autowired @Autowired
private MetaCrawlerDAO crawlerDAO; private MetaCrawlerDAO crawlerDAO;
public List<MetaCrawler> readAll() { public List<MetaCrawler> readAll() throws OverflowException {
return this.crawlerDAO.findAll(); return this.crawlerDAO.findAll();
} }
} }

View File

@ -12,6 +12,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaHistoryTypeService") @Service("MetaHistoryTypeService")
public class CentralMetaHistoryTypeService implements MetaHistoryTypeService { public class CentralMetaHistoryTypeService implements MetaHistoryTypeService {

View File

@ -12,6 +12,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaInfraTypeService") @Service("MetaInfraTypeService")
public class CentralMetaInfraTypeService implements MetaInfraTypeService { public class CentralMetaInfraTypeService implements MetaInfraTypeService {

View File

@ -13,6 +13,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaInfraVendorService") @Service("MetaInfraVendorService")
public class CentralMetaInfraVendorService implements MetaInfraVendorService { public class CentralMetaInfraVendorService implements MetaInfraVendorService {

View File

@ -21,5 +21,4 @@ public class CentralMetaInputTypeService implements MetaInputTypeService {
public List<MetaInputType> readAll() throws OverflowException { public List<MetaInputType> readAll() throws OverflowException {
return this.inputTypeDAO.findAll(); return this.inputTypeDAO.findAll();
} }
} }

View File

@ -21,5 +21,4 @@ public class CentralMetaMemberStatusService implements MetaMemberStatusService {
public List<MetaMemberStatus> readAll() throws OverflowException { public List<MetaMemberStatus> readAll() throws OverflowException {
return this.memberStatusDAO.findAll(); return this.memberStatusDAO.findAll();
} }
} }

View File

@ -12,6 +12,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaNoAuthProbeStatusService") @Service("MetaNoAuthProbeStatusService")
public class CentralMetaNoAuthProbeStatusService implements MetaNoAuthProbeStatusService { public class CentralMetaNoAuthProbeStatusService implements MetaNoAuthProbeStatusService {
@Autowired @Autowired

View File

@ -21,5 +21,4 @@ public class CentralMetaProbeArchitectureService implements MetaProbeArchitectur
public List<MetaProbeArchitecture> readAll() throws OverflowException { public List<MetaProbeArchitecture> readAll() throws OverflowException {
return this.probeArchitectureDAO.findAll(); return this.probeArchitectureDAO.findAll();
} }
} }

View File

@ -21,5 +21,4 @@ public class CentralMetaProbeOsService implements MetaProbeOsService {
public List<MetaProbeOs> readAll() throws OverflowException { public List<MetaProbeOs> readAll() throws OverflowException {
return this.probeOsDAO.findAll(); return this.probeOsDAO.findAll();
} }
} }

View File

@ -22,5 +22,4 @@ public class CentralMetaProbePackageService implements MetaProbePackageService {
public List<MetaProbePackage> readAllByOs(MetaProbeOs metaProbeOs) throws OverflowException { public List<MetaProbePackage> readAllByOs(MetaProbeOs metaProbeOs) throws OverflowException {
return this.probePackageDAO.findAllByOs(metaProbeOs); return this.probePackageDAO.findAllByOs(metaProbeOs);
} }
} }

View File

@ -21,5 +21,4 @@ public class CentralMetaProbeStatusService implements MetaProbeStatusService {
public List<MetaProbeStatus> readAll() throws OverflowException { public List<MetaProbeStatus> readAll() throws OverflowException {
return this.probeStatusDAO.findAll(); return this.probeStatusDAO.findAll();
} }
} }

View File

@ -12,6 +12,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaProbeTaskTypeService") @Service("MetaProbeTaskTypeService")
public class CentralMetaProbeTaskTypeService implements MetaProbeTaskTypeService { public class CentralMetaProbeTaskTypeService implements MetaProbeTaskTypeService {

View File

@ -11,6 +11,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaProbeVersionService") @Service("MetaProbeVersionService")
public class CentralMetaProbeVersionService implements MetaProbeVersionService { public class CentralMetaProbeVersionService implements MetaProbeVersionService {

View File

@ -13,7 +13,6 @@ import java.util.List;
/** /**
* Created by insanity on 17. 9. 20. * Created by insanity on 17. 9. 20.
*/ */
@Service("MetaSensorDisplayItemService") @Service("MetaSensorDisplayItemService")
public class CentralMetaSensorDisplayItemService implements MetaSensorDisplayItemService { public class CentralMetaSensorDisplayItemService implements MetaSensorDisplayItemService {
@Autowired @Autowired

View File

@ -26,5 +26,4 @@ public class CentralMetaSensorDisplayMappingService implements MetaSensorDisplay
public List<MetaSensorItemKey> findAllByDisplayItem(MetaSensorDisplayItem displayItem) throws OverflowException { public List<MetaSensorItemKey> findAllByDisplayItem(MetaSensorDisplayItem displayItem) throws OverflowException {
return this.mappingDAO.findAllByDisplayItem(displayItem); return this.mappingDAO.findAllByDisplayItem(displayItem);
} }
} }

View File

@ -15,6 +15,7 @@ import java.util.Map;
/** /**
* Created by snoop on 17. 8. 29. * Created by snoop on 17. 8. 29.
*/ */
@Service("MetaSensorItemKeyService") @Service("MetaSensorItemKeyService")
public class CentralMetaSensorItemKeyService implements MetaSensorItemKeyService { public class CentralMetaSensorItemKeyService implements MetaSensorItemKeyService {

View File

@ -22,5 +22,4 @@ public class CentralMetaSensorItemService implements MetaSensorItemService {
public List<MetaSensorItem> readAll() throws OverflowException { public List<MetaSensorItem> readAll() throws OverflowException {
return this.metaSensorItemDAO.findAll(); return this.metaSensorItemDAO.findAll();
} }
} }

View File

@ -12,6 +12,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaSensorItemTypeService") @Service("MetaSensorItemTypeService")
public class CentralMetaSensorItemTypeService implements MetaSensorItemTypeService { public class CentralMetaSensorItemTypeService implements MetaSensorItemTypeService {

View File

@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
/** /**
* Created by insanity on 17. 9. 20. * Created by insanity on 17. 9. 20.
*/ */
@Service("MetaSensorItemUnitService") @Service("MetaSensorItemUnitService")
public class CentralMetaSensorItemUnitService implements MetaSensorItemUnitService { public class CentralMetaSensorItemUnitService implements MetaSensorItemUnitService {
@Autowired @Autowired

View File

@ -21,5 +21,4 @@ public class CentralMetaSensorStatusService implements MetaSensorStatusService {
public List<MetaSensorStatus> readAll() throws OverflowException { public List<MetaSensorStatus> readAll() throws OverflowException {
return this.sensorStatusDAO.findAll(); return this.sensorStatusDAO.findAll();
} }
} }

View File

@ -8,6 +8,4 @@ import org.springframework.stereotype.Service;
*/ */
@Service("MetaVendorCrawlerSensorItemService") @Service("MetaVendorCrawlerSensorItemService")
public class CentralMetaVendorCrawlerSensorItemService implements MetaVendorCrawlerSensorItemService { public class CentralMetaVendorCrawlerSensorItemService implements MetaVendorCrawlerSensorItemService {
} }

View File

@ -13,6 +13,7 @@ import java.util.List;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@Service("MetaVendorCrawlerService") @Service("MetaVendorCrawlerService")
public class CentralMetaVendorCrawlerService implements MetaVendorCrawlerService { public class CentralMetaVendorCrawlerService implements MetaVendorCrawlerService {

View File

@ -1,11 +1,9 @@
package com.loafle.overflow.central.module.noauthprobe.service; package com.loafle.overflow.central.module.noauthprobe.service;
import com.loafle.overflow.central.commons.model.SessionMetadata;
import com.loafle.overflow.central.commons.service.MessagePublisher; import com.loafle.overflow.central.commons.service.MessagePublisher;
import com.loafle.overflow.central.commons.stereotype.ProbeAPI; import com.loafle.overflow.central.commons.stereotype.ProbeAPI;
import com.loafle.overflow.central.commons.stereotype.WebappAPI; import com.loafle.overflow.central.commons.stereotype.WebappAPI;
import com.loafle.overflow.central.commons.utils.GenerateKey; import com.loafle.overflow.central.commons.utils.GenerateKey;
import com.loafle.overflow.central.module.member.service.MemberService;
import com.loafle.overflow.central.module.noauthprobe.dao.NoAuthProbeDAO; import com.loafle.overflow.central.module.noauthprobe.dao.NoAuthProbeDAO;
import com.loafle.overflow.core.exception.OverflowException; import com.loafle.overflow.core.exception.OverflowException;
import com.loafle.overflow.model.apikey.ApiKey; import com.loafle.overflow.model.apikey.ApiKey;