类javax.ws.rs.DefaultValue源码实例Demo

下面列出了怎么用javax.ws.rs.DefaultValue的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: datacollector   文件: AdminResource.java
@GET
@Path("/bundle/generate")
@ApiOperation(
    value = "Generates a new support bundle.",
    response = Object.class,
    authorizations = @Authorization(value = "basic")
)
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/octet-stream")
@RolesAllowed({
    AuthzRole.ADMIN,
    AuthzRole.ADMIN_REMOTE
})
public Response createSupportBundlesContentGenerators(
  @QueryParam("generators") @DefaultValue("") String generators
) throws IOException {
  SupportBundle bundle = supportBundleManager.generateNewBundle(getGeneratorList(generators), BundleType.SUPPORT);

  return Response
    .ok()
    .header("content-disposition", "attachment; filename=\"" + bundle.getBundleName() + "\"")
    .entity(bundle.getInputStream())
    .build();
}
 
源代码2 项目: pnc   文件: ArtifactEndpoint.java
@GET
public Response getAll(
        @QueryParam(PAGE_INDEX_QUERY_PARAM) @DefaultValue(PAGE_INDEX_DEFAULT_VALUE) int pageIndex,
        @QueryParam(PAGE_SIZE_QUERY_PARAM) @DefaultValue(PAGE_SIZE_DEFAULT_VALUE) int pageSize,
        @QueryParam(SORTING_QUERY_PARAM) String sort,
        @QueryParam(QUERY_QUERY_PARAM) String q,
        @QueryParam("sha256") String sha256,
        @QueryParam("md5") String md5,
        @QueryParam("sha1") String sha1) {
    return fromCollection(
            artifactProvider.getAll(
                    pageIndex,
                    pageSize,
                    sort,
                    q,
                    Optional.ofNullable(sha256),
                    Optional.ofNullable(md5),
                    Optional.ofNullable(sha1)));
}
 
源代码3 项目: usergrid   文件: UserResource.java
@CheckPermissionsForPath
@POST
@Path("deactivate")
@JSONP
@Produces({MediaType.APPLICATION_JSON, "application/javascript"})
public ApiResponse deactivate( @Context UriInfo ui, Map<String, Object> json,
                                   @QueryParam("callback") @DefaultValue("") String callback ) throws Exception {

    ApiResponse response = createApiResponse();
    response.setAction( "Deactivate user" );

    User user = management.deactivateUser( getApplicationId(), getUserUuid() );

    response.withEntity( user );

    return response;
}
 
源代码4 项目: semanticMDR   文件: RepositoryService.java
@GET
@Path("/cd")
@Produces(MediaType.APPLICATION_JSON)
public Response listConceptualDomains(
		@CookieParam(AuthenticationService.SID) String sessionID,
		@QueryParam("limit") @DefaultValue("10") Integer limit,
		@QueryParam("offset") @DefaultValue("0") Integer offset) {
	WebUtil.checkUserSession(sessionID);
	Repository repository = RepositoryManager.getInstance().getRepository();
	List<ConceptualDomain> cdList = repository.getConceptualDomains(limit,
			offset);

	List<ConceptualDomainModel> cdModelList = new ArrayList<ConceptualDomainModel>();
	for (ConceptualDomain cd : cdList) {
		if (cd instanceof EnumeratedConceptualDomain) {
			cdModelList.add(new ConceptualDomainModel(cd, true));
		} else {
			cdModelList.add(new ConceptualDomainModel(cd, false));
		}
	}

	return Response.ok(cdModelList).build();
}
 
源代码5 项目: brooklyn-server   文件: EntityConfigApi.java
@POST
@Path("/{config}")
@ApiOperation(value = "Manually set a config value")
@ApiResponses(value = {
        @ApiResponse(code = 404, message = "Could not find application, entity or config key")
})
public void set(
        @ApiParam(value = "Application ID or name", required = true)
        @PathParam("application") final String application,
        @ApiParam(value = "Entity ID or name", required = true)
        @PathParam("entity") final String entityToken,
        @ApiParam(value = "Config key name", required = true)
        @PathParam("config") String configName,
        @ApiParam(value = "Apply the config to all pre-existing descendants", required = false)
        @QueryParam("recurse") @DefaultValue("false") final Boolean recurse,
        @ApiParam(value = "Value to set")
        Object newValue);
 
