Java Code Examples for javax.ws.rs.Consumes

The following are top voted examples for showing how to use javax.ws.rs.Consumes. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: gitplex-mit   File: CommitStatusResource.java   Source Code and License 8 votes vote down vote up
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{projectName}/statuses/{commit}")
   @POST
   public Response save(@PathParam("projectName") String projectName, @PathParam("commit") String commit, 
   		Map<String, String> commitStatus, @Context UriInfo uriInfo) {

	Project project = getProject(projectName);
   	if (!SecurityUtils.canWrite(project))
   		throw new UnauthorizedException();
   	
   	String state = commitStatus.get("state").toUpperCase();
   	if (state.equals("PENDING"))
   		state = "RUNNING";
   	Verification verification = new Verification(Verification.Status.valueOf(state), 
   			new Date(), commitStatus.get("description"), commitStatus.get("target_url"));
   	String context = commitStatus.get("context");
   	if (context == null)
   		context = "default";
   	verificationManager.saveVerification(project, commit, context, verification);
   	UriBuilder uriBuilder = uriInfo.getAbsolutePathBuilder();
   	uriBuilder.path(context);
   	commitStatus.put("id", "1");
   	
   	return Response.created(uriBuilder.build()).entity(commitStatus).type(RestConstants.JSON_UTF8).build();
   }
 
Example 2
Project: bluemix-liberty-microprofile-demo   File: MeetingBookingService.java   Source Code and License 7 votes vote down vote up
@POST
@Path("/meeting")
@Produces(APPLICATION_JSON)
@Consumes(APPLICATION_JSON)
public Reservation make(Reservation reservation) {
	if (reservation.getId() != null)
		throw new BadRequestException(MessageFormat.format(ERROR_RESERVATION_IS_EXISTS_FMT, reservation.getId()));
	Set<Reservation> alreadyMadeReservations = reservationDao.getReservations(
			reservation.getVenue(), 
			reservation.getDate(), 
			reservation.getStartTime(),
			reservation.getDuration());
	if (alreadyMadeReservations != null && !alreadyMadeReservations.isEmpty())
		throw new BadRequestException(MessageFormat.format(ERROR_RESERVATION_CONFLICT_FMT, reservation.getVenue()));
	
	return reservationDao.createNew(reservation);
}
 
Example 3
Project: java-ml-projects   File: DataSetResource.java   Source Code and License 6 votes vote down vote up
@POST
@Path("{label}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void receiveFile(MultipartInput input, @PathParam("label") String label) {
	List<InputPart> parts = input.getParts();
	parts.stream().filter(p -> p.getMediaType().getType().startsWith("image"))
			.forEach(p -> this.saveImage(p, label));
	input.close();
}
 
Example 4
Project: lra-service   File: InvoiceEndpoint.java   Source Code and License 6 votes vote down vote up
@POST
@Path(LRAOperationAPI.REQUEST)
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.APPLICATION_JSON)
@LRA(value = LRA.Type.REQUIRED)
public Response requestInvoice(@HeaderParam(LRAClient.LRA_HTTP_HEADER) String lraUri, OrderInfo orderInfo) {
	String lraId = LRAClient.getLRAId(lraUri);
	log.info("processing request for LRA " + lraId);

	invoiceService.computeInvoice(lraId, orderInfo);

	//stub for compensation scenario
	if ("failInvoice".equals(orderInfo.getProduct().getProductId())) {
		return Response
				.status(Response.Status.BAD_REQUEST)
				.entity("Invoice for order " + orderInfo.getOrderId() + " failure")
				.build();
	}

	return Response
			.ok()
			.entity(String.format("Invoice for order %s processed", orderInfo.getOrderId()))
			.build();
}
 
Example 5
Project: athena   File: FlowClassifierWebResource.java   Source Code and License 6 votes vote down vote up
/**
 * Update details of a flow classifier.
 *
 * @param id
 *            flow classifier id
 * @param stream
 *            InputStream
 * @return 200 OK, 404 if given identifier does not exist
 */
@PUT
@Path("{flow_id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response updateFlowClassifier(@PathParam("flow_id") String id, final InputStream stream) {
    try {

        JsonNode jsonTree = mapper().readTree(stream);
        JsonNode flow = jsonTree.get("flow_classifier");
        FlowClassifier flowClassifier = codec(FlowClassifier.class).decode((ObjectNode) flow, this);
        Boolean result = nullIsNotFound(get(FlowClassifierService.class).updateFlowClassifier(flowClassifier),
                                        FLOW_CLASSIFIER_NOT_FOUND);
        return Response.status(OK).entity(result.toString()).build();
    } catch (IOException e) {
        log.error("Update flow classifier failed because of exception {}.", e.toString());
        throw new IllegalArgumentException(e);
    }
}
 
