當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpStatus.GONE屬性代碼示例

本文整理匯總了Java中org.springframework.http.HttpStatus.GONE屬性的典型用法代碼示例。如果您正苦於以下問題:Java HttpStatus.GONE屬性的具體用法?Java HttpStatus.GONE怎麽用?Java HttpStatus.GONE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.springframework.http.HttpStatus的用法示例。


在下文中一共展示了HttpStatus.GONE屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deleteServiceInstanceBinding

@RequestMapping(value = "/{instanceId}/service_bindings/{bindingId}", method = RequestMethod.DELETE)
public ResponseEntity<String> deleteServiceInstanceBinding(@PathVariable("instanceId") String instanceId,
		@PathVariable("bindingId") String bindingId, @RequestParam("service_id") String serviceId,
		@RequestParam("plan_id") String planId) throws ServiceBrokerException {

	log.debug("DELETE: " + SERVICE_INSTANCE_BINDING_BASE_PATH + "/{bindingId}"
			+ ", deleteServiceInstanceBinding(),  serviceInstance.id = " + instanceId + ", bindingId = " + bindingId
			+ ", serviceId = " + serviceId + ", planId = " + planId);

	try {
		bindingService.deleteServiceInstanceBinding(bindingId);
	} catch (ServerviceInstanceBindingDoesNotExistsException e) {
		return new ResponseEntity<String>("{}", HttpStatus.GONE);
	}

	log.debug("ServiceInstanceBinding Deleted: " + bindingId);

	return new ResponseEntity<String>("{}", HttpStatus.OK);
}
 
開發者ID:evoila,項目名稱:cfsummiteu2017,代碼行數:19,代碼來源:ServiceInstanceBindingController.java

示例2: delete

@RequestMapping(method = RequestMethod.DELETE)
public ResponseEntity<?> delete(@PathVariable("instance_id") String instanceId, @PathVariable("binding_id") String bindingId) {
    logger.info("Entered DELETE of binding instance");
    HttpStatus respCode;
    if (bindingInstanceService.isExists(instanceId, bindingId)) {
        bindingInstanceService.delete(bindingId);
        respCode = HttpStatus.OK;
        logger.trace("Deleted binding instance");
    } else {
        respCode = HttpStatus.GONE;
        logger.warn("Binding: " + bindingId + " does not exist");
    }
    logger.debug("Returning: " + respCode + " (" + respCode.name() + ")");
    return new ResponseEntity<>(Collections.emptyMap(), respCode);
}
 
開發者ID:blackducksoftware,項目名稱:hub-cf,代碼行數:15,代碼來源:BindingInstancesRestServer.java

示例3: delete

@RequestMapping(value = "/users", method = RequestMethod.DELETE)
public ResponseEntity<?> delete(@PathVariable("id") int id) {
    userDao.delete(id);
    return new ResponseEntity<>(HttpStatus.GONE);
}
 
開發者ID:rodrigues882013,項目名稱:springboot-rest-api-skeleton,代碼行數:5,代碼來源:UserController.java

示例4: delete

@RequestMapping(method = RequestMethod.DELETE)
public ResponseEntity<?> delete(@PathVariable("instance_id") String instanceId) {
    logger.info("Entered DELETE service instance");
    return new ResponseEntity<>(Collections.emptyMap(), (serviceInstanceService.delete(instanceId) ? HttpStatus.OK : HttpStatus.GONE));
}
 
開發者ID:blackducksoftware,項目名稱:hub-cf,代碼行數:5,代碼來源:ServiceInstancesRestServer.java


注:本文中的org.springframework.http.HttpStatus.GONE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。