package org.openstack.atlas.rax.api.resource;

import org.openstack.atlas.api.response.ResponseFactory;
import org.openstack.atlas.api.validation.context.HttpRequestType;
import org.openstack.atlas.api.validation.result.ValidatorResult;
import org.openstack.atlas.core.api.v1.LoadBalancer;
import org.openstack.atlas.service.domain.operation.Operation;
import org.openstack.atlas.service.domain.pojo.MessageDataContainer;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import javax.ws.rs.core.Response;

@Controller("RAX-LoadBalancerResource")
@Scope("request")
public class LoadBalancerResource extends org.openstack.atlas.api.resource.LoadBalancerResource {

    @Override
    public Response update(LoadBalancer _loadBalancer) {
        ValidatorResult result = validator.validate(_loadBalancer, HttpRequestType.PUT);

        if (!result.passedValidation()) {
            return ResponseFactory.getValidationFaultResponse(result);
        }

        try {
            org.openstack.atlas.service.domain.entity.LoadBalancer loadBalancer  = dozerMapper.map(_loadBalancer, org.openstack.atlas.service.domain.entity.LoadBalancer.class);
            loadBalancer.setId(id);
            loadBalancer.setAccountId(accountId);

            loadBalancerService.update(loadBalancer);

            MessageDataContainer msg = new MessageDataContainer();
            msg.setLoadBalancer(loadBalancer);

            asyncService.callAsyncLoadBalancingOperation(Operation.UPDATE_LOADBALANCER, msg);
            return Response.status(Response.Status.ACCEPTED).build();
        } catch (Exception e) {
            return ResponseFactory.getErrorResponse(e, null, null);
        }
    }
}

@@ -279,24 +279,86 @@
 adBalancer;%0A
+import org.openstack.atlas.rax.domain.entity.RaxLoadBalancer;%0A
 import org.o
@@ -1088,50 +1088,11 @@
     
-org.openstack.atlas.service.domain.entity.
+Rax
 Load
@@ -1100,17 +1100,20 @@
 alancer 
-l
+raxL
 oadBalan
@@ -1154,50 +1154,11 @@
 er, 
-org.openstack.atlas.service.domain.entity.
+Rax
 Load
@@ -1178,33 +1178,36 @@
 s);%0A            
-l
+raxL
 oadBalancer.setI
@@ -1217,33 +1217,36 @@
 d);%0A            
-l
+raxL
 oadBalancer.setA
@@ -1306,17 +1306,20 @@
 .update(
-l
+raxL
 oadBalan
@@ -1424,17 +1424,20 @@
 alancer(
-l
+raxL
 oadBalan

Update loadbalancer extension