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

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

源代码1 项目: submarine   文件: ExperimentRestApi.java
@PATCH
@Path("/{id}")
@Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON})
@Operation(summary = "Update the experiment in the submarine server with spec",
        tags = {"experiment"},
        responses = {
                @ApiResponse(description = "successful operation", content = @Content(
                        schema = @Schema(implementation = JsonResponse.class))),
                @ApiResponse(responseCode = "404", description = "Experiment not found")})
public Response patchExperiment(@PathParam(RestConstants.ID) String id, ExperimentSpec spec) {
  try {
    Experiment experiment = experimentManager.patchExperiment(id, spec);
    return new JsonResponse.Builder<Experiment>(Response.Status.OK).success(true)
        .result(experiment).build();
  } catch (SubmarineRuntimeException e) {
    return parseExperimentServiceException(e);
  }
}
 
源代码2 项目: camel-quarkus   文件: GoogleSheetsResource.java
@Path("/update")
@PATCH
@Consumes(MediaType.TEXT_PLAIN)
public Response updateSheet(@QueryParam("spreadsheetId") String spreadsheetId, String title) {
    BatchUpdateSpreadsheetRequest request = new BatchUpdateSpreadsheetRequest()
            .setIncludeSpreadsheetInResponse(true)
            .setRequests(Collections
                    .singletonList(new Request().setUpdateSpreadsheetProperties(new UpdateSpreadsheetPropertiesRequest()
                            .setProperties(new SpreadsheetProperties().setTitle(title))
                            .setFields("title"))));

    final Map<String, Object> headers = new HashMap<>();
    headers.put("CamelGoogleSheets.spreadsheetId", spreadsheetId);
    headers.put("CamelGoogleSheets.batchUpdateSpreadsheetRequest", request);
    producerTemplate.requestBodyAndHeaders("google-sheets://spreadsheets/batchUpdate", null, headers);
    return Response.ok().build();
}
 
源代码3 项目: linstor-server   文件: Encryption.java
@PATCH
@Path("passphrase")
public Response enterPassphrase(
    @Context Request request,
    String jsonData
)
{
    return requestHelper.doInScope(ApiConsts.API_ENTER_CRYPT_PASS, request, () ->
    {
        String passPhrase = objectMapper.readValue(jsonData, String.class);

        ApiCallRc apiCallRc = ctrlApiCallHandler.enterPassphrase(passPhrase);

        return ApiCallRcRestUtils.toResponse(apiCallRc, Response.Status.OK);
    }, true);
}
 
源代码4 项目: trellis   文件: TrellisHttpResource.java
/**
 * Perform a PATCH operation on an LDP Resource.
 *
 * @param uriInfo the URI info
 * @param secContext the security context
 * @param headers the HTTP headers
 * @param request the request
 * @param body the body
 * @return the async response
 */
@PATCH
@Timed
@Operation(summary = "Update a linked data resource")
public CompletionStage<Response> updateResource(@Context final Request request, @Context final UriInfo uriInfo,
        @Context final HttpHeaders headers, @Context final SecurityContext secContext,
        @RequestBody(description = "The update request for RDF resources, typically as SPARQL-Update",
                     required = true,
                     content = @Content(mediaType = "application/sparql-update")) final String body) {
    final TrellisRequest req = new TrellisRequest(request, uriInfo, headers, secContext);
    final String urlBase = getBaseUrl(req);
    final IRI identifier = buildTrellisIdentifier(req.getPath());
    final PatchHandler patchHandler = new PatchHandler(req, body, trellis, extensions, supportsCreateOnPatch,
            defaultJsonLdProfile, urlBase);

    return getParent(identifier).thenCombine(trellis.getResourceService().get(identifier), patchHandler::initialize)
        .thenCompose(patchHandler::updateResource).thenCompose(patchHandler::updateMemento)
        .thenApply(ResponseBuilder::build).exceptionally(this::handleException);
}
 
源代码5 项目: pnc   文件: ProductVersionEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 * 
 * @param id {@value PV_ID}
 * @param productVersion
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ProductVersion.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
ProductVersion patchSpecific(
        @Parameter(description = PV_ID) @PathParam("id") String id,
        @NotNull ProductVersion productVersion);
 
