本文整理汇总了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);
}
示例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);
}
示例3: delete
@RequestMapping(value = "/users", method = RequestMethod.DELETE)
public ResponseEntity<?> delete(@PathVariable("id") int id) {
userDao.delete(id);
return new ResponseEntity<>(HttpStatus.GONE);
}
示例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));
}