@Override protected JsonParserAndMapper initialValue() { return new JsonParserFactory().lax().create(); } };
@Override protected JsonParserAndMapper initialValue() { return new JsonParserFactory().setIgnoreSet(Sets.set("metaClass")).createFastObjectMapperParser(); } };
/** * Retrieves all services registered with the Agent. * <p> * GET /v1/agent/services * * @return Map of Service ID to Services. */ public Map<String, Service> getServices() { final URI uri = createURI("/services"); final HTTP.Response response = HTTP.getResponse(uri.toString()); final JsonParserAndMapper jsonParserAndMapper = new JsonParserFactory().create(); if (response.status() == 200) { final Map<String, Object> map = jsonParserAndMapper.parseMap(response.payloadAsString()); final Map<String, Service> returnMap = new HashMap<>(map.size()); map.entrySet().forEach(entry -> { @SuppressWarnings("unchecked") Service service = fromMap((Map<String, Object>) entry.getValue(), Service.class); returnMap.put(entry.getKey(), service); }); return returnMap; } die("Unable to get list of services", uri, response.status(), response.payloadAsString()); return null; }
/** * Retrieves all checks registered with the Agent. * <p> * GET /v1/agent/checks * * @return Map of Check ID to Checks. */ public Map<String, HealthCheck> getChecks() { final URI uri = createURI("/checks"); final HTTP.Response response = HTTP.getResponse(uri.toString()); final JsonParserAndMapper jsonParserAndMapper = new JsonParserFactory().create(); if (response.status() == 200) { final Map<String, Object> map = jsonParserAndMapper.parseMap(response.payloadAsString()); final Map<String, HealthCheck> returnMap = new HashMap<>(map.size()); map.entrySet().forEach(entry -> { @SuppressWarnings("unchecked") HealthCheck healthCheck = fromMap((Map<String, Object>) entry.getValue(), HealthCheck.class); returnMap.put(entry.getKey(), healthCheck); }); return returnMap; } die("Unable to get health checks", uri, response.status(), response.statusMessageAsString(), response.payloadAsString()); return null; }
@Override protected JsonParserAndMapper initialValue() { return new JsonParserFactory().lax().create(); } };
public ObjectMapperImpl () { this.parserFactory = new JsonParserFactory(); this.serializerFactory = new JsonSerializerFactory(); this.serializerFactory.useFieldsOnly(); }
@Override protected JsonParserAndMapper initialValue() { return new JsonParserFactory().lax().create(); } };
public ObjectMapperImpl () { this.parserFactory = new JsonParserFactory(); this.serializerFactory = new JsonSerializerFactory(); this.serializerFactory.useFieldsOnly(); }
public static ObjectMapper createUseJSONDates () { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useJsonFormatForDates(); return new ObjectMapperImpl(jpf, jsf); }
@Override protected JsonParserAndMapper initialValue() { return new JsonParserFactory().setIgnoreSet(Sets.set("metaClass")).createFastObjectMapperParser(); } };
@Override protected JsonParserAndMapper initialValue() { return new JsonParserFactory().setIgnoreSet(Sets.set("metaClass")).createFastObjectMapperParser(); } };
public static ObjectMapper createUseJSONDates () { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useJsonFormatForDates(); return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseJSONDates () { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useJsonFormatForDates(); return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseAnnotations (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useAnnotations(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseAnnotations (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.useAnnotations(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper create () { JsonParserFactory jsonParserFactory = new JsonParserFactory(); jsonParserFactory.lax(); return new ObjectMapperImpl(jsonParserFactory, new JsonSerializerFactory()); }
public static ObjectMapper create () { JsonParserFactory jsonParserFactory = new JsonParserFactory(); jsonParserFactory.lax(); return new ObjectMapperImpl(jsonParserFactory, new JsonSerializerFactory()); }
public static ObjectMapper create () { JsonParserFactory jsonParserFactory = new JsonParserFactory(); jsonParserFactory.lax(); return new ObjectMapperImpl(jsonParserFactory, new JsonSerializerFactory()); }
public static ObjectMapper createUseProperties (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); jpf.usePropertiesFirst(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.usePropertiesFirst(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }
public static ObjectMapper createUseProperties (boolean useJsonDates) { JsonParserFactory jpf = new JsonParserFactory(); jpf.usePropertiesFirst(); JsonSerializerFactory jsf = new JsonSerializerFactory(); jsf.usePropertiesFirst(); if (useJsonDates) { jsf.useJsonFormatForDates(); } return new ObjectMapperImpl(jpf, jsf); }