源代码6 项目: atlas   文件: GlossaryREST.java
/**
 * Get all terms associated with the specific category
 * @param categoryGuid unique identifier for glossary category
 * @param limit page size - by default there is no paging
 * @param offset offset for pagination purpose
 * @param sort ASC (default) or DESC
 * @return List of associated terms
 * @throws AtlasBaseException
 * @HTTP 200 List of terms for the given category or an empty list
 * @HTTP 404 If glossary category guid in invalid
 */
@GET
@Path("/category/{categoryGuid}/terms")
public List<AtlasRelatedTermHeader> getCategoryTerms(@PathParam("categoryGuid") String categoryGuid,
                                                     @DefaultValue("-1") @QueryParam("limit") String limit,
                                                     @DefaultValue("0") @QueryParam("offset") String offset,
                                                     @DefaultValue("ASC") @QueryParam("sort") final String sort) throws AtlasBaseException {
    Servlets.validateQueryParamLength("categoryGuid", categoryGuid);

    AtlasPerfTracer perf = null;
    try {
        if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
            perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "GlossaryREST.getCategoryTerms(" + categoryGuid + ")");
        }

        return glossaryService.getCategoryTerms(categoryGuid, Integer.parseInt(offset), Integer.parseInt(limit), toSortOrder(sort));

    } finally {
        AtlasPerfTracer.log(perf);
    }
}
 
源代码7 项目: AIDR   文件: CollectionController.java
@RequestMapping(value = "/generateJsonTweetIdsLink.action", method = RequestMethod.GET)
@ResponseBody
public Map<String,Object> generateJsonTweetIdsLink(@RequestParam String code,
		@DefaultValue(DownloadType.TEXT_JSON) @QueryParam("jsonType") String jsonType) throws Exception {
	Map<String, Object> result = null;
	try {
		result = collectionLogService.generateJsonTweetIdsLink(code, jsonType);
		if (result != null && result.get("url") != null) {
			return getUIWrapper(result.get("url"),true, null, (String)result.get("message"));
		} else {
			return getUIWrapper(false, "Something wrong - no file generated!");
		}
	} catch (Exception e) {
		logger.error("Error while generating JSON Tweet Ids Link for collection: "+code +"and jsonType: "+jsonType, e);
		return getUIWrapper(false, "System is down or under maintenance. For further inquiries please contact admin.");
	}
}
 
源代码8 项目: qcon-microservices   文件: OrderService.java
/**
 * Perform a "Long-Poll" styled get. This method will attempt to get the value for the passed key
 * blocking until the key is available or passed timeout is reached. Non-blocking IO is used to
 * implement this, but the API will block the calling thread if no data is available
 *
 * @param id - the key of the value to retrieve
 * @param timeout - the timeout for the long-poll
 * @param asyncResponse - async response used to trigger the poll early should the appropriate
 * value become available
 */
@GET
@ManagedAsync
@Path("/orders/{id}")
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN})
public void getWithTimeout(@PathParam("id") final String id,
                           @QueryParam("timeout") @DefaultValue(CALL_TIMEOUT) Long timeout,
                           @Suspended final AsyncResponse asyncResponse) {
    setTimeout(timeout, asyncResponse);

    log.info("running GET on this node");
    try {
        Order order = ordersStore().get(id);
        if (order == null) {
            log.info("Delaying get as order not present for id " + id);
            outstandingRequests.put(id, new FilteredResponse<>(asyncResponse, (k, v) -> true));
        } else {
            asyncResponse.resume(order);
        }
    } catch (InvalidStateStoreException e) {
        //Store not ready so delay
        log.info("Delaying request for " + id + " because state store is not ready.");
        outstandingRequests.put(id, new FilteredResponse<>(asyncResponse, (k, v) -> true));
    }
}
 
