EntityConfigResource extends AbstractBrooklynRestResource implements EntityConfigApi { @Override public Map<String, Object> batchConfigRead(String application, String entityToken, Boolean raw) { Entity entity = brooklyn().getEntity(application, entityToken); if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ENTITY, entity)) { throw WebResourceUtils.forbidden("User '%s' is not authorized to see entity '%s'", Entitlements.getEntitlementContext().user(), entity); } return Entities.submit(entity, Tasks.<Map<String,Object>>builder().displayName("REST API batch config read") .tag(BrooklynTaskTags.TRANSIENT_TASK_TAG) .body(new BatchConfigRead(mgmt(), this, entity, raw)).build()).getUnchecked(); }  @Override List<ConfigSummary> list(final String application, final String entityToken); @Override Map<String, Object> batchConfigRead(String application, String entityToken, Boolean raw); @Override Object get(String application, String entityToken, String configKeyName, Boolean raw); @Override String getPlain(String application, String entityToken, String configKeyName, Boolean raw); Object get(boolean preferJson, String application, String entityToken, String configKeyName, Boolean raw); @SuppressWarnings({ "rawtypes", "unchecked" }) @Override void setFromMap(String application, String entityToken, Boolean recurse, Map newValues); @SuppressWarnings({ "rawtypes", "unchecked" }) @Override void set(String application, String entityToken, String configName, Boolean recurse, Object newValue);  }
@Test public void testBatchConfigRead() throws Exception { Map<String, Object> currentState = client().path( URI.create("/applications/simple-app/entities/simple-ent/config/current-state")) .get(new GenericType<Map<String, Object>>() { }); assertTrue(currentState.containsKey("install.version")); assertEquals(currentState.get("install.version"), "1.0.0"); }