@@ -0,0 +1,2756 @@
+package sonata.kernel.placement.net;%0A%0Aimport com.fasterxml.jackson.core.JsonFactory;%0Aimport com.fasterxml.jackson.databind.DeserializationFeature;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport com.fasterxml.jackson.databind.module.SimpleModule;%0Aimport org.apache.commons.io.IOUtils;%0Aimport org.apache.http.client.methods.CloseableHttpResponse;%0Aimport org.apache.http.client.methods.HttpGet;%0Aimport org.apache.http.impl.client.CloseableHttpClient;%0Aimport org.apache.http.impl.client.HttpClients;%0Aimport org.apache.log4j.Logger;%0Aimport sonata.kernel.VimAdaptor.commons.vnfd.Unit;%0Aimport sonata.kernel.VimAdaptor.commons.vnfd.UnitDeserializer;%0A%0Aimport java.io.IOException;%0A%0Apublic class TranslatorTopo %7B%0A%0A    final static Logger logger = Logger.getLogger(TranslatorTopo.class);%0A%0A    public static NetworkTopology topo(String topoEndpoint)%7B%0A%0A        // Same chaining port for both datacenters%0A        String topoPath = topoEndpoint;%0A        if(!topoPath.endsWith(%22/%22))%0A            topoPath += %22/%22;%0A        String requestUri;%0A        String json = null;%0A        NetworkTopology topology;%0A%0A        requestUri = topoPath+%22v1/topo/%22;%0A%0A        CloseableHttpClient client = HttpClients.createDefault();%0A        HttpGet getRequest = new HttpGet(requestUri);%0A        CloseableHttpResponse response = null;%0A%0A        logger.info(%22Topology %22+getRequest.getRequestLine().getUri());%0A%0A        try %7B%0A            response = client.execute(getRequest);%0A%0A            if (response.getStatusLine().getStatusCode() == 200) %7B%0A                logger.info(%22Topology successful %22+requestUri);%0A                try %7B%0A                    json = IOUtils.toString(response.getEntity().getContent(), %22utf-8%22);%0A                %7D catch (IOException e) %7B%0A                    e.printStackTrace();%0A                %7D%0A%0A                topology = readJsonTopology(json);%0A                return topology;%0A            %7D else %7B%0A                logger.error(%22Topology failed %22+requestUri);%0A            %7D%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A            logger.error(%22Topology request aborted %22+requestUri);%0A        %7D%0A        return null;%0A    %7D%0A%0A    public static NetworkTopology readJsonTopology(String text)%7B%0A        ObjectMapper mapper = new ObjectMapper(new JsonFactory());%0A        SimpleModule module = new SimpleModule();%0A%0A        module.addDeserializer(Unit.class, new UnitDeserializer());%0A        mapper.registerModule(module);%0A        mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);%0A        NetworkTopology topo = null;%0A        try %7B%0A            topo = mapper.readValue(text, NetworkTopology.class);%0A        %7D catch (IOException e) %7B%0A            logger.debug(%22Topology JSON parsing failure%22,e);%0A        %7D%0A        return topo;%0A    %7D%0A%7D%0A

Add TranslatorTopo calling class