Example 6
Project: clemon   File: UserResource.java   Source Code and License 6 votes vote down vote up
@POST
@Consumes("application/x-www-form-urlencoded")
@Produces("application/json")
@Path("/save")
public Object saveUser(@FormParam("userName") String userName,@FormParam("userPass") String userPass){
	String jsonData = "";
	User u = new User();
	u.setUserName(userName);
	u.setUserPass(userPass);
	try {
		userService.save(u);
	} catch (Exception e) {
		//-- 统一在过滤器中添加跨域访问的header信息,所以这里就不添加了
		jsonData = JsonUtil.toJsonByProperty("addUser","failure");
		return Response.ok(jsonData).status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR ).build();
	}
	jsonData = JsonUtil.toJsonByProperty("id", u.getId());
	return Response.ok(jsonData).status(HttpServletResponse.SC_OK).build();
}
 
Example 7
Project: microservices-transactions-tcc   File: CompositeTransactionParticipantController.java   Source Code and License 6 votes vote down vote up
@DELETE
@Path("/tcc/{txid}")
@Consumes("application/tcc")
   @ApiOperation(
   		code = 204,
   		response = String.class,
           value = "Rollback a given composite transaction",
           notes = "See https://www.atomikos.com/Blog/TransactionManagementAPIForRESTTCC",
           consumes = "application/tcc"
       )
public void cancel(
		@ApiParam(value = "Id of the composite transaction to rollback", required = true) @PathParam("txid") String txid
		){
	LOG.info("Trying to rollback transaction [{}]", txid);
	
	getCompositeTransactionParticipantService().cancel(txid);
	
	LOG.info("Transaction [{}] rolled back", txid);
}
 
Example 8
Project: ctsms   File: FileResource.java   Source Code and License 6 votes vote down vote up
@PUT
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({ MediaType.APPLICATION_JSON })
public FileOutVO updateFile(@FormDataParam("json") FormDataBodyPart json,
		@FormDataParam("data") FormDataBodyPart content,
		@FormDataParam("data") FormDataContentDisposition contentDisposition,
		@FormDataParam("data") final InputStream input) throws AuthenticationException, AuthorisationException, ServiceException {
	// in.setId(fileId);
	json.setMediaType(MediaType.APPLICATION_JSON_TYPE);
	FileInVO in = json.getValueAs(FileInVO.class);
	FileStreamInVO stream = new FileStreamInVO();
	stream.setStream(input);
	stream.setMimeType(content.getMediaType().toString()); // .getType());
	stream.setSize(contentDisposition.getSize());
	stream.setFileName(contentDisposition.getFileName());
	return WebUtil.getServiceLocator().getFileService().updateFile(auth, in, stream);
}
 
Example 9
Project: athena   File: OpenstackPortWebResource.java   Source Code and License 6 votes vote down vote up
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response createPorts(InputStream input) {
    try {
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode portNode = (ObjectNode) mapper.readTree(input);

        OpenstackPort openstackPort = PORT_CODEC.decode(portNode, this);
        OpenstackSwitchingService switchingService =
                getService(OpenstackSwitchingService.class);
        switchingService.createPorts(openstackPort);

        log.debug("REST API ports is called with {}", portNode.toString());
        return Response.status(Response.Status.OK).build();

    } catch (Exception e) {
        log.error("Creates Port failed because of exception {}",
                e.toString());
        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.toString())
                .build();
    }
}
 
Example 10
Project: syndesis   File: OAuthAppHandler.java   Source Code and License 6 votes vote down vote up
@PUT
@Path(value = "/{id}")
@Consumes("application/json")
public void update(@NotNull @PathParam("id") String id, @NotNull @Valid OAuthApp app) {
    final Connector connector = dataMgr.fetch(Connector.class, id);
    if (connector == null) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }

    final Connector updated = new Connector.Builder().createFrom(connector)
        .putOrRemoveConfiguredPropertyTaggedWith(Credentials.CLIENT_ID_TAG, app.clientId)
        .putOrRemoveConfiguredPropertyTaggedWith(Credentials.CLIENT_SECRET_TAG, app.clientSecret)
        .build();

    dataMgr.update(updated);
}
 
