soreana commented on a change in pull request #4141:
URL: https://github.com/apache/cloudstack/pull/4141#discussion_r668813079
##########
File path: server/src/main/java/com/cloud/api/ApiResponseHelper.java
##########
@@ -1040,6 +1043,78 @@ public LoadBalancerResponse
createLoadBalancerResponse(LoadBalancer loadBalancer
return lbResponse;
}
+ @Override
+ public LoadBalancerConfigResponse
createLoadBalancerConfigResponse(LoadBalancerConfig config) {
+ Network network = null;
+ Vpc vpc = null;
+ LoadBalancer lb = null;
+ if (config.getNetworkId() != null) {
+ network = ApiDBUtils.findNetworkById(config.getNetworkId());
+ }
+ if (config.getVpcId() != null) {
+ vpc = ApiDBUtils.findVpcById(config.getVpcId());
+ }
+ if (config.getLoadBalancerId() != null) {
+ lb = ApiDBUtils.findLoadBalancerById(config.getLoadBalancerId());
+ }
+ return setLoadBalancerConfigResponse(network, vpc, lb, config);
+ }
+
+ @Override
+ public List<LoadBalancerConfigResponse>
createLoadBalancerConfigResponse(List<? extends LoadBalancerConfig> configs) {
+ List<LoadBalancerConfigResponse> lbConfigResponses = new
ArrayList<LoadBalancerConfigResponse>();
+ if (configs == null || configs.size() == 0) {
Review comment:
@GutoVeronezi As I mentioned before,
`org.apache.commons.lang3.ArrayUtils` package don't have isEmpty method which
accepts List object. I have to override it like:
```java
...
ArrayUtils.isEmpty(new List[]{Configs})
...
```
It imposes unnecessary conversion. What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]