本文整理汇总了Java中javax.ws.rs.QueryParam类的典型用法代码示例。如果您正苦于以下问题:Java QueryParam类的具体用法?Java QueryParam怎么用?Java QueryParam使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryParam类属于javax.ws.rs包,在下文中一共展示了QueryParam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeysMetadata
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path(KMSRESTConstants.KEYS_METADATA_RESOURCE)
@Produces(MediaType.APPLICATION_JSON)
public Response getKeysMetadata(@QueryParam(KMSRESTConstants.KEY)
List<String> keyNamesList) throws Exception {
KMSWebApp.getAdminCallsMeter().mark();
UserGroupInformation user = HttpUserGroupInformation.get();
final String[] keyNames = keyNamesList.toArray(
new String[keyNamesList.size()]);
assertAccess(KMSACLs.Type.GET_METADATA, user, KMSOp.GET_KEYS_METADATA);
KeyProvider.Metadata[] keysMeta = user.doAs(
new PrivilegedExceptionAction<KeyProvider.Metadata[]>() {
@Override
public KeyProvider.Metadata[] run() throws Exception {
return provider.getKeysMetadata(keyNames);
}
}
);
Object json = KMSServerJSONUtils.toJSON(keyNames, keysMeta);
kmsAudit.ok(user, KMSOp.GET_KEYS_METADATA, "");
return Response.ok().type(MediaType.APPLICATION_JSON).entity(json).build();
}
示例2: verifyInjectedIssuer
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path("/verifyInjectedIssuer")
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("Tester")
public JsonObject verifyInjectedIssuer(@QueryParam("iss") String iss) {
boolean pass = false;
String msg;
String issValue = issuer.getString();
if(issValue == null || issValue.length() == 0) {
msg = Claims.iss.name()+"value is null or empty, FAIL";
}
else if(issValue.equals(iss)) {
msg = Claims.iss.name()+" PASS";
pass = true;
}
else {
msg = String.format("%s: %s != %s", Claims.iss.name(), issValue, iss);
}
JsonObject result = Json.createObjectBuilder()
.add("pass", pass)
.add("msg", msg)
.build();
return result;
}
示例3: install
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@PUT
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "Install Presto using rpm or tarball")
@ApiResponses(value = {
@ApiResponse(code = 207, message = "Multiple responses available"),
@ApiResponse(code = 400, message = "Request contains invalid parameters")})
public Response install(String urlToFetchPackage,
@QueryParam("checkDependencies") @DefaultValue("true") boolean checkDependencies,
@QueryParam("scope") String scope,
@QueryParam("nodeId") List<String> nodeId)
{
ApiRequester.Builder apiRequester = requesterBuilder(ControllerPackageAPI.class)
.httpMethod(PUT)
.accept(MediaType.TEXT_PLAIN)
.entity(Entity.entity(urlToFetchPackage, MediaType.TEXT_PLAIN));
optionalQueryParam(apiRequester, "checkDependencies", checkDependencies);
return forwardRequest(scope, apiRequester.build(), nodeId);
}
示例4: getParticipantFromCGOR
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@ApiOperation(value = "getParticipantFromCGOR", nickname = "getParticipantFromCGOR")
@RequestMapping(value = "/CISConnector/getParticipantFromCGOR/{cgorName}", method = RequestMethod.GET)
@ApiImplicitParams({
@ApiImplicitParam(name = "cgorName", value = "the CGOR name", required = true, dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "organisation", value = "the Organisation name", required = true, dataType = "String", paramType = "query")
})
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = Participant.class),
@ApiResponse(code = 400, message = "Bad Request", response = Participant.class),
@ApiResponse(code = 500, message = "Failure", response = Participant.class)})
public ResponseEntity<Participant> getParticipantFromCGOR(@PathVariable String cgorName, @QueryParam("organisation") String organisation) {
log.info("--> getParticipantFromCGOR: " + cgorName);
Participant participant;
try {
participant = connector.getParticipantFromCGOR(cgorName, organisation);
} catch (CISCommunicationException e) {
log.error("Error executing the request: Communication Error" , e);
participant = null;
}
HttpHeaders responseHeaders = new HttpHeaders();
log.info("getParticipantFromCGOR -->");
return new ResponseEntity<Participant>(participant, responseHeaders, HttpStatus.OK);
}
示例5: deleteComment
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@DELETE
@Path("/{uuid}/{version}/comment")
@ApiOperation(value = "Delete a comment")
Response deleteComment(
@Context
UriInfo info,
@ApiParam(APIDOC_ITEMUUID)
@PathParam("uuid")
String uuid,
@ApiParam(APIDOC_ITEMVERSION)
@PathParam("version")
int version,
@ApiParam(APIDOC_ITEMVERSION)
@QueryParam("commentuuid")
String commentUuid
);
示例6: getConfigFile
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path("/{file}")
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "Get contents of a configuration file")
@ApiResponses(value = {
@ApiResponse(code = 207, message = "Multiple responses available"),
@ApiResponse(code = 400, message = "Request contains invalid parameters")})
public Response getConfigFile(
@PathParam("file") String file,
@QueryParam("scope") String scope,
@QueryParam("nodeId") List<String> nodeId)
{
ApiRequester apiRequester = requesterBuilder(ControllerConfigAPI.class)
.pathMethod("getConfigFile")
.httpMethod(GET)
.resolveTemplate("file", file)
.accept(MediaType.TEXT_PLAIN)
.build();
return forwardRequest(scope, apiRequester, nodeId);
}
示例7: get
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
public Collection<User> get(@QueryParam("userId") long userId) throws SQLException {
UsersManager usersManager = Context.getUsersManager();
Set<Long> result = null;
if (Context.getPermissionsManager().getUserAdmin(getUserId())) {
if (userId != 0) {
result = usersManager.getUserItems(userId);
} else {
result = usersManager.getAllItems();
}
} else if (Context.getPermissionsManager().getUserManager(getUserId())) {
result = usersManager.getManagedItems(getUserId());
} else {
throw new SecurityException("Admin or manager access required");
}
return usersManager.getItems(result);
}
示例8: graphIndirectPut
import javax.ws.rs.QueryParam; //导入依赖的package包/类
/**
* Indirect HTTP PUT
*
* @see <a href="http://www.w3.org/TR/sparql11-http-rdf-update/#http-put">
* Section 5.3 "HTTP PUT"
* </a>
* @param uriInfo JAX-RS {@link UriInfo} object
* @param type Content-Type HTTP header field
* @param graphString the "graph" query parameter
* @param def the "default" query parameter
* @param chunked the "chunked" query parameter
* @param in HTTP body as {@link InputStream}
* @return "204 No Content", if operation was successful
*/
@PUT
@Consumes({
RDFMediaType.RDF_TURTLE,
RDFMediaType.RDF_YARS,
RDFMediaType.RDF_XML,
RDFMediaType.RDF_NTRIPLES,
RDFMediaType.RDF_XML
})
public Response graphIndirectPut(
@Context UriInfo uriInfo,
@HeaderParam("Content-Type") MediaType type,
@QueryParam("graph") String graphString,
@QueryParam("default") String def,
@QueryParam("chunked") String chunked,
InputStream in) {
return handleAdd(uriInfo, type, graphString, def, in, chunked, true);
}
示例9: getProbandListEntryTagValues
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Produces({ MediaType.APPLICATION_JSON })
@Path("{id}/tagvalues")
public JsValuesOutVOPage<ProbandListEntryTagValueOutVO, ProbandListEntryTagValueJsonVO> getProbandListEntryTagValues(@PathParam("id") Long id,
@QueryParam("sort") Boolean sort, @QueryParam("load_all_js_values") Boolean loadAllJsValues, @Context UriInfo uriInfo)
throws AuthenticationException, AuthorisationException, ServiceException {
PSFUriPart psf = new PSFUriPart(uriInfo, "sort", "load_all_js_values");
ProbandListEntryTagValuesOutVO values = WebUtil.getServiceLocator().getTrialService()
.getProbandListEntryTagValues(auth, id, sort, loadAllJsValues, psf);
return new JsValuesOutVOPage<ProbandListEntryTagValueOutVO, ProbandListEntryTagValueJsonVO>(values.getPageValues(), values.getJsValues(), psf);
// PSFUriPart psf;
// return new ProbandListEntryTagValuesOutVOPage(WebUtil.getServiceLocator().getTrialService()
// .getProbandListEntryTagValues(auth, id, false, false, psf = new PSFUriPart(uriInfo)),
// psf);
// return WebUtil.getServiceLocator().getTrialService().getProbandListEntryTagValues(auth, id, false, false, new PSFUriPart(uriInfo));
}
示例10: deleteConnectorProperty
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@DELETE
@Path("/{file}/{property}")
@ApiOperation(value = "Delete a certain property of connector file")
@ApiResponses(value = {
@ApiResponse(code = 207, message = "Multiple responses available"),
@ApiResponse(code = 400, message = "Request contains invalid parameters")})
public Response deleteConnectorProperty(
@PathParam("file") String file,
@PathParam("property") String property,
@QueryParam("scope") String scope,
@QueryParam("nodeId") List<String> nodeId)
{
ApiRequester apiRequester = requesterBuilder(ControllerConnectorAPI.class)
.pathMethod("deleteConnectorProperty")
.httpMethod(DELETE)
.resolveTemplate("file", file)
.resolveTemplate("property", property)
.accept(MediaType.TEXT_PLAIN)
.build();
return forwardRequest(scope, apiRequester, nodeId);
}
示例11: setZNodeAsOctet
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@PUT
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public void setZNodeAsOctet(@PathParam("path") String path,
@DefaultValue("-1") @QueryParam("version") String versionParam,
@DefaultValue("false") @QueryParam("null") String setNull,
@Context UriInfo ui, byte[] data) throws InterruptedException,
KeeperException {
ensurePathNotNull(path);
int version;
try {
version = Integer.parseInt(versionParam);
} catch (NumberFormatException e) {
throw new WebApplicationException(Response.status(
Response.Status.BAD_REQUEST).entity(
new ZError(ui.getRequestUri().toString(), path
+ " bad version " + versionParam)).build());
}
if (setNull.equals("true")) {
data = null;
}
zk.setData(path, data, version);
}
示例12: tasksSearch
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path("/")
@ApiOperation(value = "Search tasks")
public Response tasksSearch(
// @formatter:off
@Context UriInfo uriInfo,
@ApiParam(value="The filtering to apply to the task list", allowableValues = "all,assignedme,assignedothers,assignednone,mustmoderate", required = false, defaultValue=DEFAULT_FILTER) @QueryParam("filter")
String filtering,
@ApiParam(value="Query string", required = false) @QueryParam("q")
String q,
@ApiParam(value="The first record of the search results to return", required = false, defaultValue="0") @QueryParam("start")
int start,
@ApiParam(value="The number of results to return", required = false, defaultValue = "10", allowableValues = "range[1,100]") @QueryParam("length")
int length,
@ApiParam(value="List of collections", required = false) @QueryParam("collections")
CsvList collections,
@ApiParam(value="The order of the search results", allowableValues="priority,duedate,waiting, name", required = false) @QueryParam("order")
String order,
@ApiParam(value="Reverse the order of the search results", allowableValues = ",true,false", defaultValue = "false", required = false)
@QueryParam("reverse")
String reverse
);
示例13: verifyInjectedCustomString
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path("/verifyInjectedCustomString")
@Produces(MediaType.APPLICATION_JSON)
public JsonObject verifyInjectedCustomString(@QueryParam("value") String value) {
boolean pass = false;
String msg;
// iat
String customValue = this.customString;
if (customValue == null || customValue.length() == 0) {
msg = "customString value is null or empty, FAIL";
}
else if (customValue.equals(value)) {
msg = "customString PASS";
pass = true;
}
else {
msg = String.format("customString: %s != %s", customValue, value);
}
JsonObject result = Json.createObjectBuilder()
.add("pass", pass)
.add("msg", msg)
.build();
return result;
}
示例14: getJobTasks
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path("/mapreduce/jobs/{jobid}/tasks")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public TasksInfo getJobTasks(@Context HttpServletRequest hsr,
@PathParam("jobid") String jid, @QueryParam("type") String type) {
init();
Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
checkAccess(job, hsr);
TasksInfo allTasks = new TasksInfo();
for (Task task : job.getTasks().values()) {
TaskType ttype = null;
if (type != null && !type.isEmpty()) {
try {
ttype = MRApps.taskType(type);
} catch (YarnRuntimeException e) {
throw new BadRequestException("tasktype must be either m or r");
}
}
if (ttype != null && task.getType() != ttype) {
continue;
}
allTasks.add(new TaskInfo(task));
}
return allTasks;
}
示例15: getConfigProperty
import javax.ws.rs.QueryParam; //导入依赖的package包/类
@GET
@Path("/{file}/{property}")
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "Get specific configuration property")
@ApiResponses(value = {
@ApiResponse(code = 207, message = "Multiple responses available"),
@ApiResponse(code = 400, message = "Request contains invalid parameters")})
public Response getConfigProperty(
@PathParam("file") String file,
@PathParam("property") String property,
@QueryParam("scope") String scope,
@QueryParam("nodeId") List<String> nodeId)
{
ApiRequester apiRequester = requesterBuilder(ControllerConfigAPI.class)
.pathMethod("getConfigProperty")
.httpMethod(GET)
.resolveTemplate("file", file)
.resolveTemplate("property", property)
.accept(MediaType.TEXT_PLAIN)
.build();
return forwardRequest(scope, apiRequester, nodeId);
}