ing
This commit is contained in:
parent
a50c29cc10
commit
2fd73e60cf
2
pom.xml
2
pom.xml
|
@ -51,7 +51,7 @@
|
|||
<dependency>
|
||||
<groupId>com.loafle.overflow</groupId>
|
||||
<artifactId>commons-java</artifactId>
|
||||
<version>1.0.72-SNAPSHOT</version>
|
||||
<version>1.0.74-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -12,13 +12,9 @@ import org.springframework.stereotype.Repository;
|
|||
*/
|
||||
@Repository
|
||||
public interface InfraHostPortDAO extends JpaRepository<InfraHostPort, Long> {
|
||||
List<InfraHostPort> findAllByInfraHostId(Long infraHostId);
|
||||
List<InfraHostPort> findAllByInfraHostIPId(Long infraHostIPId);
|
||||
|
||||
List<InfraHostPort> findAllByInfraHostIdAndMetaPortTypeId(Long infraHostId, Short metaPortTypeId);
|
||||
|
||||
InfraHostPort findByInfraHostIdAndMetaPortTypeKeyAndPort(Long infraHostId, String metaPortTypeKey, Integer port);
|
||||
|
||||
InfraHostPort findByInfraHostInfraZoneIdAndMetaPortTypeKeyAndPort(Long infraHostInfraZoneId, String metaPortTypeKey,
|
||||
Integer port);
|
||||
List<InfraHostPort> findAllByInfraHostIPIdAndMetaPortTypeId(Long infraHostIPId, Short metaPortTypeId);
|
||||
|
||||
InfraHostPort findByInfraHostIPIdAndMetaPortTypeKeyAndPort(Long infraHostIPId, String metaPortTypeKey, Integer port);
|
||||
}
|
|
@ -68,17 +68,7 @@ public class CentralInfraHostPortService implements InfraHostPortService {
|
|||
|
||||
public InfraHostPort readByInfraHostIPIDAndMetaPortTypeKeyAndPort(Long infraHostIPID, String metaPortTypeKey,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,8 +234,8 @@ public class CentralInfraService implements InfraService {
|
|||
}
|
||||
infraHostIP = eInfraHostIP;
|
||||
|
||||
InfraHostPort eInfraHostPort = this.infraHostPortService.readByInfraHostIDAndMetaPortTypeKeyAndPort(
|
||||
infraHost.getId(), infraHostPort.getMetaPortType().getKey(), infraHostPort.getPort());
|
||||
InfraHostPort eInfraHostPort = this.infraHostPortService.readByInfraHostIPIDAndMetaPortTypeKeyAndPort(
|
||||
infraHostIP.getId(), infraHostPort.getMetaPortType().getKey(), infraHostPort.getPort());
|
||||
if (null != eInfraHostPort) {
|
||||
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(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user