源代码9 项目: olingo-odata4   文件: Services.java
/**
 * Replace property.
 *
 * @param accept
 * @param entitySetName
 * @param entityId
 * @param path
 * @param format
 * @param changes
 * @return response
 */
@PUT
@Path("/{entitySetName}({entityId})/{path:.*}")
public Response replaceProperty(
    @Context final UriInfo uriInfo,
    @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
    @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
    @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) final String prefer,
    @PathParam("entitySetName") final String entitySetName,
    @PathParam("entityId") final String entityId,
    @PathParam("path") final String path,
    @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
    final String changes) {

  if (xml.isMediaContent(entitySetName + "/" + path)) {
    return replaceMediaProperty(prefer, entitySetName, entityId, path, changes);
  } else {
    return replaceProperty(uriInfo.getRequestUri().toASCIIString(),
        accept, contentType, prefer, entitySetName, entityId, path, format, changes, false);
  }
}
 
源代码10 项目: datacollector   文件: ManagerResource.java
@Path("/pipeline/{pipelineId}/alerts")
@DELETE
@ApiOperation(value = "Delete alert by Pipeline name, revision and Alert ID", response = Boolean.class,
  authorizations = @Authorization(value = "basic"))
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed({
    AuthzRole.MANAGER,
    AuthzRole.ADMIN,
    AuthzRole.MANAGER_REMOTE,
    AuthzRole.ADMIN_REMOTE
})
public Response deleteAlert(
  @PathParam("pipelineId") String pipelineId,
  @QueryParam("rev") @DefaultValue("0") String rev,
  @QueryParam("alertId") String alertId
) throws PipelineException {
  PipelineInfo pipelineInfo = store.getInfo(pipelineId);
  RestAPIUtils.injectPipelineInMDC(pipelineInfo.getTitle(), pipelineInfo.getPipelineId());
  return Response.ok().type(MediaType.APPLICATION_JSON).entity(
    manager.getRunner(pipelineId, rev).deleteAlert(alertId)).build();
}
 
源代码11 项目: cxf   文件: BookStoreOpenApi.java
@Produces({ MediaType.APPLICATION_JSON })
@GET
@Operation(
    description = "Get books",
    responses = @ApiResponse(
        responseCode = "200", 
        content = @Content(
            mediaType = MediaType.APPLICATION_JSON,
            array = @ArraySchema(schema = @Schema(implementation = Book.class))
        )
    )
)
public Response getBooks(
    @Parameter(description = "Page to fetch", required = true) @QueryParam("page") @DefaultValue("1") int page) {
    return Response.ok(
        Arrays.asList(
            new Book("Book 1", 1),
            new Book("Book 2", 2)
        )
    ).build();
}
 
源代码12 项目: proarc   文件: ImportResource.java
@POST
@Path(ImportResourceApi.BATCH_PATH)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public SmartGwtResponse<BatchView> newBatch(
        @FormParam(ImportResourceApi.IMPORT_BATCH_FOLDER) @DefaultValue("") String path,
        @FormParam(ImportResourceApi.NEWBATCH_DEVICE_PARAM) String device,
        @FormParam(ImportResourceApi.NEWBATCH_INDICES_PARAM) @DefaultValue("true") boolean indices,
        @FormParam(ImportResourceApi.IMPORT_BATCH_PROFILE) String profileId
        ) throws URISyntaxException, IOException {
    
    LOG.log(Level.FINE, "import path: {0}, indices: {1}, device: {2}",
            new Object[] {path, indices, device});
    String folderPath = validateParentPath(path);
    URI userRoot = user.getImportFolder();
    URI folderUri = (folderPath != null)
            // URI multi param constructor escapes input unlike single param constructor or URI.create!
            ? userRoot.resolve(new URI(null, null, folderPath, null))
            : userRoot;
    File folder = new File(folderUri);
    ConfigurationProfile profile = findImportProfile(null, profileId);
    ImportProcess process = ImportProcess.prepare(folder, folderPath, user,
            importManager, device, indices, appConfig.getImportConfiguration(profile));
    ImportDispatcher.getDefault().addImport(process);
    Batch batch = process.getBatch();
    return new SmartGwtResponse<BatchView>(importManager.viewBatch(batch.getId()));
}
 