Example 11
Project: athena   File: RegionsWebResource.java   Source Code and License 6 votes vote down vote up
/**
 * Updates the specified region using the supplied JSON input stream.
 *
 * @param regionId region identifier
 * @param stream region JSON stream
 * @return status of the request - UPDATED if the JSON is correct,
 * BAD_REQUEST if the JSON is invalid
 * @onos.rsModel RegionPost
 */
@PUT
@Path("{regionId}")
@Consumes(MediaType.APPLICATION_JSON)
public Response updateRegion(@PathParam("regionId") String regionId,
                             InputStream stream) {
    try {
        ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
        JsonNode specifiedRegionId = jsonTree.get("id");

        if (specifiedRegionId != null &&
                !specifiedRegionId.asText().equals(regionId)) {
            throw new IllegalArgumentException(REGION_INVALID);
        }

        final Region region = codec(Region.class).decode(jsonTree, this);
        regionAdminService.updateRegion(region.id(),
                            region.name(), region.type(), region.masters());
    } catch (IOException e) {
        throw new IllegalArgumentException(e);
    }

    return Response.ok().build();
}
 
Example 12
Project: opencps-v2   File: RegistrationLogManagement.java   Source Code and License 6 votes vote down vote up
@POST
@Path("/registrations/{id}/logs")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "addRegistrationByRegistrationId)", response = RegistrationLogModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the RegistrationgModel was updated", response = RegistrationResultsModel.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 addRegistrationByRegistrationId(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext,
		@ApiParam(value = "id of registration", required = true) @PathParam("id") long id,
		@ApiParam(value = "Metadata of RegistrationLog") @Multipart("author") String author,
		@ApiParam(value = "Metadata of RegistrationLog") @Multipart("payload") String payload,
		@ApiParam(value = "Metadata of RegistrationLog") @Multipart("content") String content);
 
Example 13
Project: osc-core   File: ServerMgmtApis.java   Source Code and License 6 votes vote down vote up
@ApiOperation(value = "Upload a private/public certificate zip file. ",
        notes = "Overwrites the entry marked &quot;internal&quot; in the truststore. "
        + "That is a private/public keypair used for secure connections by OSC. "
        + "The zip file should contain a  &quot;key.pem&quot; in PKCS8+PEM format (private key) and "
        + "certchain.pem or certchain.pkipath (the certificate chain). This results in the server restart ! ! !",
        response = BaseResponse.class)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation"),
        @ApiResponse(code = 400, message = "In case of any error", response = ErrorCodeDto.class) })
@Path("/internalkeypair")
@POST
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response uploadKeypair(@Context HttpHeaders headers,
        @ApiParam(value = "The imported keypair zip file name",
        required = true) @PathParam("fileName") String fileName,
        @ApiParam(required = true) InputStream uploadedInputStream) {
    logger.info("Started uploading file " + fileName);
    this.userContext.setUser(OscAuthFilter.getUsername(headers));
    return this.apiUtil.getResponseForBaseRequest(this.replaceInternalKeypairServiceApi,
            new UploadRequest(fileName, uploadedInputStream));
}
 
Example 14
Project: opencps-v2   File: PaymentFileManagement.java   Source Code and License 6 votes vote down vote up
@POST
@Path("/{id}/payments/{referenceUid}/epaymentprofile")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add epaymentprofile", response = JSONObject.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns epaymentprofile was update", response = JSONObject.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_NOT_FOUND, message = "Not found", response = ExceptionModel.class) })
public Response updateEpaymentProfile(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext,
		@ApiParam(value = "id of Payment", required = true) @PathParam("id") String id,
		@ApiParam (value = "referenceUid of Payment", required = true) @PathParam("referenceUid") String referenceUid,
		@BeanParam PaymentFileInputModel input);
 
Example 15
Project: nifi-registry   File: BucketFlowResource.java   Source Code and License 6 votes vote down vote up
@DELETE
@Path("{flowId}")
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
        value = "Deletes a flow.",
        response = VersionedFlow.class
)
@ApiResponses({
        @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401),
        @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403),
        @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404),
        @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) })
