コード例 #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);
  }
コード例 #2
0
 public Tracker getTracker() {
   return (TrackerImpl.getSingleton());
 }
コード例 #3
0
ファイル: TrackingEvent.java プロジェクト: Nastel/TNT4J
 /**
  * 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;
 }