源代码13 项目: pulsar   文件: PersistentTopics.java
@POST
@Path("/{property}/{cluster}/{namespace}/{topic}/subscription/{subName}/resetcursor/{timestamp}")
@ApiOperation(hidden = true, value = "Reset subscription to message position closest to absolute timestamp (in ms).", notes = "It fence cursor and disconnects all active consumers before reseting cursor.")
@ApiResponses(value = {
        @ApiResponse(code = 307, message = "Current broker doesn't serve the namespace of this topic"),
        @ApiResponse(code = 403, message = "Don't have admin permission"),
        @ApiResponse(code = 404, message = "Topic/Subscription does not exist") })
public void resetCursor(@Suspended final AsyncResponse asyncResponse, @PathParam("property") String property,
        @PathParam("cluster") String cluster, @PathParam("namespace") String namespace,
        @PathParam("topic") @Encoded String encodedTopic, @PathParam("subName") String encodedSubName,
        @PathParam("timestamp") long timestamp,
        @QueryParam("authoritative") @DefaultValue("false") boolean authoritative) {
    try {
        validateTopicName(property, cluster, namespace, encodedTopic);
        internalResetCursor(asyncResponse, decode(encodedSubName), timestamp, authoritative);
    } catch (WebApplicationException wae) {
        asyncResponse.resume(wae);
    } catch (Exception e) {
        asyncResponse.resume(new RestException(e));
    }
}
 
源代码14 项目: keycloak   文件: GroupsResource.java
/**
 * Get group hierarchy.  Only name and ids are returned.
 *
 * @return
 */
@GET
@NoCache
@Produces(MediaType.APPLICATION_JSON)
public List<GroupRepresentation> getGroups(@QueryParam("search") String search,
                                           @QueryParam("first") Integer firstResult,
                                           @QueryParam("max") Integer maxResults,
                                           @QueryParam("briefRepresentation") @DefaultValue("true") boolean briefRepresentation) {
    auth.groups().requireList();

    List<GroupRepresentation> results;

    if (Objects.nonNull(search)) {
        results = ModelToRepresentation.searchForGroupByName(realm, !briefRepresentation, search.trim(), firstResult, maxResults);
    } else if(Objects.nonNull(firstResult) && Objects.nonNull(maxResults)) {
        results = ModelToRepresentation.toGroupHierarchy(realm, !briefRepresentation, firstResult, maxResults);
    } else {
        results = ModelToRepresentation.toGroupHierarchy(realm, !briefRepresentation);
    }

    return results;
}
 
源代码15 项目: olingo-odata4   文件: Services.java
@PUT
@Path("/People(1)/Parent")
public Response changeSingleValuedNavigationPropertyReference(
    @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
    @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
    final String content) {

  try {
    final Accept contentTypeValue = Accept.parse(contentType);
    assert contentTypeValue == Accept.JSON;

    jsonDeserializer.toEntity(IOUtils.toInputStream(content, Constants.ENCODING));

    return Response.noContent().type(MediaType.APPLICATION_JSON).build();
  } catch (Exception e) {
    LOG.error("While update single property reference", e);
    return xml.createFaultResponse(accept, e);
  }
}
 
源代码16 项目: pulsar   文件: Namespaces.java
@GET
@Path("/{tenant}/{namespace}/topics")
@ApiOperation(value = "Get the list of all the topics under a certain namespace.", response = String.class, responseContainer = "Set")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
        @ApiResponse(code = 404, message = "Tenant or cluster or namespace doesn't exist") })