源代码6 项目: pnc   文件: ProductMilestoneEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 * 
 * @param id {@value PM_ID}
 * @param productMilestone
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ProductMilestone.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
ProductMilestone patchSpecific(
        @Parameter(description = PM_ID) @PathParam("id") String id,
        @NotNull ProductMilestone productMilestone);
 
源代码7 项目: pnc   文件: ProductReleaseEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 * 
 * @param id {@value PR_ID}
 * @param productRelease
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ProductRelease.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
ProductRelease patchSpecific(
        @Parameter(description = PR_ID) @PathParam("id") String id,
        @NotNull ProductRelease productRelease);
 
源代码8 项目: pnc   文件: GroupConfigurationEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 *
 * @param id {@value GC_ID}
 * @param groupConfig
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = GroupConfiguration.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
GroupConfiguration patchSpecific(
        @Parameter(description = GC_ID) @PathParam("id") String id,
        @NotNull GroupConfiguration groupConfig);
 
源代码9 项目: pnc   文件: ProjectEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 * 
 * @param id {@value P_ID}
 * @param project
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = Project.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
Project patchSpecific(@Parameter(description = P_ID) @PathParam("id") String id, @NotNull Project project);
 
源代码10 项目: pnc   文件: BuildConfigurationEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 *
 * @param id {@value BC_ID}
 * @param buildConfig
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = BuildConfiguration.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
BuildConfiguration patchSpecific(
        @Parameter(description = BC_ID) @PathParam("id") String id,
        BuildConfiguration buildConfig);
 
源代码11 项目: pnc   文件: ProductEndpoint.java
/**
 * {@value PATCH_SPECIFIC_DESC}
 * 
 * @param id {@value P_ID}
 * @param product
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC_DESC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = Product.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
Product patchSpecific(@Parameter(description = P_ID) @PathParam("id") String id, @NotNull Product product);
 
源代码12 项目: pnc   文件: SCMRepositoryEndpoint.java
/**
 * {@value PATCH_SPECIFIC}
 *
 * @param id {@value SCM_ID}
 * @param scmRepository
 * @return
 */
@Operation(
        summary = PATCH_SPECIFIC,
        responses = {
                @ApiResponse(
                        responseCode = SUCCESS_CODE,
                        description = SUCCESS_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = SCMRepository.class))),
                @ApiResponse(
                        responseCode = INVALID_CODE,
                        description = INVALID_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
                @ApiResponse(responseCode = NOT_FOUND_CODE, description = NOT_FOUND_DESCRIPTION),
                @ApiResponse(
                        responseCode = SERVER_ERROR_CODE,
                        description = SERVER_ERROR_DESCRIPTION,
                        content = @Content(schema = @Schema(implementation = ErrorResponse.class))) })
@PATCH
@Path("/{id}")
@Consumes(MediaType.APPLICATION_JSON_PATCH_JSON)
SCMRepository patchSpecific(
        @Parameter(description = SCM_ID) @PathParam("id") String id,
        @NotNull SCMRepository scmRepository);
 
源代码13 项目: apicurio-registry   文件: Api.java
@PATCH
@Path("/schemas/{schemaid}")
@Consumes({"application/json"})
@Produces({"application/json"})
public Response apiSchemasSchemaidPatch(@PathParam("schemaid") String schemaid, @NotNull @Valid List<AnyOfStateModificationEnabledModification> anyOfStateModificationEnabledModification)
throws ArtifactNotFoundException {
    return service.apiSchemasSchemaidPatch(schemaid, anyOfStateModificationEnabledModification);
}
 
源代码14 项目: apicurio-registry   文件: Api.java
@PATCH
@Path("/schemas/{schemaid}/versions/{versionnum}")
@Consumes({"application/json"})
@Produces({"application/json"})
public Response apiSchemasSchemaidVersionsVersionnumPatch(@PathParam("schemaid") String schemaid, @PathParam("versionnum") int versionnum, @NotNull @Valid List<AnyOfStateModificationEnabledModification> anyOfStateModificationEnabledModification)
throws ArtifactNotFoundException {
    return service.apiSchemasSchemaidVersionsVersionnumPatch(schemaid, versionnum, anyOfStateModificationEnabledModification);
}
 
