/**
  * deletes the single RemoteStacktrace object identified by the key id passed in
  *
  * @param exceptionId
  * @return
  */
 public boolean deleteRemoteStacktrace(Long exceptionId) {
   boolean deleted = false;
   if (exceptionId != null) {
     RemoteStacktrace trace = traceDao.getByKey(exceptionId);
     if (trace != null) {
       traceDao.delete(trace);
       deleted = true;
     }
   }
   return deleted;
 }
 /**
  * acknowledges a RemoteStacktrace by setting the acknowledged flag to true. This will prevent it
  * from showing up in the UI but will keep it in the data store.
  *
  * @param exceptionId
  * @return
  */
 public boolean acknowledgeRemoteStacktrace(Long exceptionId) {
   boolean acked = false;
   if (exceptionId != null) {
     RemoteStacktrace trace = traceDao.getByKey(exceptionId);
     if (trace != null) {
       trace.setAcknowleged(true);
       traceDao.save(trace);
       acked = true;
     }
   }
   return acked;
 }
 /** searches for remoteStacktrace objects that match the parameters passed in. */
 public ResponseDto<ArrayList<RemoteStacktraceDto>> listRemoteExceptions(
     String phoneNumber, String deviceId, boolean unAckOnly, String cursor) {
   ResponseDto<ArrayList<RemoteStacktraceDto>> responseDto =
       new ResponseDto<ArrayList<RemoteStacktraceDto>>();
   List<RemoteStacktrace> traceList =
       traceDao.listStacktrace(phoneNumber, deviceId, unAckOnly, cursor);
   ArrayList<RemoteStacktraceDto> dtoList = new ArrayList<RemoteStacktraceDto>();
   if (traceList != null) {
     for (RemoteStacktrace trace : traceList) {
       RemoteStacktraceDto dto = new RemoteStacktraceDto();
       DtoMarshaller.copyToDto(trace, dto);
       if (trace.getStackTrace() != null) {
         dto.setStackTrace(trace.getStackTrace().getValue());
       }
       dtoList.add(dto);
     }
     responseDto.setCursorString(RemoteStacktraceDao.getCursor(traceList));
     responseDto.setPayload(dtoList);
   }
   return responseDto;
 }
 /** deletes exceptions older than 30 days */
 public void deleteOldExceptions() {
   Calendar cal = new GregorianCalendar();
   cal.roll(Calendar.MONTH, false);
   traceDao.deleteItemsOlderThan(cal.getTime());
 }