public void getTopics(@PathParam("tenant") String tenant,
                              @PathParam("namespace") String namespace,
                              @QueryParam("mode") @DefaultValue("PERSISTENT") Mode mode,
                              @Suspended AsyncResponse asyncResponse) {
    validateNamespaceName(tenant, namespace);
    validateNamespaceOperation(NamespaceName.get(tenant, namespace), NamespaceOperation.GET_TOPICS);

    // Validate that namespace exists, throws 404 if it doesn't exist
    getNamespacePolicies(namespaceName);

    pulsar().getNamespaceService().getListOfTopics(namespaceName, mode)
            .thenAccept(asyncResponse::resume)
            .exceptionally(ex -> {
                log.error("Failed to get topics list for namespace {}", namespaceName, ex);
                asyncResponse.resume(ex);
                return null;
            });
}
 
源代码17 项目: quarkus   文件: MultiDataSourcesDevModeEndpoint.java
@GET
@Produces("text/plain")
public String locations(@QueryParam("name") @DefaultValue("default") String name) {
    Configuration configuration;
    if ("default".equals(name)) {
        configuration = flywayDefault.getConfiguration();
    } else if ("users".equals(name)) {
        configuration = flywayUsers.getConfiguration();
    } else if ("inventory".equals(name)) {
        configuration = flywayInventory.getConfiguration();
    } else {
        throw new RuntimeException("Flyway " + name + " not found");
    }

    return Arrays.stream(configuration.getLocations()).map(Location::getPath).collect(Collectors.joining(","));
}
 
源代码18 项目: pulsar   文件: PersistentTopics.java
@GET
@Path("/{property}/{cluster}/{namespace}/{topic}/subscriptions")
@ApiOperation(hidden = true, value = "Get the list of persistent subscriptions for a given topic.")
@ApiResponses(value = {
        @ApiResponse(code = 307, message = "Current broker doesn't serve the namespace of this topic"),
        @ApiResponse(code = 403, message = "Don't have admin permission"),
        @ApiResponse(code = 404, message = "Topic does not exist") })
public void getSubscriptions(@Suspended final AsyncResponse asyncResponse, @PathParam("property") String property,
        @PathParam("cluster") String cluster, @PathParam("namespace") String namespace,
        @PathParam("topic") @Encoded String encodedTopic,
        @QueryParam("authoritative") @DefaultValue("false") boolean authoritative) {
    try {
        validateTopicName(property, cluster, namespace, encodedTopic);
        internalGetSubscriptions(asyncResponse, authoritative);
    } catch (WebApplicationException wae) {
        asyncResponse.resume(wae);
    } catch (Exception e) {
        asyncResponse.resume(new RestException(e));
    }
}
 
源代码19 项目: brooklyn-server   文件: CatalogApi.java
/** @deprecated since 0.11.0 use {@link #createFromYaml(String)} instead */
@Deprecated
@Consumes("application/json-deprecated")  // prevent this from taking things
@POST
@ApiOperation(
        value = "Add a catalog items (e.g. new type of entity, policy or location) by uploading YAML descriptor (deprecated, use POST of yaml or ZIP/JAR instead)",
        notes = "Return value is map of ID to CatalogItemSummary.",
        response = String.class,
        hidden = true
)
@ApiResponses(value = {
        @ApiResponse(code = 400, message = "Error processing the given YAML"),
        @ApiResponse(code = 201, message = "Catalog items added successfully")
})
public Response create(String yaml,
        @ApiParam(name="forceUpdate", value="Force update of catalog item (overwriting existing catalog items with same name and version)")
        @QueryParam("forceUpdate") @DefaultValue("false") boolean forceUpdate);
 
源代码20 项目: timbuctoo   文件: Search.java
@GET
@Path("{id}")
/*
 * Use UUIDParam instead of UUID, because we want to be explicit to the user of this API the request is not
 * supported. When UUID is used Jersery returns a '404 Not Found' if the request contains a malformed one. The
 * UUIDParam will return a '400 Bad Request' for malformed UUID's.
 * See: http://www.dropwizard.io/0.9.1/dropwizard-jersey/apidocs/io/dropwizard/jersey/params/AbstractParam.html
 * Or: http://codahale.com/what-makes-jersey-interesting-parameter-classes/
 */