@Override
public void initMethodAnnotationProcessor() {
  super.initMethodAnnotationProcessor();
  methodAnnotationMap.put(Path.class, new PathMethodAnnotationProcessor());

  HttpMethodAnnotationProcessor httpMethodAnnotationProcessor = new HttpMethodAnnotationProcessor();
  methodAnnotationMap.put(GET.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(POST.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(DELETE.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(PATCH.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(PUT.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(OPTIONS.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(HEAD.class, httpMethodAnnotationProcessor);
  methodAnnotationMap.put(Consumes.class, new ConsumesAnnotationProcessor());
}
 
源代码16 项目: camel-quarkus   文件: Olingo4Resource.java
@Path("/update")
@PATCH
@Consumes(MediaType.APPLICATION_JSON)
public Response update(@QueryParam("sessionId") String sessionId, String json) {
    HttpStatusCode status = producerTemplate.requestBody(
            "olingo4://update/People('lewisblack')?serviceUri=" + getServiceURL(sessionId), json, HttpStatusCode.class);
    return Response
            .status(status.getStatusCode())
            .build();
}
 
源代码17 项目: camel-quarkus   文件: AzureBlobResource.java
@Path("/blob/update")
@PATCH
@Consumes(MediaType.TEXT_PLAIN)
public Response updateBlob(String message) throws Exception {
    producerTemplate.sendBody(
            "azure-blob://devstoreaccount1/camel-test/test?operation=updateBlockBlob&azureBlobClient=#azureBlobClient&validateClientURI=false",
            message);
    return Response.ok().build();
}
 
源代码18 项目: camel-quarkus   文件: GoogleCalendarResource.java
@Path("/update/event")
@PATCH
public Response updateCalendarEvent(@QueryParam("calendarId") String calendarId, @QueryParam("eventId") String eventId) {
    Map<String, Object> headers = new HashMap<>();
    headers.put("CamelGoogleCalendar.calendarId", calendarId);
    headers.put("CamelGoogleCalendar.eventId", eventId);
    try {
        Event response = producerTemplate.requestBodyAndHeaders("google-calendar://events/get", null, headers,
                Event.class);
        if (response == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }
        response.setSummary(response.getSummary() + " Updated");

        headers = new HashMap<>();
        headers.put("CamelGoogleCalendar.calendarId", calendarId);
        headers.put("CamelGoogleCalendar.eventId", eventId);
        headers.put("CamelGoogleCalendar.content", response);
        producerTemplate.requestBodyAndHeaders("google-calendar://events/update", null, headers);
        return Response.ok().build();
    } catch (CamelExecutionException e) {
        Exception exchangeException = e.getExchange().getException();
        if (exchangeException != null && exchangeException.getCause() instanceof GoogleJsonResponseException) {
            GoogleJsonResponseException originalException = (GoogleJsonResponseException) exchangeException.getCause();
            return Response.status(originalException.getStatusCode()).build();
        }
        throw e;
    }
}
 
源代码19 项目: camel-quarkus   文件: ElasticsearchRestResource.java
@Path("/update")
@PATCH
@Produces(MediaType.TEXT_PLAIN)
public Response updateData(@QueryParam("indexId") String indexId, String indexValue) throws Exception {
    Map<String, String> data = createIndexedData(indexValue);
    Map<String, Object> headers = new HashMap<>();
    headers.put(ElasticsearchConstants.PARAM_INDEX_ID, indexId);

    producerTemplate.requestBodyAndHeaders("elasticsearch-rest://elasticsearch?operation=Update&indexName=test", data,
            headers);
    return Response.ok().build();
}
 
@PATCH
@Consumes(MediaType.TEXT_PLAIN)
@Tags({
        @Tag, @Tag
})
public void patchValue(String value) {
}
 
源代码21 项目: syndesis   文件: EnvironmentHandler.java
/**
 * Add tags to an integration for release to target environments.
 */
@PATCH
@Path("integrations/{id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId, @NotNull @Parameter(required = true) List<String> environments) {
    return tagForRelease(integrationId, environments, false);
}
 
源代码22 项目: syndesis   文件: PublicApiHandler.java
/**
 * Add tags to an integration for release to target environments.
 */
@PATCH
@Path("integrations/{id}/tags")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Map<String, ContinuousDeliveryEnvironment> patchTagsForRelease(@NotNull @PathParam("id") @Parameter(required = true) String integrationId,
    @NotNull @Parameter(required = true) List<String> environments) {
    return environmentHandler.patchTagsForRelease(integrationId, environments);
}
 
源代码23 项目: rest.vertx   文件: TestPatchRest.java
@PATCH
@Path("/it")
@RequestReader(DummyBodyReader.class)
@ResponseWriter(TestDummyWriter.class)
@RouteOrder(20)
public Dummy echoJsonPatch(Dummy postParam) {

	postParam.name = "Received-" + postParam.name;
	postParam.value = "Received-" + postParam.value;

	return postParam;
}
 
源代码24 项目: govpay   文件: Pendenze.java
@PATCH
@Path("/{idA2A}/{idPendenza}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response updatePendenza(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, @PathParam("idA2A") String idA2A, @PathParam("idPendenza") String idPendenza, java.io.InputStream is){
    this.buildContext();
    return this.controller.pendenzeIdA2AIdPendenzaPATCH(this.getUser(), uriInfo, httpHeaders,  idA2A,  idPendenza, is);
}
 
源代码25 项目: govpay   文件: Pendenze.java
@PATCH
@Path("/{idA2A}/{idPendenza}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response updatePendenza(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, @PathParam("idA2A") String idA2A, @PathParam("idPendenza") String idPendenza, java.io.InputStream is){
    this.buildContext();
    return this.controller.pendenzeIdA2AIdPendenzaPATCH(this.getUser(), uriInfo, httpHeaders,  idA2A,  idPendenza, is);
}
 
源代码26 项目: govpay   文件: Operatori.java
@PATCH
@Path("/{principal}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response updateOperatore(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, java.io.InputStream is, @PathParam("principal") String principal){
    this.buildContext();
    return this.controller.updateOperatore(this.getUser(), uriInfo, httpHeaders, is,  principal);
}
 
源代码27 项目: govpay   文件: Rpp.java
@PATCH
@Path("/{idDominio}/{iuv}/{ccp}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response updateRpp(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, java.io.InputStream is, @PathParam("idDominio") String idDominio, @PathParam("iuv") String iuv, @PathParam("ccp") String ccp){
    this.buildContext();
    return this.controller.updateRpp(this.getUser(), uriInfo, httpHeaders, is,  idDominio,  iuv,  ccp);
}
 
源代码28 项目: govpay   文件: Rpp.java
@PATCH
@Path("/{idDominio}/{iuv}/n/a")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response updateRpp(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, java.io.InputStream is, @PathParam("idDominio") String idDominio, @PathParam("iuv") String iuv){
    this.buildContext();
    return this.controller.updateRpp(this.getUser(), uriInfo, httpHeaders, is,  idDominio,  iuv,  "n/a");
}
 
源代码29 项目: govpay   文件: Ruoli.java
@PATCH
@Path("/{idRuolo}")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response updateRuolo(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, java.io.InputStream is, @PathParam("idRuolo") String idRuolo){
	this.buildContext();
    return this.controller.updateRuolo(this.getUser(), uriInfo, httpHeaders, is,  idRuolo);
}
 
源代码30 项目: govpay   文件: Configurazioni.java
@PATCH
@Path("/")
@Consumes({ "application/json" })
@Produces({ "application/json" })
public Response aggiornaConfigurazioni(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, java.io.InputStream is){
    this.buildContext();
    return this.controller.aggiornaConfigurazioni(this.getUser(), uriInfo, httpHeaders, is);
}
 
 类所在包
 类方法
 同包方法