This commit is contained in:
crusader 2018-06-15 12:41:50 +09:00
parent a50c29cc10
commit 2fd73e60cf
4 changed files with 7 additions and 21 deletions

View File

@ -51,7 +51,7 @@
<dependency> <dependency>
<groupId>com.loafle.overflow</groupId> <groupId>com.loafle.overflow</groupId>
<artifactId>commons-java</artifactId> <artifactId>commons-java</artifactId>
<version>1.0.72-SNAPSHOT</version> <version>1.0.74-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -12,13 +12,9 @@ import org.springframework.stereotype.Repository;
*/ */
@Repository @Repository
public interface InfraHostPortDAO extends JpaRepository<InfraHostPort, Long> { public interface InfraHostPortDAO extends JpaRepository<InfraHostPort, Long> {
List<InfraHostPort> findAllByInfraHostId(Long infraHostId); List<InfraHostPort> findAllByInfraHostIPId(Long infraHostIPId);
List<InfraHostPort> findAllByInfraHostIdAndMetaPortTypeId(Long infraHostId, Short metaPortTypeId); List<InfraHostPort> findAllByInfraHostIPIdAndMetaPortTypeId(Long infraHostIPId, Short metaPortTypeId);
InfraHostPort findByInfraHostIdAndMetaPortTypeKeyAndPort(Long infraHostId, String metaPortTypeKey, Integer port);
InfraHostPort findByInfraHostInfraZoneIdAndMetaPortTypeKeyAndPort(Long infraHostInfraZoneId, String metaPortTypeKey,
Integer port);
InfraHostPort findByInfraHostIPIdAndMetaPortTypeKeyAndPort(Long infraHostIPId, String metaPortTypeKey, Integer port);
} }

View File

@ -68,17 +68,7 @@ public class CentralInfraHostPortService implements InfraHostPortService {
public InfraHostPort readByInfraHostIPIDAndMetaPortTypeKeyAndPort(Long infraHostIPID, String metaPortTypeKey, public InfraHostPort readByInfraHostIPIDAndMetaPortTypeKeyAndPort(Long infraHostIPID, String metaPortTypeKey,
Integer port) throws OverflowException { Integer port) throws OverflowException {
return this.infraHostPortDAO.findByInfraHostIdAndMetaPortTypeKeyAndPort(infraHostIPID, metaPortTypeKey, port); return this.infraHostPortDAO.findByInfraHostIPIdAndMetaPortTypeKeyAndPort(infraHostIPID, metaPortTypeKey, port);
} }
public InfraHostPort readByInfraHostIDAndMetaPortTypeKeyAndPort(Long infraHostID, String metaPortTypeKey,
Integer port) throws OverflowException {
return this.infraHostPortDAO.findByInfraHostIdAndMetaPortTypeKeyAndPort(infraHostID, metaPortTypeKey, port);
}
public InfraHostPort readByInfraHostInfraZoneIDAndMetaPortTypeKeyAndPort(Long infraHostInfraZoneID,
String metaPortTypeKey, Integer port) throws OverflowException {
return this.infraHostPortDAO.findByInfraHostInfraZoneIdAndMetaPortTypeKeyAndPort(infraHostInfraZoneID,
metaPortTypeKey, port);
}
} }

View File

@ -234,8 +234,8 @@ public class CentralInfraService implements InfraService {
} }
infraHostIP = eInfraHostIP; infraHostIP = eInfraHostIP;
InfraHostPort eInfraHostPort = this.infraHostPortService.readByInfraHostIDAndMetaPortTypeKeyAndPort( InfraHostPort eInfraHostPort = this.infraHostPortService.readByInfraHostIPIDAndMetaPortTypeKeyAndPort(
infraHost.getId(), infraHostPort.getMetaPortType().getKey(), infraHostPort.getPort()); infraHostIP.getId(), infraHostPort.getMetaPortType().getKey(), infraHostPort.getPort());
if (null != eInfraHostPort) { if (null != eInfraHostPort) {
throw new OverflowException(String.format("Port[%d(%s)] of Zone[%s].Host[%s(%s)] is not exist", host.getAddress(), throw new OverflowException(String.format("Port[%d(%s)] of Zone[%s].Host[%s(%s)] is not exist", host.getAddress(),
infraHostPort.getMetaPortType().getName(), infraZone.getNetwork(), infraHostIP.getAddress(), infraHostPort.getMetaPortType().getName(), infraZone.getNetwork(), infraHostIP.getAddress(),