public Response deleteFlow(
        @PathParam("bucketId")
        @ApiParam("The bucket identifier")
            final String bucketId,
        @PathParam("flowId")
        @ApiParam("The flow identifier")
            final String flowId) {

    authorizeBucketAccess(RequestAction.DELETE, bucketId);
    final VersionedFlow deletedFlow = registryService.deleteFlow(bucketId, flowId);
    return Response.status(Response.Status.OK).entity(deletedFlow).build();
}
 
Example 16
Project: opencps-v2   File: RegistrationFormManagement.java   Source Code and License 6 votes vote down vote up
@PUT
@Path("/registrations/{id}/forms/{referenceUid}/formdata")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "update RegistrationForm")
@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 updateRegFormFormData(@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 id,
		@ApiParam(value = "referenceUid", required = true) @PathParam("referenceUid") String referenceUid,
		@ApiParam(value = "formdata of registrationForm", required = true) @FormParam("formdata") String formdata)
		throws PortalException;
 
Example 17
Project: E-Clinic   File: ContactRestEndPoint.java   Source Code and License 5 votes vote down vote up
@POST
@Path("create")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response create(@Valid Contact value) {
    try {
        contactService.create(value);
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity("Data is saved").build();
}
 
Example 18
Project: E-Clinic   File: GuardianRestEndPoint.java   Source Code and License 5 votes vote down vote up
@PUT
@Path("update")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response update(@Valid Guardian value) throws Throwable {
    try {
        guardianService.update(value);
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity("Date is updated").build();
}
 
Example 19
Project: syndesis   File: JsonDBResource.java   Source Code and License 5 votes vote down vote up
@Path("/{path: .*}.json")
@Consumes(APPLICATION_JSON)
@Produces(APPLICATION_JSON)
@POST
public HashMap<String, String> push(@PathParam("path") String path, InputStream body) {
    HashMap<String, String> result = new HashMap<>();
    result.put("name", jsondb.push(path, body));
    return result;
}
 
Example 20
Project: elastic-job-cloud   File: CloudJobRestfulApi.java   Source Code and License 5 votes vote down vote up
/**
 * 更新作业配置.
 *
 * @param jobConfig 作业配置
 */
@PUT
@Path("/update")
@Consumes(MediaType.APPLICATION_JSON)
public void update(final CloudJobConfiguration jobConfig) {
    producerManager.update(jobConfig);
}
 
Example 21
Project: opencps-v2   File: DeliverablesLogManagement.java   Source Code and License 5 votes vote down vote up
@GET
@Path("/deliverables/{id}/logs")
@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 info log for 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 getDeliverableLog(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@ApiParam(value = "id for Deliverable Log", required = true) @PathParam("id") Long id);
 
Example 22
Project: message-broker   File: QueuesApi.java   Source Code and License 5 votes vote down vote up
@POST
@Consumes({"application/json"})
@Produces({"application/json"})
@ApiOperation(value = "Creates a queue", notes = "", response = QueueCreateResponse.class, tags = {})
@ApiResponses(value = {
        @ApiResponse(code = 201, message = "Queue created.", response = QueueCreateResponse.class),
        @ApiResponse(code = 400, message = "Bad Request. Invalid request or validation error.",
                     response = Error.class),
        @ApiResponse(code = 415, message = "Unsupported media type. The entity of the request was in a not "
                + "supported format.", response = Error.class)})
public Response createQueue(@Valid QueueCreateRequest body) {
    return delegate.createQueue(body);
}
 
Example 23
Project: GitHub   File: Resource.java   Source Code and License 5 votes vote down vote up
@Path("/doubleInMapTest")
@GET
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public MapTest getDoubleInMapTest() {

  return ImmutableMapTest.builder()
      .putMapDouble("double", 5.0)
      .build();
}
 
Example 24
Project: nifi-registry   File: BucketFlowResource.java   Source Code and License 5 votes vote down vote up
@GET
@Path("{flowId}/versions/{versionNumber: \\d+}")
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
        value = "Gets the given version of a flow",
        response = VersionedFlowSnapshot.class
)
@ApiResponses({
        @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400),
        @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401),
        @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403),
        @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404),
        @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) })
public Response getFlowVersion(
        @PathParam("bucketId")
        @ApiParam("The bucket identifier")
            final String bucketId,
        @PathParam("flowId")
        @ApiParam("The flow identifier")
            final String flowId,
        @PathParam("versionNumber")
        @ApiParam("The version number")
            final Integer versionNumber) {
    authorizeBucketAccess(RequestAction.READ, bucketId);

    final VersionedFlowSnapshot snapshot = registryService.getFlowSnapshot(bucketId, flowId, versionNumber);
    populateLinksAndPermissions(snapshot);

    return Response.status(Response.Status.OK).entity(snapshot).build();
}
 
