com.fasterxml.jackson.databind.node.ObjectNode Java Examples
The following examples show how to use
com.fasterxml.jackson.databind.node.ObjectNode.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModelEditorResource.java From plumdo-work with Apache License 2.0 | 6 votes |
@PostMapping(value = "/models/{modelId}/editor", name = "模型设计器保存模型") @ResponseStatus(value = HttpStatus.OK) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public void saveModelEditor(@PathVariable String modelId, @RequestBody ModelEditorJsonRequest values) { Model model = getModel(modelId, values.isNewVersion()); if (!model.getKey().equals(values.getKey())) { checkModelKeyExists(values.getKey()); managementService.executeCommand(new UpdateModelKeyCmd(modelId, values.getKey())); } try { ObjectNode modelJson = (ObjectNode) objectMapper.readTree(model.getMetaInfo()); modelJson.put("name", values.getName()); modelJson.put("description", values.getDescription()); model.setMetaInfo(modelJson.toString()); model.setName(values.getName()); model.setKey(values.getKey()); repositoryService.saveModel(model); managementService.executeCommand(new SaveModelEditorCmd(model.getId(), values.getJsonXml())); } catch (Exception e) { logger.error("保存模型设计信息异常", e); exceptionFactory.throwDefinedException(ErrorConstant.MODEL_GET_EDITOR_ERROR, e.getMessage()); } }
Example #2
Source File: DefaultProcessDefinitionLocalizationManager.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override public void localize(ProcessDefinition processDefinition, String locale, boolean withLocalizationFallback) { ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) processDefinition; processDefinitionEntity.setLocalizedName(null); processDefinitionEntity.setLocalizedDescription(null); if (locale != null) { ObjectNode languageNode = BpmnOverrideContext.getLocalizationElementProperties(locale, processDefinitionEntity.getKey(), processDefinition.getId(), withLocalizationFallback); if (languageNode != null) { JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME); if (languageNameNode != null && !languageNameNode.isNull()) { processDefinitionEntity.setLocalizedName(languageNameNode.asText()); } JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION); if (languageDescriptionNode != null && !languageDescriptionNode.isNull()) { processDefinitionEntity.setLocalizedDescription(languageDescriptionNode.asText()); } } } }
Example #3
Source File: FileWatchResource.java From camel-quarkus with Apache License 2.0 | 6 votes |
@Path("/get-events") @GET @Produces(MediaType.APPLICATION_JSON) public Response getEvent(@QueryParam("path") String path) throws Exception { final Exchange exchange = consumerTemplate.receiveNoWait("file-watch://" + path); if (exchange == null) { return Response.noContent().build(); } else { final Message message = exchange.getMessage(); final ObjectMapper mapper = new ObjectMapper(); final ObjectNode node = mapper.createObjectNode(); node.put("type", message.getHeader(FileWatchComponent.EVENT_TYPE_HEADER, FileEventEnum.class).toString()); node.put("path", message.getHeader("CamelFileAbsolutePath", String.class)); return Response .ok() .entity(node) .build(); } }
Example #4
Source File: JdbcComponentTestIT.java From components with Apache License 2.0 | 6 votes |
@Test public void testGetSchema_wrongSql() throws java.io.IOException { // given UiSpecsPropertiesDto datasetConnectionInfo = new UiSpecsPropertiesDto(); datasetConnectionInfo.setProperties(mapper.readValue( getClass().getResourceAsStream("jdbc_data_set_properties_no_schema_wrong_table_name.json"), ObjectNode.class)); datasetConnectionInfo.setDependencies(singletonList(getJdbcDataStoreProperties())); // when final Response responseApiError = given().body(datasetConnectionInfo) .contentType(APPLICATION_JSON_UTF8_VALUE) // .accept(APPLICATION_JSON_UTF8_VALUE) .post(getVersionPrefix() + "/runtimes/schema"); responseApiError.then().statusCode(400).log().ifValidationFails(); ApiError response = responseApiError.as(ApiError.class); // then assertEquals("TCOMP_JDBC_SQL_SYNTAX_ERROR", response.getCode()); assertEquals("Table/View 'TOTO' does not exist.", response.getMessage()); }
Example #5
Source File: ProxyInvocationHandler.java From beam with Apache License 2.0 | 6 votes |
@Override public PipelineOptions deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode objectNode = jp.readValueAsTree(); JsonNode rawOptionsNode = objectNode.get("options"); Map<String, JsonNode> fields = Maps.newHashMap(); if (rawOptionsNode != null && !rawOptionsNode.isNull()) { ObjectNode optionsNode = (ObjectNode) rawOptionsNode; for (Iterator<Map.Entry<String, JsonNode>> iterator = optionsNode.fields(); iterator != null && iterator.hasNext(); ) { Map.Entry<String, JsonNode> field = iterator.next(); fields.put(field.getKey(), field.getValue()); } } PipelineOptions options = new ProxyInvocationHandler(Maps.newHashMap(), fields).as(PipelineOptions.class); ValueProvider.RuntimeValueProvider.setRuntimeOptions(options); return options; }
Example #6
Source File: K8sIpamWebResource.java From onos with Apache License 2.0 | 6 votes |
/** * Requests for allocating a unique IP address of the given network ID. * * @param netId network identifier * @return 200 OK with the serialized IPAM JSON string * @onos.rsModel K8sIpam */ @GET @Path("{netId}") @Produces(MediaType.APPLICATION_JSON) public Response allocateIp(@PathParam("netId") String netId) { log.trace("Received IP allocation request of network " + netId); K8sNetwork network = nullIsNotFound(networkService.network(netId), NETWORK_ID_NOT_FOUND); IpAddress ip = nullIsNotFound(ipamService.allocateIp(network.networkId()), IP_NOT_ALLOCATED); ObjectNode root = mapper().createObjectNode(); String ipamId = network.networkId() + "-" + ip.toString(); K8sIpam ipam = new DefaultK8sIpam(ipamId, ip, network.networkId()); root.set(IPAM, codec(K8sIpam.class).encode(ipam, this)); return ok(root).build(); }
Example #7
Source File: SinglePointToMultiPointIntentCodec.java From onos with Apache License 2.0 | 6 votes |
@Override public ObjectNode encode(SinglePointToMultiPointIntent intent, CodecContext context) { checkNotNull(intent, "Single Point to Multi Point intent cannot be null"); final JsonCodec<ConnectivityIntent> connectivityIntentCodec = context.codec(ConnectivityIntent.class); final ObjectNode result = connectivityIntentCodec.encode(intent, context); final JsonCodec<ConnectPoint> connectPointCodec = context.codec(ConnectPoint.class); final ObjectNode ingress = connectPointCodec.encode(intent.ingressPoint(), context); final ArrayNode jsonconnectPoints = context.mapper().createArrayNode(); if (intent.egressPoints() != null) { for (final ConnectPoint cp : intent.egressPoints()) { jsonconnectPoints.add(connectPointCodec.encode(cp, context)); } result.set(EGRESS_POINT, jsonconnectPoints); } result.set(INGRESS_POINT, ingress); return result; }
Example #8
Source File: MaterializerServiceEndpoints.java From tasmo with Apache License 2.0 | 6 votes |
@POST @Consumes ("application/json") @Path ("/writtenEvents") public Response writtenEvents(List<ObjectNode> events) { try { LOG.startTimer("writeEvents"); LOG.inc("ingressed>total", events.size()); for (ObjectNode event : events) { // TODO ensure doneYet tracking is disabled. } ingressWrittenEvents.callback(events); LOG.inc("ingressed>success", events.size()); return ResponseHelper.INSTANCE.jsonResponse("success"); } catch (Exception x) { LOG.inc("ingressed>errors"); LOG.error("failed to ingress because:", x); return ResponseHelper.INSTANCE.errorResponse(null, x); } finally { LOG.stopTimer("writeEvents"); } }
Example #9
Source File: VirtualNetworkWebResource.java From onos with Apache License 2.0 | 6 votes |
/** * Removes the virtual network host from the JSON input stream. * * @param networkId network identifier * @param stream virtual host JSON stream * @return 204 NO CONTENT * @onos.rsModel VirtualHost */ @DELETE @Path("{networkId}/hosts") @Consumes(MediaType.APPLICATION_JSON) public Response removeVirtualHost(@PathParam("networkId") long networkId, InputStream stream) { try { ObjectNode jsonTree = readTreeFromStream(mapper(), stream); JsonNode specifiedNetworkId = jsonTree.get("networkId"); if (specifiedNetworkId != null && specifiedNetworkId.asLong() != (networkId)) { throw new IllegalArgumentException(INVALID_FIELD + "networkId"); } final VirtualHost vhostReq = codec(VirtualHost.class).decode(jsonTree, this); vnetAdminService.removeVirtualHost(vhostReq.networkId(), vhostReq.id()); } catch (IOException e) { throw new IllegalArgumentException(e); } return Response.noContent().build(); }
Example #10
Source File: ObservationEncoder.java From arctic-sea with Apache License 2.0 | 5 votes |
private JsonNode encodeQualityValue(Value<?> value) { QuantityValue quantityValue = (QuantityValue) value; ObjectNode node = nodeFactory().objectNode(); node.put(JSONConstants.UOM, quantityValue.getUnit()); node.put(JSONConstants.VALUE, quantityValue.getValue()); return node; }
Example #11
Source File: SampleWorkflow.java From onos with Apache License 2.0 | 5 votes |
@Override public void process(WorkflowContext context) throws WorkflowException { ObjectNode node = getDataModel(context); node.put("work6", "done"); log.info("workflow-process {}-{}", context.workplaceName(), this.getClass().getSimpleName()); sleep(10); context.completed(); }
Example #12
Source File: TextEncoder.java From synapse with Apache License 2.0 | 5 votes |
private static String encodeV2(Message<String> message) { ObjectMapper mapper = currentObjectMapper(); try { ObjectNode root = mapper.createObjectNode(); root.put(SYNAPSE_MSG_FORMAT, "v2"); root.set(SYNAPSE_MSG_KEY, encodeKeysV2(message, mapper)); root.set(SYNAPSE_MSG_HEADERS, encodeHeadersV2(message, mapper)); root.set(SYNAPSE_MSG_PAYLOAD, encodePayloadV2(message, mapper)); return root.toString(); } catch (IOException e) { throw new IllegalStateException(String.format("Cannot encode message %s", message), e); } }
Example #13
Source File: ActivityUpdateHistoryJsonTransformer.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override public boolean isApplicable(ObjectNode historicalData, CommandContext commandContext) { String activityInstanceId = getStringFromJson(historicalData, HistoryJsonConstants.RUNTIME_ACTIVITY_INSTANCE_ID); if (StringUtils.isNotEmpty(activityInstanceId)) { HistoricActivityInstanceEntity historicActivityInstance = CommandContextUtil.getHistoricActivityInstanceEntityManager(commandContext).findById(activityInstanceId); if (historicActivityInstance == null) { return false; } } return true; }
Example #14
Source File: BadgingUtil.java From sunbird-lms-service with MIT License | 5 votes |
/** * This method will create assertion revoke request data. * * @param map Map<String,Object> * @return String */ public static String createAssertionRevokeData(Map<String, Object> map) { ObjectNode node = mapper.createObjectNode(); ((ObjectNode) node) .put("revocation_reason", (String) map.get(BadgingJsonKey.REVOCATION_REASON)); try { return mapper.writeValueAsString(node); } catch (JsonProcessingException e) { ProjectLogger.log( "BadgingUtil :createAssertionRevokeData : JsonProcessingException ", LoggerEnum.ERROR); } return null; }
Example #15
Source File: AnnotatedCodec.java From onos with Apache License 2.0 | 5 votes |
/** * Extracts annotations of given Object. * * @param objNode annotated JSON object node * @param context decode context * @return extracted Annotations */ protected Annotations extractAnnotations(ObjectNode objNode, CodecContext context) { JsonCodec<Annotations> codec = context.codec(Annotations.class); if (objNode.has("annotations") && objNode.isObject()) { return codec.decode(get(objNode, "annotations"), context); } else { return DefaultAnnotations.EMPTY; } }
Example #16
Source File: MappingActionCodecTest.java From onos with Apache License 2.0 | 5 votes |
/** * Tests the encoding of no mapping action. */ @Test public void noActionTest() { final NoMappingAction action = MappingActions.noAction(); final ObjectNode actionJson = actionCodec.encode(action, context); assertThat(actionJson, matchesAction(action)); }
Example #17
Source File: ConfigFileUtil.java From glowroot with Apache License 2.0 | 5 votes |
private static String writeConfigAsString(ObjectNode rootObjectNode, List<String> keyOrder) throws IOException { ObjectNode orderedRootObjectNode = getOrderedObjectNode(rootObjectNode, keyOrder); ObjectMappers.stripEmptyContainerNodes(orderedRootObjectNode); StringBuilder sb = new StringBuilder(); JsonGenerator jg = mapper.getFactory().createGenerator(CharStreams.asWriter(sb)); try { jg.setPrettyPrinter(ObjectMappers.getPrettyPrinter()); jg.writeTree(orderedRootObjectNode); } finally { jg.close(); } // newline is not required, just a personal preference return sb.toString() + ObjectMappers.NEWLINE; }
Example #18
Source File: AnnotationApiConfigGeneratorTest.java From endpoints-java with Apache License 2.0 | 5 votes |
@Test public void testMultipleCollectionRequests() throws Exception { @Api class MultipleCollections { @SuppressWarnings("unused") public void foo(@Named("ids") Long[] ids, @Named("authors") List<String> authors) {} } String apiConfigSource = g.generateConfig(MultipleCollections.class).get("myapi-v1.api"); ObjectNode root = objectMapper.readValue(apiConfigSource, ObjectNode.class); JsonNode methodNode = root.path("methods").path("myapi.multipleCollections.foo"); assertFalse(methodNode.isMissingNode()); verifyMethodRequestParameter(methodNode.get("request"), "ids", "int64", true, true); verifyMethodRequestParameter(methodNode.get("request"), "authors", "string", true, true); }
Example #19
Source File: NDCGTest.java From samantha with MIT License | 5 votes |
@Test public void testNDCG() { NDCG ndcg = new NDCG( Lists.newArrayList(1, 3), Lists.newArrayList("item"), Lists.newArrayList("item"), "rating", null, 0.0); ObjectNode gt1 = Json.newObject().put("item", 1).put("rating", 2.0); ObjectNode gt2 = Json.newObject().put("item", 3).put("rating", 1.0); ObjectNode ot1 = Json.newObject().put("item", 5).put("rating", 0.0); List<ObjectNode> gts1 = Lists.newArrayList(gt1, gt2); Prediction rec1 = new Prediction( ot1, null, 3.0, null); Prediction rec2 = new Prediction( gt1, null, 2.0, null); Prediction rec3 = new Prediction( gt2, null, 1.0, null); List<Prediction> recs1 = Lists.newArrayList(rec1, rec2, rec3); ndcg.add(gts1, recs1); rec1 = new Prediction(gt1, null, 3.0, null); rec2 = new Prediction(ot1, null, 2.0, null); rec3 = new Prediction(gt2, null, 1.0, null); List<Prediction> recs2 = Lists.newArrayList(rec1, rec2, rec3); ndcg.add(gts1, recs2); MetricResult results = ndcg.getResults(); assertEquals(true, results.getPass()); assertEquals(2, results.getValues().size()); for (JsonNode result : results.getValues()) { int n = result.get(ConfigKey.EVALUATOR_METRIC_PARA.get()).get("N").asInt(); double value = result.get(ConfigKey.EVALUATOR_METRIC_VALUE.get()).asDouble(); assertTrue(n == 1 || n == 3); if (n == 1) { assertEquals(0.500, value, 0.001); } else if (n == 3) { assertEquals(0.809, value, 0.001); } } }
Example #20
Source File: PacketStatsUiMessageHandler.java From onos with Apache License 2.0 | 5 votes |
@Override public void process(ObjectNode payload) { MetricsService service = get(MetricsService.class); Map<String, Counter> counters = service.getCounters(filter); Counter mplsCounter = counters.get("packetStatisticsComponent.mplsFeature.mplsPC"); long mplsCount = mplsCounter.getCount(); ObjectNode mplsJson = objectNode(); mplsJson.put("MplsCounter", mplsCount); log.info("Received MPLS Request"); sendMessage(MPLS_RESP, mplsJson); }
Example #21
Source File: EnumModule.java From jsonschema-generator with Apache License 2.0 | 5 votes |
@Override public CustomDefinition provideCustomSchemaDefinition(ResolvedType javaType, SchemaGenerationContext context) { if (javaType.isInstanceOf(Enum.class)) { ObjectNode customNode = context.getGeneratorConfig().createObjectNode() .put(context.getKeyword(SchemaKeyword.TAG_TYPE), context.getKeyword(SchemaKeyword.TAG_TYPE_STRING)); new AttributeCollector(context.getGeneratorConfig().getObjectMapper()) .setEnum(customNode, EnumModule.extractEnumValues(javaType, this.enumConstantToString), context); return new CustomDefinition(customNode); } return null; }
Example #22
Source File: CustomSerializationTest.java From Rosetta with Apache License 2.0 | 5 votes |
@Test public void testAnnotatedInnerFieldDeserialization() throws JsonProcessingException { ObjectNode node = Rosetta.getMapper().createObjectNode(); node.set("annotatedInnerField", expectedInnerBean); CustomSerializationBean bean = Rosetta.getMapper().treeToValue(node, CustomSerializationBean.class); assertThat(bean.getAnnotatedInnerField()).isEqualTo(innerBean); }
Example #23
Source File: TopologyViewMessageHandlerBase.java From onos with Apache License 2.0 | 5 votes |
protected ObjectNode hostMessage(HostEvent event) { Host host = event.subject(); Host prevHost = event.prevSubject(); String hostType = host.annotations().value(AnnotationKeys.UI_TYPE); String ip = ip(host.ipAddresses()); ObjectNode payload = objectNode() .put("id", host.id().toString()) .put("type", isNullOrEmpty(hostType) ? "endstation" : hostType); // set most recent connect point (and previous if we know it) payload.set("cp", hostConnect(host.location())); if (prevHost != null && prevHost.location() != null) { payload.set("prevCp", hostConnect(prevHost.location())); } // set ALL connect points addAllCps(host.locations(), payload); payload.set("labels", labels(nameForHost(host), ip, host.mac().toString(), "")); payload.set("props", props(host.annotations())); BasicHostConfig cfg = get(NetworkConfigService.class) .getConfig(host.id(), BasicHostConfig.class); if (!addLocation(cfg, payload)) { addMetaUi(host.id().toString(), payload); } String type = HOST_EVENT.get(event.type()); return JsonUtils.envelope(type, payload); }
Example #24
Source File: ServerDevicesDiscovery.java From onos with Apache License 2.0 | 5 votes |
/** * Parse the input JSON object, looking for CPU-related * information. Upon success, construct and return a list * of CPU devices. * * @param objNode input JSON node with CPU device information * @return list of CPU devices */ private Collection<CpuDevice> parseCpuDevices(ObjectNode objNode) { Collection<CpuDevice> cpuSet = Sets.newHashSet(); JsonNode cpuNode = objNode.path(PARAM_CPUS); // Construct CPU objects for (JsonNode cn : cpuNode) { ObjectNode cpuObjNode = (ObjectNode) cn; // All the CPU attributes int physicalCpuId = cpuObjNode.path(PARAM_CPU_ID_PHY).asInt(); int logicalCpuId = cpuObjNode.path(PARAM_CPU_ID_LOG).asInt(); int cpuSocket = cpuObjNode.path(PARAM_CPU_SOCKET).asInt(); String cpuVendorStr = get(cn, PARAM_CPU_VENDOR); long cpuFrequency = cpuObjNode.path(PARAM_CPU_FREQUENCY).asLong(); // Construct a CPU device and add it to the set cpuSet.add( DefaultCpuDevice.builder() .setCoreId(logicalCpuId, physicalCpuId) .setVendor(cpuVendorStr) .setSocket(cpuSocket) .setFrequency(cpuFrequency) .build()); } return cpuSet; }
Example #25
Source File: SchemaGeneratorCustomDefinitionsTest.java From jsonschema-generator with Apache License 2.0 | 5 votes |
@Test @Parameters(source = SchemaVersion.class) public void testGenerateSchema_CustomInlineStandardDefinition(SchemaVersion schemaVersion) throws Exception { CustomDefinitionProviderV2 customDefinitionProvider = new CustomDefinitionProviderV2() { @Override public CustomDefinition provideCustomSchemaDefinition(ResolvedType javaType, SchemaGenerationContext context) { if (javaType.getErasedType() == Integer.class) { // using SchemaGenerationContext.createStandardDefinition() to avoid endless loop with this custom definition ObjectNode standardDefinition = context.createStandardDefinition(context.getTypeContext().resolve(Integer.class), this); standardDefinition.put("$comment", "custom override of Integer"); standardDefinition.put(context.getKeyword(SchemaKeyword.TAG_TITLE), "custom title"); return new CustomDefinition(standardDefinition); } return null; } }; SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(schemaVersion); configBuilder.forTypesInGeneral() .withTitleResolver(_scope -> "type title") .withDescriptionResolver(_scope -> "type description") .withCustomDefinitionProvider(customDefinitionProvider); SchemaGenerator generator = new SchemaGenerator(configBuilder.build()); JsonNode result = generator.generateSchema(Integer.class); Assert.assertEquals(4, result.size()); Assert.assertEquals(SchemaKeyword.TAG_TYPE_INTEGER.forVersion(schemaVersion), result.get(SchemaKeyword.TAG_TYPE.forVersion(schemaVersion)).asText()); Assert.assertEquals("custom override of Integer", result.get("$comment").asText()); Assert.assertEquals("custom title", result.get(SchemaKeyword.TAG_TITLE.forVersion(schemaVersion)).asText()); Assert.assertEquals("type description", result.get(SchemaKeyword.TAG_DESCRIPTION.forVersion(schemaVersion)).asText()); }
Example #26
Source File: GenerateBlockchainConfig.java From besu with Apache License 2.0 | 5 votes |
/** * Write the content of the genesis to the output file. * * @param directory The directory to write the file to. * @param fileName The name of the output file. * @param genesis The genesis content. * @throws IOException If the genesis file cannot be written or accessed. */ private void writeGenesisFile( final File directory, final String fileName, final ObjectNode genesis) throws IOException { LOG.info("Writing genesis file."); Files.write( directory.toPath().resolve(fileName), JsonUtil.getJson(genesis).getBytes(UTF_8), StandardOpenOption.CREATE_NEW); }
Example #27
Source File: JsonEventConventions.java From tasmo with Apache License 2.0 | 5 votes |
public EventType getEventType(ObjectNode eventNode) { JsonNode got = eventNode.get(ReservedFields.EVENT_TYPE); if (got == null || got.isNull()) { return EventType.REGULAR; } try { return mapper.convertValue(got, EventType.class); } catch (Exception ex) { LOG.debug("Failed to get event type for event: " + eventNode, ex); return EventType.REGULAR; } }
Example #28
Source File: AsyncHistorySession.java From flowable-engine with Apache License 2.0 | 5 votes |
public void addHistoricData(String type, ObjectNode data, String tenantId) { // Different engines can call each other and all generate historical data. // To make sure the context of where the data is coming from (and thus being able to process it in the right context), // the JobService configuration is stored. JobServiceConfiguration jobServiceConfiguration = CommandContextUtil.getJobServiceConfiguration(); addHistoricData(jobServiceConfiguration, type, data, tenantId); }
Example #29
Source File: LoadCodec.java From onos with Apache License 2.0 | 5 votes |
@Override public ObjectNode encode(Load load, CodecContext context) { checkNotNull(load, "Load cannot be null"); return context.mapper().createObjectNode() .put(RATE, load.rate()) .put(LATEST, load.latest()) .put(VALID, load.isValid()) .put(TIME, load.time()); }
Example #30
Source File: ImrWebResource.java From onos with Apache License 2.0 | 5 votes |
/** * Get the statistics of the monitored intent of a specific application * Shows for each intent all the flow entries. * * @onos.rsModel intentStatsGet * @param id Application ID * @param name Application Name * @return 200 OK */ @GET @Path("intentStats/{id}/{name}") @Produces(MediaType.APPLICATION_JSON) public Response getIntentsStats(@PathParam("id") short id, @PathParam("name") String name) { ObjectNode root = mapper.createObjectNode(); imrService = get(IntentMonitorAndRerouteService.class); ApplicationId appId = new DefaultApplicationId(id, name); root.putArray(ROOT_FIELD_STATISTICS_NAME).addAll( getJsonNodesIntentStats(imrService.getStats(appId))); return ok(root).build(); }