Source:
public Response sequenceGet(String apiName, String version , String tenantDomain, MessageContext messageContext) { InMemoryAPIDeployer inMemoryApiDeployer = new InMemoryAPIDeployer(); if (tenantDomain == null){ tenantDomain =SUPER_TENAT_DOMAIN; } Map<String, String> apiAttributes = inMemoryApiDeployer.getGatewayAPIAttributes(apiName, version, tenantDomain); String apiId = apiAttributes.get(APIConstants.GatewayArtifactSynchronizer.API_ID); String label = apiAttributes.get(APIConstants.GatewayArtifactSynchronizer.LABEL); GatewayAPIDTO gatewayAPIDTO = inMemoryApiDeployer.getAPIArtifact(apiId, label); JSONObject responseObj = new JSONObject(); if (gatewayAPIDTO != null) { try { JSONArray sequencesArray = new JSONArray(); JSONArray undeployedsequencesArray = new JSONArray(); if (gatewayAPIDTO.getSequenceToBeAdd() != null ) { SequenceAdminServiceProxy sequenceAdminServiceProxy = new SequenceAdminServiceProxy(gatewayAPIDTO.getTenantDomain()); for (GatewayContentDTO sequence : gatewayAPIDTO.getSequenceToBeAdd()) { if(sequenceAdminServiceProxy.isExistingSequence(sequence.getName())) { sequencesArray.put(sequenceAdminServiceProxy.getSequence(sequence.getName())); } else { log.error(sequence.getName() + " was not deployed in the gateway"); undeployedsequencesArray.put(sequence.getContent()); } } } } catch (AxisFault e) { String errorMessage = "Error in fetching deployed artifacts from Synapse Configuration"; log.error(errorMessage, e); RestApiUtil.handleInternalServerError(errorMessage, e, log); } String responseStringObj = String.valueOf(responseObj); return Response.ok().entity(responseStringObj).build(); } else { responseObj.put("Message", "Error"); String responseStringObj = String.valueOf(responseObj); return Response.serverError().entity(responseStringObj).build(); } }

Target:
public Response sequenceGet(String apiName, String version , String tenantDomain, MessageContext messageContext) { InMemoryAPIDeployer inMemoryApiDeployer = new InMemoryAPIDeployer(); if (tenantDomain == null) { tenantDomain = APIConstants.SUPER_TENANT_DOMAIN; } Map<String, String> apiAttributes = inMemoryApiDeployer.getGatewayAPIAttributes(apiName, version, tenantDomain); String apiId = apiAttributes.get(APIConstants.GatewayArtifactSynchronizer.API_ID); String label = apiAttributes.get(APIConstants.GatewayArtifactSynchronizer.LABEL); GatewayAPIDTO gatewayAPIDTO = inMemoryApiDeployer.getAPIArtifact(apiId, label); JSONObject responseObj = new JSONObject(); if (gatewayAPIDTO != null) { try { JSONArray sequencesArray = new JSONArray(); JSONArray undeployedsequencesArray = new JSONArray(); if (gatewayAPIDTO.getSequenceToBeAdd() != null ) { SequenceAdminServiceProxy sequenceAdminServiceProxy = new SequenceAdminServiceProxy(gatewayAPIDTO.getTenantDomain()); for (GatewayContentDTO sequence : gatewayAPIDTO.getSequenceToBeAdd()) { if(sequenceAdminServiceProxy.isExistingSequence(sequence.getName())) { sequencesArray.put(sequenceAdminServiceProxy.getSequence(sequence.getName())); } else { log.error(sequence.getName() + " was not deployed in the gateway"); undeployedsequencesArray.put(sequence.getContent()); } } } } catch (AxisFault e) { String errorMessage = "Error in fetching deployed artifacts from Synapse Configuration"; log.error(errorMessage, e); RestApiUtil.handleInternalServerError(errorMessage, e, log); } String responseStringObj = String.valueOf(responseObj); return Response.ok().entity(responseStringObj).build(); } else { responseObj.put("Message", "Error"); String responseStringObj = String.valueOf(responseObj); return Response.serverError().entity(responseStringObj).build(); } }