public Response get(@PathParam("id") UUIDParam id,
                    @QueryParam("rows") @DefaultValue("10") int rows,
                    @QueryParam("start") @DefaultValue("0") int start) {
  Optional<SearchResult> searchResult = searchStore.getSearchResult(id.get());
  if (searchResult.isPresent()) {
    return Response.ok(searchResponseFactory.createResponse(searchResult.get(), rows, start)).build();
  }

  return Response
    .status(Response.Status.NOT_FOUND)
    .entity(new NotFoundMessage(id))
    .build();
}
 
源代码21 项目: opencps-v2   文件: EmployeeManagement.java
@PUT
@Path("/{id}")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response update(@Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company,
		@Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@DefaultValue("0") @PathParam("id") long id, @BeanParam EmployeeInputModel input);
 
源代码22 项目: dexter   文件: JSONPService.java
@GET
@Path("/relatedness")
@ApiOperation(value = "Return the semantic relatedness between two entities", response = Relatedness.class)
@Produces({ MediaType.APPLICATION_JSON })
public String relatedness(@Context UriInfo ui,
		@QueryParam("callback") @DefaultValue("callback") String callback,
		@QueryParam("e1") String e1, @QueryParam("e2") String e2,
		@QueryParam("rel") @DefaultValue("milnewitten") String rel,
		@QueryParam("wn") @DefaultValue("false") String wikiNames,
		@QueryParam("debug") @DefaultValue("false") String dbg) {

	return addCallback(callback,
			r.relatedness(ui, e1, e2, rel, wikiNames, dbg));

}
 
源代码23 项目: cxf   文件: BookStore.java
@Descriptions({
    @Description(value = "Update the books collection", target = DocTarget.METHOD),
    @Description(value = "Requested Book", target = DocTarget.RETURN),
    @Description(value = "Request", target = DocTarget.REQUEST),
    @Description(value = "Response", target = DocTarget.RESPONSE),
    @Description(value = "Resource books/{bookid}", target = DocTarget.RESOURCE)
})
@ResponseStatus({Status.CREATED, Status.OK })
//CHECKSTYLE:OFF
@POST
@Path("books/{bookid}")
public Book addBook(@Description("book id") //NOPMD
                    @PathParam("id") int id,
                    @PathParam("bookid") int bookId,
                    @MatrixParam("mid") @DefaultValue("mid > 5") String matrixId,
                    @Description("header param")
                    @HeaderParam("hid") int headerId,
                    @CookieParam("cid") int cookieId,
                    @QueryParam("provider.bar") int queryParam,
                    @QueryParam("bookstate") BookEnum state,
                    @QueryParam("orderstatus") BookOrderEnum status,
                    @QueryParam("a") List<String> queryList,
                    @Context HttpHeaders headers,
                    @Description("InputBook")
                    @XMLName(value = "{http://books}thesuperbook2")
                    Book2 b) {
    return new Book(1);
}
 
源代码24 项目: emodb   文件: RawDatabusResource1.java
@GET
@Path("{subscription}/peek")
public List<Event> peek(@PathParam("subscription") String subscription,
                        @QueryParam("limit") @DefaultValue("10") IntParam limit) {
    checkLegalSubscriptionName(subscription);
    return fromInternal(_eventStore.peek(subscription, limit.get()));
}
 
