private boolean routeTableExistsForDelete(ServiceConfiguration configuration) throws Exception { DescribeRouteTablesType describeRouteTablesType = MessageHelper.createMessage(DescribeRouteTablesType.class, info.getEffectiveUserId()); describeRouteTablesType .getFilterSet() .add(Filter.filter("route-table-id", properties.getRouteTableId())); DescribeRouteTablesResponseType describeRouteTablesResponseType = AsyncRequests.sendSync(configuration, describeRouteTablesType); if (describeRouteTablesResponseType.getRouteTableSet() == null || describeRouteTablesResponseType.getRouteTableSet().getItem() == null || describeRouteTablesResponseType.getRouteTableSet().getItem().isEmpty()) { return false; } return true; }
private void checkRouteTableExists(ServiceConfiguration configuration) throws Exception { DescribeRouteTablesType describeRouteTablesType = MessageHelper.createMessage(DescribeRouteTablesType.class, info.getEffectiveUserId()); describeRouteTablesType .getFilterSet() .add(Filter.filter("route-table-id", properties.getRouteTableId())); DescribeRouteTablesResponseType describeRouteTablesResponseType = AsyncRequests.sendSync(configuration, describeRouteTablesType); if (describeRouteTablesResponseType.getRouteTableSet() == null || describeRouteTablesResponseType.getRouteTableSet().getItem() == null || describeRouteTablesResponseType.getRouteTableSet().getItem().isEmpty()) { throw new ValidationErrorException( "No such route table with id '" + properties.getRouteTableId()); } }