@Test public void testSetDeprecated() { runSetDeprecated(DeprecateStyle.NEW_STYLE); }
@SuppressWarnings("deprecation") @Override public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogUtils.setDeprecated(mgmt(), itemId, deprecated); }
CatalogResource extends AbstractBrooklynRestResource implements CatalogApi { @SuppressWarnings("deprecation") @Override public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogUtils.setDeprecated(mgmt(), itemId, deprecated); } }
CatalogResource extends AbstractBrooklynRestResource implements CatalogApi { @SuppressWarnings("deprecation") @Override public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogUtils.setDeprecated(mgmt(), itemId, deprecated); }  }
CatalogResource extends AbstractBrooklynRestResource implements CatalogApi { @SuppressWarnings("deprecation") @Override public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogUtils.setDeprecated(mgmt(), itemId, deprecated); }  @Override @Consumes(MediaType.MULTIPART_FORM_DATA) Response createFromMultipart(InputStream uploadedInputStream, FormDataContentDisposition fileDetail); @Override Response create(String yaml); @SuppressWarnings("deprecation") @Override Response resetXml(String xml, boolean ignoreErrors); @Override @Deprecated void deleteEntity(String entityId); @Override void deleteApplication(String symbolicName, String version); @Override void deleteEntity(String symbolicName, String version); @Override void deletePolicy(String policyId, String version); @Override void deleteLocation(String locationId, String version); @Override List<CatalogEntitySummary> listEntities(String regex, String fragment, boolean allVersions); @Override List<CatalogItemSummary> listApplications(String regex, String fragment, boolean allVersions); @Override @Deprecated CatalogEntitySummary getEntity(String entityId); @Override CatalogEntitySummary getEntity(String symbolicName, String version); @Override @Deprecated CatalogEntitySummary getApplication(String applicationId); @Override CatalogEntitySummary getApplication(String symbolicName, String version); @Override List<CatalogPolicySummary> listPolicies(String regex, String fragment, boolean allVersions); @Override @Deprecated CatalogPolicySummary getPolicy(String policyId); @Override CatalogPolicySummary getPolicy(String policyId, String version); @Override List<CatalogLocationSummary> listLocations(String regex, String fragment, boolean allVersions); @Override @Deprecated CatalogLocationSummary getLocation(String locationId); @Override CatalogLocationSummary getLocation(String locationId, String version); @Override @Deprecated Response getIcon(String itemId); @Override Response getIcon(String itemId, String version); @Override void setDeprecatedLegacy(String itemId, boolean deprecated); @SuppressWarnings("deprecation") @Override void setDeprecated(String itemId, boolean deprecated); @SuppressWarnings("deprecation") @Override void setDisabled(String itemId, boolean disabled); }
CatalogResource extends AbstractBrooklynRestResource implements CatalogApi { @SuppressWarnings("deprecation") @Override public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogUtils.setDeprecated(mgmt(), itemId, deprecated); }  @Override @Consumes(MediaType.MULTIPART_FORM_DATA) Response createFromMultipart(InputStream uploadedInputStream, FormDataContentDisposition fileDetail); @Override Response create(String yaml); @SuppressWarnings("deprecation") @Override Response resetXml(String xml, boolean ignoreErrors); @Override @Deprecated void deleteEntity(String entityId); @Override void deleteApplication(String symbolicName, String version); @Override void deleteEntity(String symbolicName, String version); @Override void deletePolicy(String policyId, String version); @Override void deleteLocation(String locationId, String version); @Override List<CatalogEntitySummary> listEntities(String regex, String fragment, boolean allVersions); @Override List<CatalogItemSummary> listApplications(String regex, String fragment, boolean allVersions); @Override @Deprecated CatalogEntitySummary getEntity(String entityId); @Override CatalogEntitySummary getEntity(String symbolicName, String version); @Override @Deprecated CatalogEntitySummary getApplication(String applicationId); @Override CatalogEntitySummary getApplication(String symbolicName, String version); @Override List<CatalogPolicySummary> listPolicies(String regex, String fragment, boolean allVersions); @Override @Deprecated CatalogPolicySummary getPolicy(String policyId); @Override CatalogPolicySummary getPolicy(String policyId, String version); @Override List<CatalogLocationSummary> listLocations(String regex, String fragment, boolean allVersions); @Override @Deprecated CatalogLocationSummary getLocation(String locationId); @Override CatalogLocationSummary getLocation(String locationId, String version); @Override @Deprecated Response getIcon(String itemId); @Override Response getIcon(String itemId, String version); @Override void setDeprecatedLegacy(String itemId, boolean deprecated); @SuppressWarnings("deprecation") @Override void setDeprecated(String itemId, boolean deprecated); @SuppressWarnings("deprecation") @Override void setDisabled(String itemId, boolean disabled);  }