Example #1
0
 @Override
 public List<Long> getHostsForSubnet(long subnetId, Long vnetId) {
   return create()
       .select(HOST_VNET_MAP.HOST_ID)
       .from(SUBNET_VNET_MAP)
       .join(VNET)
       .on(VNET.ID.eq(SUBNET_VNET_MAP.VNET_ID))
       .join(HOST_VNET_MAP)
       .on(HOST_VNET_MAP.VNET_ID.eq(VNET.ID))
       .where(
           SUBNET_VNET_MAP
               .SUBNET_ID
               .eq(subnetId)
               .and(vnetCondition(vnetId))
               .and(HOST_VNET_MAP.STATE.eq(CommonStatesConstants.ACTIVE)))
       .fetch(HOST_VNET_MAP.HOST_ID);
 }
Example #2
0
 @Override
 public List<Long> getPhysicalHostsForSubnet(long subnetId, Long vnetId) {
   return create()
       .select(HOST.PHYSICAL_HOST_ID)
       .from(SUBNET_VNET_MAP)
       .join(VNET)
       .on(VNET.ID.eq(SUBNET_VNET_MAP.VNET_ID))
       .join(HOST_VNET_MAP)
       .on(HOST_VNET_MAP.VNET_ID.eq(VNET.ID))
       .join(HOST)
       .on(HOST.ID.eq(HOST_VNET_MAP.HOST_ID))
       .where(
           SUBNET_VNET_MAP
               .SUBNET_ID
               .eq(subnetId)
               .and(HOST_VNET_MAP.STATE.eq(CommonStatesConstants.ACTIVE))
               .and(vnetCondition(vnetId))
               .and(HOST.PHYSICAL_HOST_ID.isNotNull()))
       .fetchInto(Long.class);
 }