@Override public Response handleHelloRequest(Hello message) { int xid = message.getXid(); messagesMapping.put(xid, message); try { int dpid = message.getDpid(); InstanceLocationSpecifier key = getInstanceLocationSpecifier(dpid); ConnectionInstance value = (new ConnectionInstance.Builder()) .setDpid(dpid) .setVersion(message.getVersion()) .setCapabilities(message.getCapabilities()) .build(); instancesMapping.put(key, value); IProcessingGraph processingGraph = ApplicationAggregator.getInstance().getProcessingGraph(key); List<JsonBlock> blocks = null; List<JsonConnector> connectors = null; if (processingGraph != null) { blocks = translateBlocks(processingGraph.getBlocks()); connectors = translateConnectors(processingGraph.getConnectors()); } SetProcessingGraphRequest processMessage = new SetProcessingGraphRequest(0, dpid, null, blocks, connectors); sendMessage(key, processMessage, null); return okResponse(); } catch (Exception e) { LOG.warning("Error occured while handling Hello message" + e.toString()); e.printStackTrace(); return internalErrorResponse(); } }