@Produces( {MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML})
public DefectAsset deleteDefect(@Context UriInfo uriInfo, @PathParam(DEFECT) String defectId) {
// initialize the memory store
DataStore store = DataStore.getInstance();
// obtain data object from memory store
DefectBean defect = store.getDefect(defectId);
if (defect == null) {
logger.error("Defect {} was not found", defectId);
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
// remove defect legacy bean from memory store
store.removeDefect(defect.getId());
// create new asset and set defect bean that is being deleted as its
// data object
DefectAsset asset = new DefectAsset(defect);
return asset;