Example 25
Project: opencps-v2   File: ServiceInfoManagement.java   Source Code and License 5 votes vote down vote up
@GET
@Path("/statistics/domains")
@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 StatisticByLevel", response = StatisticsLevelResultsModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a list of ServiceInfo", response = StatisticsLevelResultsModel.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 getStatisticByDomain(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext);
 
Example 26
Project: jersey-jwt   File: AuthenticationResource.java   Source Code and License 5 votes vote down vote up
/**
 * Validate user credentials and issue a token for the user.
 *
 * @param credentials
 * @return
 */
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@PermitAll
public Response authenticate(UserCredentials credentials) {

    User user = usernamePasswordValidator.validateCredentials(credentials.getUsername(), credentials.getPassword());
    String token = authenticationTokenService.issueToken(user.getUsername(), user.getAuthorities());
    AuthenticationToken authenticationToken = new AuthenticationToken();
    authenticationToken.setToken(token);
    return Response.ok(authenticationToken).build();
}
 
Example 27
Project: opencps-v2   File: FileAttachManagement.java   Source Code and License 5 votes vote down vote up
@GET
@Path("/{className}/{classPK}")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getFileAttachs(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, 
		@PathParam("className") String className, @PathParam("classPK") String classPK,
		@BeanParam DataSearchModel query);
 
Example 28
Project: opencps-v2   File: EmployeeManagement.java   Source Code and License 5 votes vote down vote up
@DELETE
@Path("/{id}")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response delete(@Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company,
		@Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@DefaultValue("0") @PathParam("id") long id);
 
Example 29
Project: opencps-v2   File: ServiceInfoManagement.java   Source Code and License 5 votes vote down vote up
@GET
@Path("/{id}/filetemplates")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Get FileTemplate list of ServiceInfo by its id)", response = FileTemplateResultsModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the list of FileTemplate of ServiceInfo", response = FileTemplateResultsModel.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 getFileTemplatesOfServiceInfo(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext,
		@ApiParam(value = "id of ServiceInfo that need to be get the list of FileTemplates", required = true) @PathParam("id") String id);
 
Example 30
Project: opencps-v2   File: ServiceProcessManagement.java   Source Code and License 5 votes vote down vote up
@PUT
@Path("/{id}/roles/{roleid}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Update the ServiceProcessRole of a ServiceProcess by its id", response = RoleInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a ServiceProcessRole was update", response = RoleInputModel.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 updateServiceProcessRole(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id, @PathParam("roleid") long roleid,
		@BeanParam RoleInputModel input);
 
Example 31
Project: nifi-registry   File: BucketResource.java   Source Code and License 5 votes vote down vote up
@GET
@Path("fields")
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
        value = "Retrieves field names for searching or sorting on buckets.",
        response = Fields.class
)
public Response getAvailableBucketFields() {
    final Set<String> bucketFields = registryService.getBucketFields();
    final Fields fields = new Fields(bucketFields);
    return Response.status(Response.Status.OK).entity(fields).build();
}
 
Example 32
Project: presto-manager   File: PackageAPI.java   Source Code and License 5 votes vote down vote up
@PUT
@Consumes(TEXT_PLAIN)
@Produces(TEXT_PLAIN)
@ApiOperation(value = "Install Presto using rpm or tarball")
@ApiResponses(value = {
        @ApiResponse(code = 202, message = "Acknowledged request"),
        @ApiResponse(code = 400, message = "Invalid url"),
        @ApiResponse(code = 409, message = "Presto is already installed.")
})
public synchronized Response install(@ApiParam("Url to fetch package") String packageUrl,
        @QueryParam("checkDependencies") @DefaultValue("true") @ApiParam("If false, disables dependency checking") boolean checkDependencies)
{
    return controller.install(packageUrl, checkDependencies);
}
 