源代码25 项目: emodb   文件: ReportResource1.java
@Path ("tables/{reportId}/entries")
@GET
public Iterable<TableReportEntry> getTableReportEntries(@PathParam  ("reportId") String reportId,
                                          @QueryParam ("table") List<String> tables,
                                          @QueryParam ("placement") List<String> placements,
                                          @QueryParam ("includeDropped") @DefaultValue ("true") boolean includeDropped,
                                          @QueryParam ("includeFacades") @DefaultValue ("true") boolean includeFacades,
                                          @QueryParam ("from") String fromTable,
                                          @QueryParam ("limit") @DefaultValue ("10") int limit) {

    AllTablesReportQuery query = new AllTablesReportQuery();
    if (tables != null && !tables.isEmpty()) {
        query.setTableNames(tables);
    }
    if (placements != null && !placements.isEmpty()) {
        query.setPlacements(placements);
    }
    if (fromTable != null) {
        query.setFromTable(fromTable);
    }
    query.setIncludeDropped(includeDropped);
    query.setIncludeFacades(includeFacades);
    query.setLimit(limit);

    try {
        return _reportLoader.getTableReportEntries(reportId, query);
    } catch (ReportNotFoundException e) {
        throw handleException(reportId, e);
    }
}
 
源代码26 项目: rapid   文件: Container.java
@DELETE
@Path("{id}")
public Response deleteContainer(@PathParam("id") String containerId,
                                @DefaultValue("false") @QueryParam("v") String v,
                                @DefaultValue("false") @QueryParam("force") String force) {

    WebTarget target = resource().path(CONTAINERS)
            .path(containerId)
            .queryParam("v", v)
            .queryParam("force", force);

    Response response = deleteResponse(target);
    String entity = response.readEntity(String.class);

    try {
        if (entity.isEmpty()) {
            return Response.ok(Json.createObjectBuilder().add(MESSAGE, containerId + " deleted.").build())
                    .build();
        } else {
            return Response.status(response.getStatus())
                    .entity(Json.createReader(new StringReader(entity)).read())
                    .build();
        }
    } finally {
        response.close();
    }
}
 
源代码27 项目: olingo-odata4   文件: Services.java
@POST
@Path("/$batch")
@Consumes(MULTIPART_MIXED)
@Produces(APPLICATION_OCTET_STREAM + ";boundary=" + BOUNDARY)
public Response batch(
    @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) final String prefer,
    final @Multipart MultipartBody attachment) {
  try {
    final boolean continueOnError = prefer.contains("odata.continue-on-error");
    return xml.createBatchResponse(
        exploreMultipart(attachment.getAllAttachments(), BOUNDARY, continueOnError));
  } catch (IOException e) {
    return xml.createFaultResponse(Accept.XML.toString(), e);
  }
}
 
源代码28 项目: metacat   文件: MetadataV1.java
/**
 * Delete the definition metadata for the given name.
 *
 * @param name  Name of definition metadata to be deleted
 * @param force If true, deletes the metadata without checking if the database/table/partition exists
 */
@DELETE
@Path("definition")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
void deleteDefinitionMetadata(
    @QueryParam("name")
        String name,
    @DefaultValue("false")
    @QueryParam("force")
        Boolean force
);
 
源代码29 项目: brooklyn-server   文件: CatalogResource.java
@Override
@Deprecated
public List<CatalogEnricherSummary> listEnrichers(@ApiParam(name = "regex", value = "Regular expression to search for") @DefaultValue("") String regex, @ApiParam(name = "fragment", value = "Substring case-insensitive to search for") @DefaultValue("") String fragment, @ApiParam(name = "allVersions", value = "Include all versions (defaults false, only returning the best version)") @DefaultValue("false") boolean includeAllVersions) {
    Predicate<RegisteredType> filter =
            Predicates.and(
                    RegisteredTypePredicates.IS_ENRICHER,
                    RegisteredTypePredicates.disabled(false));
    List<CatalogItemSummary> result = getCatalogItemSummariesMatchingRegexFragment(filter, regex, fragment, includeAllVersions);
    return castList(result, CatalogEnricherSummary.class);
}
 
源代码30 项目: che   文件: RemoteServiceDescriptorTest.java
@GET
@Path("my_method")
@GenerateLink(rel = "echo")
@Produces(MediaType.TEXT_PLAIN)
public String echo(
    @Description("some text")
        @Required
        @Valid({"a", "b"})
        @DefaultValue("a")
        @QueryParam("text")
        String test) {
  return test;
}
 
 类所在包
 类方法
 同包方法