Source:
<code>public void updateSslTermination(LoadBalancerEndpointConfiguration config, LoadBalancer loadBalancer, ZeusSslTermination sslTermination) throws InsufficientRequestException, StmRollBackException { StingrayRestClient client = getResources().loadSTMRestClient(config); String vsName = ZxtmNameBuilder.genVSName(loadBalancer); String sslVsName = ZxtmNameBuilder.genSslVSName(loadBalancer); ResourceTranslator translator = ResourceTranslator.getNewResourceTranslator(); <START> loadBalancer.setUserPages(loadBalancer.getUserPages()); <END> translator.translateLoadBalancerResource(config, sslVsName, loadBalancer, loadBalancer); VirtualServer createdServer = translator.getcVServer(); VirtualServerHttp http = new VirtualServerHttp(); http.setLocation_rewrite(EnumFactory.Accept_from.NEVER.toString()); createdServer.getProperties().setHttp(http); if (loadBalancer.isSecureOnly()) { VirtualServer virtualServer; try { virtualServer = client.getVirtualServer(vsName); } catch (Exception e) { LOG.error(String.format("Error retrieving non-secure virtual server.\n%s", Debug.getExtendedStackTrace(e))); throw new StmRollBackException("Error retrieving non-secure virtual server.", e); } if (virtualServer != null) { virtualServer.getProperties().getBasic().setEnabled(false); getResources().updateVirtualServer(client, vsName, virtualServer); } } LOG.info(String.format("Updating certificate for load balancer: %s", loadBalancer.getId())); getResources().updateKeypair(client, sslVsName, translator.getcKeypair()); try { if ((loadBalancer.getAccessLists() != null && !loadBalancer.getAccessLists().isEmpty()) || loadBalancer.getConnectionLimit() != null) { getResources().updateProtection(client, vsName, translator.getcProtection()); } getResources().updateVirtualIps(client, sslVsName, translator.getcTrafficIpGroups()); getResources().updateVirtualServer(client, sslVsName, createdServer); } catch (Exception ex) { LOG.error(ex); throw new StmRollBackException("Failed to update loadbalancer, rolling back...", ex); } client.destroy(); }</code><technical_language>this is kind of weird i I understanding correctly. if this get method returns a value, setting redundant. of this a typical java getter in some external storage retrieve</technical_language>

Target:
public void updateSslTermination(LoadBalancerEndpointConfiguration config, LoadBalancer loadBalancer, ZeusSslTermination sslTermination) throws InsufficientRequestException, StmRollBackException { StingrayRestClient client = getResources().loadSTMRestClient(config); String vsName = ZxtmNameBuilder.genVSName(loadBalancer); String sslVsName = ZxtmNameBuilder.genSslVSName(loadBalancer); ResourceTranslator translator = ResourceTranslator.getNewResourceTranslator(); translator.translateLoadBalancerResource(config, sslVsName, loadBalancer, loadBalancer); VirtualServer createdServer = translator.getcVServer(); VirtualServerHttp http = new VirtualServerHttp(); http.setLocation_rewrite(EnumFactory.Accept_from.NEVER.toString()); createdServer.getProperties().setHttp(http); if (loadBalancer.isSecureOnly()) { VirtualServer virtualServer; try { virtualServer = client.getVirtualServer(vsName); } catch (Exception e) { LOG.error(String.format("Error retrieving non-secure virtual server.\n%s", Debug.getExtendedStackTrace(e))); throw new StmRollBackException("Error retrieving non-secure virtual server.", e); } if (virtualServer != null) { virtualServer.getProperties().getBasic().setEnabled(false); getResources().updateVirtualServer(client, vsName, virtualServer); } } LOG.info(String.format("Updating certificate for load balancer: %s", loadBalancer.getId())); getResources().updateKeypair(client, sslVsName, translator.getcKeypair()); try { if ((loadBalancer.getAccessLists() != null && !loadBalancer.getAccessLists().isEmpty()) || loadBalancer.getConnectionLimit() != null) { getResources().updateProtection(client, vsName, translator.getcProtection()); } getResources().updateVirtualIps(client, sslVsName, translator.getcTrafficIpGroups()); getResources().updateVirtualServer(client, sslVsName, createdServer); } catch (Exception ex) { LOG.error(ex); throw new StmRollBackException("Failed to update loadbalancer, rolling back...", ex); } client.destroy(); }