Example 33
Project: dremio-oss   File: SourceResource.java   Source Code and License 5 votes vote down vote up
@POST
@Path("new_untitled_from_file/{path: .*}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public InitialPreviewResponse createUntitledFromSourceFile(@PathParam("path") String path)
  throws DatasetNotFoundException, DatasetVersionNotFoundException, NamespaceException, NewDatasetQueryException {
  return datasetsResource.createUntitledFromSourceFile(sourceName, path);
}
 
Example 34
Project: opencps-v2   File: DataManagement.java   Source Code and License 5 votes vote down vote up
@POST
@Path("/{code}/dictgroups")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response addDictgroups(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@PathParam("code") String code, @BeanParam DictGroupInputModel input);
 
Example 35
Project: elastic-job-cloud   File: CloudJobRestfulApi.java   Source Code and License 5 votes vote down vote up
/**
 * 获取作业执行类型统计数据.
 * 
 * @return 作业执行类型统计数据
 */
@GET
@Path("/statistics/jobs/executionType")
@Consumes(MediaType.APPLICATION_JSON)
public JobExecutionTypeStatistics getJobExecutionTypeStatistics() {
    return statisticManager.getJobExecutionTypeStatistics();
}
 
Example 36
Project: opencps-v2   File: ServerConfigManagement.java   Source Code and License 5 votes vote down vote up
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add a ServerConfig", response = ServerConfigDetailModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns the ServerConfig was created", response = ServerConfigDetailModel.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 addServerConfig(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @BeanParam ServerConfigInputModel input);
 
Example 37
Project: verify-hub   File: RpAuthnResponseGeneratorResource.java   Source Code and License 5 votes vote down vote up
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Timed
public Response generate(ResponseFromHubDto responseFromHub) throws JsonProcessingException {
    return Response.ok().entity(service.generate(responseFromHub)).type(MediaType.APPLICATION_JSON_TYPE).build();
}
 
Example 38
Project: SistemaAlmoxarifado   File: UsuarioResource.java   Source Code and License 5 votes vote down vote up
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Path("/getid")
public Response  getId(@HeaderParam("token") String token, 
        @QueryParam("id") int id) throws SQLException, Exception {
    
    if(!Verify(token, "admin")) 
        return Response.status(Response.Status.UNAUTHORIZED).build();
    
    Gson gson = new Gson();
    Usuario u = UsuarioDAO.retreave(id);
    
    return Response.status(Response.Status.OK)
            .entity(gson.toJson(u)).build();
}
 
Example 39
Project: opencps-v2   File: UserManagement.java   Source Code and License 5 votes vote down vote up
@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);
 
Example 40
Project: Hybrid-Cloud-Applications-and-Services   File: BookingResource.java   Source Code and License 5 votes vote down vote up
@POST
@ApiOperation("Create a booking")
@Consumes("application/json")
@Produces("application/json")
@ApiResponses({
	@ApiResponse(code = 201, message= "Booking created", response=String.class)})
public Response createBooking(Booking task){
	return Controller.createBooking(task);
}
 
Example 41
Project: plugin-bt   File: BugTrackerResource.java   Source Code and License 5 votes vote down vote up
/**
 * Add a new SLA to the given subscription.
 * 
 * @param vo
 *            The SLA to attach.
 * @return the associated parameter value as {@link String}
 */
@POST
@Path("sla")
@Consumes(MediaType.APPLICATION_JSON)
public int addSla(final SlaEditionVo vo) {
	final Sla entity = new Sla();
	entity.setConfiguration(getConfigurationBySubscription(vo.getSubscription()));
	save(vo, entity);
	return entity.getId();
}
 
