本文整理汇总了Java中javax.ws.rs.core.MediaType.APPLICATION_XML属性的典型用法代码示例。如果您正苦于以下问题:Java MediaType.APPLICATION_XML属性的具体用法?Java MediaType.APPLICATION_XML怎么用?Java MediaType.APPLICATION_XML使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.ws.rs.core.MediaType
的用法示例。
在下文中一共展示了MediaType.APPLICATION_XML属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updatePaymentFileApprovalNoAttachment
@PUT
@Path("/{id}/payments/{referenceUid}/approval/noattachment")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED})
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED})
@ApiOperation(value = "Update PaymentFile")
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response updatePaymentFileApprovalNoAttachment(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext,
@ApiParam(value = "id of dossier", required = true) @PathParam("id") String id,
@ApiParam(value = "reference of paymentFile", required = true) @PathParam("referenceUid") String referenceUid,
@BeanParam PaymentFileInputModel input);
示例2: launchEvent
@GET
@Secured
@Path("/launchevent/{eventId}")
@Produces(MediaType.APPLICATION_XML)
public SessionInfo launchEvent(@HeaderParam("securityToken") String securityToken, @PathParam("eventId") int eventId) {
SessionInfo sessionInfo = new SessionInfo();
SecurityChallenge securityChallenge = new SecurityChallenge();
securityChallenge.setChallengeId("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
securityChallenge.setLeftSize(14);
securityChallenge.setPattern("FFFFFFFFFFFFFFFF");
securityChallenge.setRightSize(50);
sessionInfo.setChallenge(securityChallenge);
sessionInfo.setEventId(eventId);
EventSessionEntity createEventSession = eventBO.createEventSession(eventId);
sessionInfo.setSessionId(createEventSession.getId());
tokenSessionBO.setActiveLobbyId(securityToken, 0L);
return sessionInfo;
}
示例3: remote
/**
* Remote interface for fetching a specific machine's metric
* @param machine
* @return Metrics
*/
@GET
@Path("remote/{machine}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Metrics remote(@PathParam("machine") String machine) {
LOGGER.log(Level.INFO, "Remote interface invoked for machine {0}", machine);
Metrics metrics = null;
try {
metrics = getLocalMetrics(machine);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Error - {0}", e.getMessage());
e.printStackTrace();
}
return metrics;
}
示例4: getJobTaskAttemptId
@GET
@Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public TaskAttemptInfo getJobTaskAttemptId(@Context HttpServletRequest hsr,
@PathParam("jobid") String jid, @PathParam("taskid") String tid,
@PathParam("attemptid") String attId) {
init();
Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
checkAccess(job, hsr);
Task task = AMWebServices.getTaskFromTaskIdString(tid, job);
TaskAttempt ta = AMWebServices.getTaskAttemptFromTaskAttemptString(attId,
task);
if (task.getType() == TaskType.REDUCE) {
return new ReduceTaskAttemptInfo(ta, task.getType());
} else {
return new TaskAttemptInfo(ta, task.getType(), false);
}
}
示例5: getSingleTaskCounters
@GET
@Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/counters")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public JobTaskCounterInfo getSingleTaskCounters(
@Context HttpServletRequest hsr, @PathParam("jobid") String jid,
@PathParam("taskid") String tid) {
init();
Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
checkAccess(job, hsr);
TaskId taskID = MRApps.toTaskID(tid);
if (taskID == null) {
throw new NotFoundException("taskid " + tid + " not found or invalid");
}
Task task = job.getTask(taskID);
if (task == null) {
throw new NotFoundException("task not found with id " + tid);
}
return new JobTaskCounterInfo(task);
}
示例6: getAddressByStackOrFlavor
@GET
@Path("{serviceName}/addresses")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getAddressByStackOrFlavor(@VerifyApplicationExists @PathParam("serviceName") final String serviceName, @QueryParam("stackName") String stackName, @QueryParam("flavorName") String flavorName) {
try {
return Response.ok(stacksService.getAddressByStackOrFlavor(serviceName, stackName, flavorName)).build();
} catch (IllegalArgumentException ex) {
return Response.status(Response.Status.NOT_FOUND).build();
}
}
示例7: deletePersona
@POST
@Secured
@Path("/DeletePersona")
@Produces(MediaType.APPLICATION_XML)
public String deletePersona(@QueryParam("personaId") Long personaId, @HeaderParam("securityToken") String securityToken) {
tokenSessionBo.verifyPersona(securityToken, personaId);
bo.deletePersona(personaId);
return "<long>0</long>";
}
示例8: getDeliverableAction
@GET
@Path("/deliverables/{id}/update/{deliverableAction}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@ApiOperation(value = "Update deliverableAction by deliverable id")
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not Found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access defined", response = ExceptionModel.class) })
public Response getDeliverableAction(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
@ApiParam(value = "id of Deliverable", required = true) @PathParam("id") Long id,
@ApiParam(value = "deliverableAction", required = true) @PathParam("deliverableAction") String deliverableAction);
示例9: previewFile
@GET
@Path("/registrations/{id}/forms/{referenceUid}/preview")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
public Response previewFile(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext,
@ApiParam(value = "registrationId", required = true) @PathParam("id") long registrationId,
@ApiParam(value = "referenceUid", required = true) @PathParam("referenceUid") String referenceUid);
示例10: addServer
@POST
@Path("{appName}/" + RedirectorConstants.DEFAULT_SERVER_NAME)
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response addServer(@PathParam("appName") final String appName, final Snapshot snapshot){
operationContextHolder.buildContextFromOfflineSnapshot(appName, snapshot);
OperationResult result = serverService.saveServer(appName, (Server) snapshot.getEntityToSave(), ApplicationStatusMode.OFFLINE);
return Response.ok(result).build();
}
示例11: addPaymentConfig
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add a PaymentConfig", response = PaymentConfigInputModel.class)
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the PaymentConfig was created", response = PaymentConfigInputModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })
public Response addPaymentConfig(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext, @BeanParam PaymentConfigInputModel input);
示例12: runTestCase
@GET
@Path("runAuto/{serviceName}/{mode}")
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response runTestCase(@PathParam("serviceName") final String serviceName,
@PathParam("mode") final String mode,
@Context UriInfo ui) {
TestCaseResultList result = new TestCaseResultList();
String baseUrl = ui.getQueryParameters().getFirst("baseURL");
if (isExternalRestMode(mode)) {
validateUrl(baseUrl);
}
result.setItems(testSuiteService.autoCreateTestCasesAndRun(serviceName, mode, baseUrl));
return Response.ok(result).build();
}
示例13: updateApplicantProfile
@PUT
@Path("/{id}/profile/{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@ApiOperation(value = "Get the profile of applicant", response = JSONObject.class)
@ApiResponses(value = {
@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the profile of applicant", response = JSONObject.class),
@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response updateApplicantProfile(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext, @PathParam("id") long id, @PathParam("key") String key,
@BeanParam ProfileInputModel input);
示例14: addChangepass
@POST
@Path("/{id}/changepass")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response addChangepass(@Context HttpServletRequest request, @Context HttpHeaders header,
@Context Company company, @Context Locale locale, @Context User user,
@Context ServiceContext serviceContext, @PathParam("id") long id,
@FormParam("oldPassword") String oldPassword, @FormParam("newPassword") String newPassword);
示例15: keepAliveSession
@PUT
@Produces( { MediaType.APPLICATION_JSON, "application/javascript",
MediaType.APPLICATION_XML })
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response keepAliveSession(@PathParam("session") String session,
@Context UriInfo ui, byte[] data) {
if (!ZooKeeperService.isConnected(contextPath, session)) {
throwNotFound(session, ui);
}
ZooKeeperService.resetTimer(contextPath, session);
return Response.status(Response.Status.OK).build();
}