@Test public void test35getServiceResourcesByService() { List<RangerServiceResource> oldSRS = new ArrayList<RangerServiceResource>(); RangerServiceResource rangerServiceResource = new RangerServiceResource(); rangerServiceResource.setId(id); rangerServiceResource.setServiceName(serviceName); oldSRS.add(rangerServiceResource); try { Mockito.when(tagStore.getServiceResourcesByService(serviceName)).thenReturn(oldSRS); } catch (Exception e) { } List<RangerServiceResource> result = tagREST.getServiceResourcesByService(serviceName); Assert.assertNotNull(result); Assert.assertEquals(result.size(), 1); Assert.assertEquals(result.get(0).getId(), id); Assert.assertEquals(result.get(0).getServiceName(), serviceName); try { Mockito.verify(tagStore).getServiceResourcesByService(serviceName); } catch (Exception e) { } }
@GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName) { if(LOG.isDebugEnabled()) { LOG.debug("==> TagREST.getServiceResourcesByService(" + serviceName + ")"); } List<RangerServiceResource> ret = null; try { ret = tagStore.getServiceResourcesByService(serviceName); } catch(Exception excp) { LOG.error("getServiceResourcesByService(" + serviceName + ") failed", excp); throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, excp.getMessage(), true); } if (CollectionUtils.isEmpty(ret)) { if (LOG.isDebugEnabled()) { LOG.debug("getServiceResourcesByService(" + serviceName + ") - No service-resources found"); } } if(LOG.isDebugEnabled()) { LOG.debug("<== TagREST.getServiceResourcesByService(" + serviceName + "): count=" + (ret == null ? 0 : ret.size())); } return ret; }
TagREST { @GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName) { if(LOG.isDebugEnabled()) { LOG.debug("==> TagREST.getServiceResourcesByService(" + serviceName + ")"); } List<RangerServiceResource> ret = null; try { ret = tagStore.getServiceResourcesByService(serviceName); } catch(Exception excp) { LOG.error("getServiceResourcesByService(" + serviceName + ") failed", excp); throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, excp.getMessage(), true); } if (CollectionUtils.isEmpty(ret)) { if (LOG.isDebugEnabled()) { LOG.debug("getServiceResourcesByService(" + serviceName + ") - No service-resources found"); } } if(LOG.isDebugEnabled()) { LOG.debug("<== TagREST.getServiceResourcesByService(" + serviceName + "): count=" + (ret == null ? 0 : ret.size())); } return ret; } }
TagREST { @GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName) { if(LOG.isDebugEnabled()) { LOG.debug("==> TagREST.getServiceResourcesByService(" + serviceName + ")"); } List<RangerServiceResource> ret = null; try { ret = tagStore.getServiceResourcesByService(serviceName); } catch(Exception excp) { LOG.error("getServiceResourcesByService(" + serviceName + ") failed", excp); throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, excp.getMessage(), true); } if (CollectionUtils.isEmpty(ret)) { if (LOG.isDebugEnabled()) { LOG.debug("getServiceResourcesByService(" + serviceName + ") - No service-resources found"); } } if(LOG.isDebugEnabled()) { LOG.debug("<== TagREST.getServiceResourcesByService(" + serviceName + "): count=" + (ret == null ? 0 : ret.size())); } return ret; } TagREST(); }
TagREST { @GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName) { if(LOG.isDebugEnabled()) { LOG.debug("==> TagREST.getServiceResourcesByService(" + serviceName + ")"); } List<RangerServiceResource> ret = null; try { ret = tagStore.getServiceResourcesByService(serviceName); } catch(Exception excp) { LOG.error("getServiceResourcesByService(" + serviceName + ") failed", excp); throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, excp.getMessage(), true); } if (CollectionUtils.isEmpty(ret)) { if (LOG.isDebugEnabled()) { LOG.debug("getServiceResourcesByService(" + serviceName + ") - No service-resources found"); } } if(LOG.isDebugEnabled()) { LOG.debug("<== TagREST.getServiceResourcesByService(" + serviceName + "): count=" + (ret == null ? 0 : ret.size())); } return ret; } TagREST(); @PostConstruct void initStore(); @POST @Path(TagRESTConstants.TAGDEFS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef createTagDef(RangerTagDef tagDef, @DefaultValue("true") @QueryParam("updateIfExists") boolean updateIfExists); @PUT @Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef updateTagDef(@PathParam("id") Long id, RangerTagDef tagDef); @DELETE @Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagDef(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.TAGDEF_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagDefByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef getTagDef(@PathParam("id") Long id); @GET @Path(TagRESTConstants.TAGDEF_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef getTagDefByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGDEF_RESOURCE + "name/{name}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef getTagDefByName(@PathParam("name") String name); @GET @Path(TagRESTConstants.TAGDEFS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTagDef> getAllTagDefs(); @GET @Path(TagRESTConstants.TAGTYPES_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<String> getTagTypes(); @POST @Path(TagRESTConstants.TAGS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag createTag(RangerTag tag, @DefaultValue("true") @QueryParam("updateIfExists") boolean updateIfExists); @PUT @Path(TagRESTConstants.TAG_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag updateTag(@PathParam("id") Long id, RangerTag tag); @PUT @Path(TagRESTConstants.TAG_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag updateTagByGuid(@PathParam("guid") String guid, RangerTag tag); @DELETE @Path(TagRESTConstants.TAG_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTag(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.TAG_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAG_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag getTag(@PathParam("id") Long id); @GET @Path(TagRESTConstants.TAG_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag getTagByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGS_RESOURCE + "type/{type}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTag> getTagsByType(@PathParam("type") String type); @GET @Path(TagRESTConstants.TAGS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTag> getAllTags(); @POST @Path(TagRESTConstants.RESOURCES_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource createServiceResource(RangerServiceResource resource, @DefaultValue("true") @QueryParam("updateIfExists") boolean updateIfExists); @PUT @Path(TagRESTConstants.RESOURCE_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource updateServiceResource(@PathParam("id") Long id, RangerServiceResource resource); @PUT @Path(TagRESTConstants.RESOURCE_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource updateServiceResourceByGuid(@PathParam("guid") String guid, RangerServiceResource resource); @DELETE @Path(TagRESTConstants.RESOURCE_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteServiceResource(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.RESOURCE_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteServiceResourceByGuid(@PathParam("guid") String guid, @DefaultValue("false") @QueryParam("deleteReferences") boolean deleteReferences); @GET @Path(TagRESTConstants.RESOURCE_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource getServiceResource(@PathParam("id") Long id); @GET @Path(TagRESTConstants.RESOURCE_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource getServiceResourceByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName); @GET @Path(TagRESTConstants.RESOURCE_RESOURCE + "service/{serviceName}/signature/{resourceSignature}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource getServiceResourceByServiceAndResourceSignature(@PathParam("serviceName") String serviceName,
                                                                       @PathParam("resourceSignature") String resourceSignature); @GET @Path(TagRESTConstants.RESOURCES_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerServiceResource> getAllServiceResources(); @POST @Path(TagRESTConstants.TAGRESOURCEMAPS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap createTagResourceMap(@QueryParam("tag-guid") String tagGuid, @QueryParam("resource-guid") String resourceGuid,
                                                     @DefaultValue("false") @QueryParam("lenient") boolean lenient); @DELETE @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagResourceMap(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagResourceMapByGuid(@PathParam("guid") String guid); @DELETE @Path(TagRESTConstants.TAGRESOURCEMAPS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagResourceMap(@QueryParam("tag-guid") String tagGuid, @QueryParam("resource-guid") String resourceGuid); @GET @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap getTagResourceMap(@PathParam("id") Long id); @GET @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap getTagResourceMapByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "tag-resource-guid") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap getTagResourceMap(@QueryParam("tagGuid") String tagGuid, @QueryParam("resourceGuid") String resourceGuid); @GET @Path(TagRESTConstants.TAGRESOURCEMAPS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTagResourceMap> getAllTagResourceMaps(); @PUT @Path(TagRESTConstants.IMPORT_SERVICETAGS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void importServiceTags(ServiceTags serviceTags); @GET @Path(TagRESTConstants.TAGS_DOWNLOAD + "{serviceName}") @Produces({ "application/json", "application/xml" }) ServiceTags getServiceTagsIfUpdated(@PathParam("serviceName") String serviceName,
                                                   @QueryParam(TagRESTConstants.LAST_KNOWN_TAG_VERSION_PARAM) Long lastKnownVersion,
                                               @DefaultValue("0") @QueryParam(TagRESTConstants.LAST_ACTIVATION_TIME) Long lastActivationTime, @QueryParam("pluginId") String pluginId,
                                               @DefaultValue("false") @QueryParam(RangerRESTUtils.REST_PARAM_SUPPORTS_TAG_DELTAS) Boolean supportsTagDeltas,
                                               @DefaultValue("") @QueryParam(RangerRESTUtils.REST_PARAM_CAPABILITIES) String pluginCapabilities,
                                               @Context HttpServletRequest request); @GET @Path(TagRESTConstants.TAGS_SECURE_DOWNLOAD + "{serviceName}") @Produces({ "application/json", "application/xml" }) ServiceTags getSecureServiceTagsIfUpdated(@PathParam("serviceName") String serviceName,
                                                   @QueryParam(TagRESTConstants.LAST_KNOWN_TAG_VERSION_PARAM) Long lastKnownVersion,
                                                     @DefaultValue("0") @QueryParam(TagRESTConstants.LAST_ACTIVATION_TIME) Long lastActivationTime, @QueryParam("pluginId") String pluginId,
                                                     @DefaultValue("false") @QueryParam(RangerRESTUtils.REST_PARAM_SUPPORTS_TAG_DELTAS) Boolean supportsTagDeltas,
                                                     @DefaultValue("") @QueryParam(RangerRESTUtils.REST_PARAM_CAPABILITIES) String pluginCapabilities,
                                                     @Context HttpServletRequest request); @DELETE @Path("/server/tagdeltas") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagDeltas(@DefaultValue("3") @QueryParam("days") Integer olderThan, @Context HttpServletRequest request); }
TagREST { @GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") public List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName) { if(LOG.isDebugEnabled()) { LOG.debug("==> TagREST.getServiceResourcesByService(" + serviceName + ")"); } List<RangerServiceResource> ret = null; try { ret = tagStore.getServiceResourcesByService(serviceName); } catch(Exception excp) { LOG.error("getServiceResourcesByService(" + serviceName + ") failed", excp); throw restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, excp.getMessage(), true); } if (CollectionUtils.isEmpty(ret)) { if (LOG.isDebugEnabled()) { LOG.debug("getServiceResourcesByService(" + serviceName + ") - No service-resources found"); } } if(LOG.isDebugEnabled()) { LOG.debug("<== TagREST.getServiceResourcesByService(" + serviceName + "): count=" + (ret == null ? 0 : ret.size())); } return ret; } TagREST(); @PostConstruct void initStore(); @POST @Path(TagRESTConstants.TAGDEFS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef createTagDef(RangerTagDef tagDef, @DefaultValue("true") @QueryParam("updateIfExists") boolean updateIfExists); @PUT @Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef updateTagDef(@PathParam("id") Long id, RangerTagDef tagDef); @DELETE @Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagDef(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.TAGDEF_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagDefByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGDEF_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef getTagDef(@PathParam("id") Long id); @GET @Path(TagRESTConstants.TAGDEF_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef getTagDefByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGDEF_RESOURCE + "name/{name}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagDef getTagDefByName(@PathParam("name") String name); @GET @Path(TagRESTConstants.TAGDEFS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTagDef> getAllTagDefs(); @GET @Path(TagRESTConstants.TAGTYPES_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<String> getTagTypes(); @POST @Path(TagRESTConstants.TAGS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag createTag(RangerTag tag, @DefaultValue("true") @QueryParam("updateIfExists") boolean updateIfExists); @PUT @Path(TagRESTConstants.TAG_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag updateTag(@PathParam("id") Long id, RangerTag tag); @PUT @Path(TagRESTConstants.TAG_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag updateTagByGuid(@PathParam("guid") String guid, RangerTag tag); @DELETE @Path(TagRESTConstants.TAG_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTag(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.TAG_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAG_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag getTag(@PathParam("id") Long id); @GET @Path(TagRESTConstants.TAG_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTag getTagByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGS_RESOURCE + "type/{type}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTag> getTagsByType(@PathParam("type") String type); @GET @Path(TagRESTConstants.TAGS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTag> getAllTags(); @POST @Path(TagRESTConstants.RESOURCES_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource createServiceResource(RangerServiceResource resource, @DefaultValue("true") @QueryParam("updateIfExists") boolean updateIfExists); @PUT @Path(TagRESTConstants.RESOURCE_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource updateServiceResource(@PathParam("id") Long id, RangerServiceResource resource); @PUT @Path(TagRESTConstants.RESOURCE_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource updateServiceResourceByGuid(@PathParam("guid") String guid, RangerServiceResource resource); @DELETE @Path(TagRESTConstants.RESOURCE_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteServiceResource(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.RESOURCE_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteServiceResourceByGuid(@PathParam("guid") String guid, @DefaultValue("false") @QueryParam("deleteReferences") boolean deleteReferences); @GET @Path(TagRESTConstants.RESOURCE_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource getServiceResource(@PathParam("id") Long id); @GET @Path(TagRESTConstants.RESOURCE_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource getServiceResourceByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.RESOURCES_RESOURCE + "service/{serviceName}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerServiceResource> getServiceResourcesByService(@PathParam("serviceName") String serviceName); @GET @Path(TagRESTConstants.RESOURCE_RESOURCE + "service/{serviceName}/signature/{resourceSignature}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerServiceResource getServiceResourceByServiceAndResourceSignature(@PathParam("serviceName") String serviceName,
                                                                       @PathParam("resourceSignature") String resourceSignature); @GET @Path(TagRESTConstants.RESOURCES_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerServiceResource> getAllServiceResources(); @POST @Path(TagRESTConstants.TAGRESOURCEMAPS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap createTagResourceMap(@QueryParam("tag-guid") String tagGuid, @QueryParam("resource-guid") String resourceGuid,
                                                     @DefaultValue("false") @QueryParam("lenient") boolean lenient); @DELETE @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagResourceMap(@PathParam("id") Long id); @DELETE @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagResourceMapByGuid(@PathParam("guid") String guid); @DELETE @Path(TagRESTConstants.TAGRESOURCEMAPS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagResourceMap(@QueryParam("tag-guid") String tagGuid, @QueryParam("resource-guid") String resourceGuid); @GET @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "{id}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap getTagResourceMap(@PathParam("id") Long id); @GET @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "guid/{guid}") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap getTagResourceMapByGuid(@PathParam("guid") String guid); @GET @Path(TagRESTConstants.TAGRESOURCEMAP_RESOURCE + "tag-resource-guid") @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") RangerTagResourceMap getTagResourceMap(@QueryParam("tagGuid") String tagGuid, @QueryParam("resourceGuid") String resourceGuid); @GET @Path(TagRESTConstants.TAGRESOURCEMAPS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") List<RangerTagResourceMap> getAllTagResourceMaps(); @PUT @Path(TagRESTConstants.IMPORT_SERVICETAGS_RESOURCE) @Produces({ "application/json", "application/xml" }) @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void importServiceTags(ServiceTags serviceTags); @GET @Path(TagRESTConstants.TAGS_DOWNLOAD + "{serviceName}") @Produces({ "application/json", "application/xml" }) ServiceTags getServiceTagsIfUpdated(@PathParam("serviceName") String serviceName,
                                                   @QueryParam(TagRESTConstants.LAST_KNOWN_TAG_VERSION_PARAM) Long lastKnownVersion,
                                               @DefaultValue("0") @QueryParam(TagRESTConstants.LAST_ACTIVATION_TIME) Long lastActivationTime, @QueryParam("pluginId") String pluginId,
                                               @DefaultValue("false") @QueryParam(RangerRESTUtils.REST_PARAM_SUPPORTS_TAG_DELTAS) Boolean supportsTagDeltas,
                                               @DefaultValue("") @QueryParam(RangerRESTUtils.REST_PARAM_CAPABILITIES) String pluginCapabilities,
                                               @Context HttpServletRequest request); @GET @Path(TagRESTConstants.TAGS_SECURE_DOWNLOAD + "{serviceName}") @Produces({ "application/json", "application/xml" }) ServiceTags getSecureServiceTagsIfUpdated(@PathParam("serviceName") String serviceName,
                                                   @QueryParam(TagRESTConstants.LAST_KNOWN_TAG_VERSION_PARAM) Long lastKnownVersion,
                                                     @DefaultValue("0") @QueryParam(TagRESTConstants.LAST_ACTIVATION_TIME) Long lastActivationTime, @QueryParam("pluginId") String pluginId,
                                                     @DefaultValue("false") @QueryParam(RangerRESTUtils.REST_PARAM_SUPPORTS_TAG_DELTAS) Boolean supportsTagDeltas,
                                                     @DefaultValue("") @QueryParam(RangerRESTUtils.REST_PARAM_CAPABILITIES) String pluginCapabilities,
                                                     @Context HttpServletRequest request); @DELETE @Path("/server/tagdeltas") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") void deleteTagDeltas(@DefaultValue("3") @QueryParam("days") Integer olderThan, @Context HttpServletRequest request); static final String Allowed_User_List_For_Tag_Download; }