Example 42
Project: E-Clinic   File: ClinicManagerRestEndPoint.java   Source Code and License 5 votes vote down vote up
@PUT
@Path("updateReligion")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response updateReligion(ClinicManagerForm value) throws Throwable {
    try {
        clinicManagerService.updateReligion(value);
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity("Date is updated").build();
}
 
Example 43
Project: task-app   File: ClientApi.java   Source Code and License 5 votes vote down vote up
@POST
@Path("/upload")
@Consumes(MediaType.WILDCARD)
public void upload(
        @QueryParam("taskId") Long taskId,
        @QueryParam("code") String code,
        @QueryParam("mimeType") String mimeType,
        @QueryParam("name") String name,
        InputStream inputStream);
 
Example 44
Project: opencps-v2   File: DeliverablesManagement.java   Source Code and License 5 votes vote down vote up
@GET
@Path("/deliverables")
@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 all deliverables")
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Return a list Deliverable"),
		@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 getDeliverables(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @BeanParam DeliverableSearchModel search);
 
Example 45
Project: minijax   File: HelloSwagger.java   Source Code and License 5 votes vote down vote up
@POST
@Path("/shout")
@Consumes(MediaType.TEXT_PLAIN)
@ApiOperation("Shouts an input string")
public static String shout(final String s) {
    return s.toUpperCase();
}
 
Example 46
Project: uavstack   File: GUIService.java   Source Code and License 5 votes vote down vote up
/**
 * 跳转main页面
 */
@GET
@Path("jumpMainPage")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public void jumpMainPage() throws IOException {

    String url = "/" + getWebProName(request) + "/" + "main.html";
    response.sendRedirect(url);
}
 
Example 47
Project: uavstack   File: TestRestService.java   Source Code and License 5 votes vote down vote up
@POST
@Path("methodPath2")
@Consumes("application/json")
@Produces("application/json")
public String testPostMethod1(String jsonString) {

    return jsonString;
}
 
Example 48
Project: FlashBoard   File: StudyGuideRest.java   Source Code and License 5 votes vote down vote up
@POST
@Path("/create")
@Consumes(MediaType.APPLICATION_JSON)
public Response create(StudyGuideData sgd) {
	if(StudyGuideService.validate(sgd)) {
		return Response.status(200).build();
	}
	return Response.status(400).build();
}
 
Example 49
Project: sig-seguimiento-vehiculos   File: SGFVehicleService.java   Source Code and License 5 votes vote down vote up
/**
 * Obtiene todos los vehículos de la empresa indicada
 * @param authorization
 * @param companyId: identificado de la empresa
 * @param size: nº de elementos devueltos en cada página
 * @param sort: atributo por el que se ordenan los elementos
 * @return cadena em formato JSON de los vehículos de la compañia companyId
 */
@GET	
@Consumes("application/json")
@Produces("application/json")
@Path("companies/{companyId}/vehicles")
String get(@HeaderParam("Authorization") String authorization,
		@PathParam("companyId") int companyId,
		@QueryParam("size")int size,
		@QueryParam("sort")String sort);
 
Example 50
Project: opencps-v2   File: UserManagement.java   Source Code and License 5 votes vote down vote up
@GET
@Path("/{id}/sites")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getSites(@Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company,
		@Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@PathParam("id") long id);
 
Example 51
Project: opencps-v2   File: PaymentConfigManagement.java   Source Code and License 5 votes vote down vote up
@POST
@Path("/{id}/epaymentconfig")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "Add epaymentconfig", response = PaymentConfigSingleInputModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns epaymentconfig was added", response = PaymentConfigSingleInputModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = "Internal error", response = ExceptionModel.class) })

public Response addEpaymentconfig(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext, @PathParam("id") long id,
		@BeanParam PaymentConfigSingleInputModel input);
 
Example 52
Project: nifi-registry   File: BucketResource.java   Source Code and License 5 votes vote down vote up
@PUT
@Path("{bucketId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
        value = "Updates a bucket",
        response = Bucket.class
)
@ApiResponses({
        @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400),
        @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401),
        @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403),
        @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404),
        @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) })
public Response updateBucket(
        @PathParam("bucketId")
        @ApiParam("The bucket identifier")
        final String bucketId, final Bucket bucket) {

    if (StringUtils.isBlank(bucketId)) {
        throw new BadRequestException("Bucket id cannot be blank");
    }

    if (bucket == null) {
        throw new BadRequestException("Bucket cannot be null");
    }

    if (bucket.getIdentifier() != null && !bucketId.equals(bucket.getIdentifier())) {
        throw new BadRequestException("Bucket id in path param must match bucket id in body");
    } else {
        bucket.setIdentifier(bucketId);
    }

    authorizeBucketAccess(RequestAction.WRITE, bucketId);

    final Bucket updatedBucket = registryService.updateBucket(bucket);
    permissionsService.populateBucketPermissions(updatedBucket);
    linkService.populateBucketLinks(updatedBucket);
    return Response.status(Response.Status.OK).entity(updatedBucket).build();
}
 
Example 53
Project: E-Clinic   File: PharmacistRestEndPoint.java   Source Code and License 5 votes vote down vote up
@DELETE
@Path("delete/{id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response delete(@PathParam("id") String id) throws Throwable {
    try {
        Pharmacist get = pharmacistService.get(Integer.valueOf(id));
        pharmacistService.delete(get);
    } catch (Exception ex) {
        return Response.ok().header("Exception", ex.getMessage()).build();
    }
    return Response.ok().entity("Data is deleted").build();
}
 
