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()); }
/** * 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; }