@@ -0,0 +1,2042 @@
+package org.openstack.atlas.service.domain.common;%0A%0Aimport org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory;%0Aimport org.openstack.atlas.service.domain.entity.HealthMonitorType;%0Aimport org.openstack.atlas.service.domain.entity.LoadBalancer;%0Aimport org.openstack.atlas.service.domain.entity.LoadBalancerProtocol;%0Aimport org.openstack.atlas.service.domain.exception.BadRequestException;%0A%0Apublic class LoadBalancerCreateValidator %7B%0A    private static final Log LOG = LogFactory.getLog(LoadBalancerCreateValidator.class);%0A%0A    private LoadBalancerCreateValidator() %7B%0A%0A    %7D%0A%0A    public static void verifyTCPProtocolandPort(final LoadBalancer loadBalancer) throws BadRequestException %7B%0A        if (loadBalancer.getProtocol() != null && (loadBalancer.getProtocol().equals(LoadBalancerProtocol.TCP))) %7B%0A            LOG.info(%22TCP Protocol detected. Port must exists%22);%0A            if (loadBalancer.getPort() == null) %7B%0A                throw new BadRequestException(ErrorMessages.TCP_PORT_REQUIRED);%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static void verifyProtocolAndHealthMonitorType(LoadBalancer loadBalancer) throws BadRequestException %7B%0A        if (loadBalancer.getHealthMonitor() == null %7C%7C loadBalancer.getHealthMonitor().getType() == null) %7B%0A            return;%0A        %7D%0A        LOG.info(%22Health Monitor detected. Verifying that the load balancer's protocol matches the monitor type.%22);%0A        HealthMonitorType type = loadBalancer.getHealthMonitor().getType();%0A        if (type.equals(HealthMonitorType.HTTP)) %7B%0A            if (!(loadBalancer.getProtocol().equals(LoadBalancerProtocol.HTTP))) %7B%0A                throw new BadRequestException(ErrorMessages.HTTP_HEALTH_MONITOR_PROTOCOL_INCOMPATIBLE);%0A            %7D%0A        %7D else if (type.equals(HealthMonitorType.HTTPS)) %7B%0A            if (!(loadBalancer.getProtocol().equals(LoadBalancerProtocol.HTTPS))) %7B%0A                throw new BadRequestException(ErrorMessages.HTTPS_HEALTH_MONITOR_PROTOCOL_INCOMPATIBLE);%0A            %7D%0A        %7D%0A        return;%0A    %7D%0A%0A%7D%0A

Refactor update lb service