Example 54
Project: rest-basic-tutorial   File: PeopleResource.java   Source Code and License 5 votes vote down vote up
@POST
@Consumes({MediaType.APPLICATION_JSON})
public Response postPerson(@Valid @NotNull ValidatedPerson person) {
    POSTED_PEOPLE.add(person);

    return Response.ok()
            .build();
}
 
Example 55
Project: nifi-registry   File: TenantResource.java   Source Code and License 5 votes vote down vote up
/**
 * Retrieves the specified user group.
 *
 * @param identifier The id of the user group to retrieve
 * @return An userGroupEntity.
 */
@GET
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@Path("user-groups/{id}")
@ApiOperation(
        value = "Gets a user group",
        notes = NON_GUARANTEED_ENDPOINT,
        response = UserGroup.class
)
@ApiResponses({
        @ApiResponse(code = 400, message = HttpStatusMessages.MESSAGE_400),
        @ApiResponse(code = 401, message = HttpStatusMessages.MESSAGE_401),
        @ApiResponse(code = 403, message = HttpStatusMessages.MESSAGE_403),
        @ApiResponse(code = 404, message = HttpStatusMessages.MESSAGE_404),
        @ApiResponse(code = 409, message = HttpStatusMessages.MESSAGE_409) })
public Response getUserGroup(
        @ApiParam(value = "The user group id.", required = true)
        @PathParam("id") final String identifier) {
    verifyAuthorizerIsManaged();
    authorizeAccess(RequestAction.READ);

    final UserGroup userGroup = authorizationService.getUserGroup(identifier);
    if (userGroup == null) {
        throw new ResourceNotFoundException("No group found with identifier " + identifier);
    }

    return generateOkResponse(userGroup).build();
}
 
Example 56
Project: SigFW   File: DiameterFirewallAPI_V1_0.java   Source Code and License 5 votes vote down vote up
@GET
@Consumes("text/plain")
@Produces("text/plain")
@Path("diameter_application_id_whitelist_list")
public String diameter_application_id_whitelist_list() {
    String s = "";
    for (SortedMap.Entry<String, String> entry : DiameterFirewallConfig.diameter_application_id_whitelist.entrySet()) {
        s += entry.getKey() + "\n";
    }
    return s;
}
 
Example 57
Project: SigFW   File: DiameterFirewallAPI_V1_0.java   Source Code and License 5 votes vote down vote up
@GET
@Consumes("text/plain")
@Produces("text/plain")
@Path("get_status")
public String get_status() {
    return DiameterFirewall.getStatus();
}
 
Example 58
Project: ctsms   File: ProbandListEntryTagValuesResource.java   Source Code and License 5 votes vote down vote up
@PUT
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public JsValuesOutVOPage<ProbandListEntryTagValueOutVO, ProbandListEntryTagValueJsonVO> setProbandListEntryTagValues(Collection<ProbandListEntryTagValueInVO> in)
		throws AuthenticationException, AuthorisationException,
		ServiceException {
	ProbandListEntryTagValuesOutVO values = WebUtil.getServiceLocator().getTrialService().setProbandListEntryTagValues(auth, new HashSet<ProbandListEntryTagValueInVO>(in));
	return new JsValuesOutVOPage<ProbandListEntryTagValueOutVO, ProbandListEntryTagValueJsonVO>(values.getPageValues(), values.getJsValues(), null);
	// return new ProbandListEntryTagValuesOutVOPage(WebUtil.getServiceLocator().getTrialService().setProbandListEntryTagValues(auth, in), null);
	// return WebUtil.getServiceLocator().getTrialService().setProbandListEntryTagValues(auth, in);
}
 
Example 59
Project: opencps-v2   File: ApplicantManagement.java   Source Code and License 5 votes vote down vote up
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED })
@ApiOperation(value = "Register a applicant", response = ApplicantModel.class)
@ApiResponses(value = {
		@ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns a applicant was created", response = ApplicantModel.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 register(@Context HttpServletRequest request, @Context HttpHeaders header, @Context Company company,
		@Context Locale locale, @Context User user, @Context ServiceContext serviceContext,
		@BeanParam ApplicantInputModel input);
 
Example 60
Project: holon-core   File: TestRestClientPropertyBox.java   Source Code and License 5 votes vote down vote up
@PUT
@Path("box/save")
@Consumes(MediaType.APPLICATION_JSON)
public Response saveBox(@PropertySetRef(TestRestClientPropertyBox.class) PropertyBox box) {
	assertNotNull(box);
	return Response.accepted().build();
}