@Delete() public void deletePatientConditional(@IdParam IdType theId, @ConditionalUrlParam String theConditionalUrl) { // Only one of theId or theConditionalUrl will have a value depending // on whether the URL receieved was a logical ID, or a conditional // search string if (theId != null) { // do a normal delete } else { // do a conditional delete } // otherwise, delete was successful return; // can also return MethodOutcome } //END SNIPPET: deleteConditional
@Delete() public void deletePatient(@IdParam IdType theId) { // .. Delete the patient .. if (couldntFindThisId) { throw new ResourceNotFoundException("Unknown version"); } if (conflictHappened) { throw new ResourceVersionConflictException("Couldn't delete because [foo]"); } // otherwise, delete was successful return; // can also return MethodOutcome } //END SNIPPET: delete
@Delete public MethodOutcome delete(@IdParam IIdType theId) { TreeMap<Long, T> versions = myIdToVersionToResourceMap.get(theId.getIdPart()); if (versions == null || versions.isEmpty()) { throw new ResourceNotFoundException(theId); } long nextVersion = versions.lastEntry().getKey() + 1L; IIdType id = store(null, theId.getIdPart(), nextVersion); myDeleteCount.incrementAndGet(); return new MethodOutcome() .setId(id); }
@Delete() public MethodOutcome delete(HttpServletRequest theRequest, @IdParam IdDt theResource, @ConditionalUrlParam(supportsMultiple = true) String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().deleteByUrl(theConditional, theRequestDetails); } else { return getDao().delete(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Delete() public MethodOutcome delete(HttpServletRequest theRequest, @IdParam IdType theResource, @ConditionalUrlParam(supportsMultiple = true) String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().deleteByUrl(theConditional, theRequestDetails); } else { return getDao().delete(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Delete() public MethodOutcome delete(HttpServletRequest theRequest, @IdParam IdType theResource, @ConditionalUrlParam(supportsMultiple = true) String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().deleteByUrl(theConditional, theRequestDetails); } else { return getDao().delete(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Delete public MethodOutcome delete(@IdParam IIdType theId) { TreeMap<Long, T> versions = myIdToVersionToResourceMap.get(theId.getIdPart()); if (versions == null || versions.isEmpty()) { throw new ResourceNotFoundException(theId); } long nextVersion = versions.lastEntry().getKey() + 1L; IIdType id = store(null, theId.getIdPart(), nextVersion); myDeleteCount.incrementAndGet(); return new MethodOutcome() .setId(id); }
@Delete() public MethodOutcome delete(HttpServletRequest theRequest, @IdParam IdDt theResource, @ConditionalUrlParam(supportsMultiple = true) String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().deleteByUrl(theConditional, theRequestDetails); } else { return getDao().delete(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Delete() public MethodOutcome delete(HttpServletRequest theRequest, @IdParam IdType theResource, @ConditionalUrlParam(supportsMultiple = true) String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().deleteByUrl(theConditional, theRequestDetails); } else { return getDao().delete(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }
@Delete() public MethodOutcome delete(HttpServletRequest theRequest, @IdParam IdType theResource, @ConditionalUrlParam(supportsMultiple = true) String theConditional, RequestDetails theRequestDetails) { startRequest(theRequest); try { if (theConditional != null) { return getDao().deleteByUrl(theConditional, theRequestDetails); } else { return getDao().delete(theResource, theRequestDetails); } } finally { endRequest(theRequest); } }