Ejemplo n.º 1
0
  private void addLog(String logString, OperationState state) {
    // ignore all messages after operation was marked as complete
    if (this.state != OperationState.RUNNING) {
      return;
    }

    if (!Strings.isNullOrEmpty(logString)) {

      if (log.length() > 0) {
        log.append("\n");
      }
      log.append(
          String.format(
              "{\"date\" : %s, \"log\" : \"%s\", \"state\" : \"%s\"},",
              new Timestamp(System.currentTimeMillis()).getTime(),
              logString.replace("\"", "\\\""),
              state));
    }
    this.state = state;
    tracker.saveTrackerOperation(source, this);
  }
 public Tracker getTracker() {
   return (TrackerImpl.getSingleton());
 }
Ejemplo n.º 3
0
 /**
  * Sign current event with hash/signature based on trackers configured signature factory.
  *
  * @return signed self
  * @throws NoSuchAlgorithmException
  */
 public TrackingEvent sign() throws NoSuchAlgorithmException {
   if (tracker != null) {
     setSignature(tracker.getConfiguration().getSignFactory().sign(this));
   }
   return this;
 }