@Override public void clear() { mEventCache.clear(); // Try to exit the loop as the queue is empty if (mRunning) forceDispatch(); }
/** * Set a data structure here to put the Dispatcher into dry-run-mode. * Data will be processed but at the last step just stored instead of transmitted. * Set it to null to disable it. * * @param dryRunTarget a data structure the data should be passed into */ public void setDryRunTarget(List<Packet> dryRunTarget) { mDispatcher.setDryRunTarget(dryRunTarget); }
/** * Timeout when trying to establish connection and when trying to read a response. * Values take effect on next dispatch. * * @param timeOut timeout in milliseconds */ @Override public void setConnectionTimeOut(int timeOut) { mTimeOut = timeOut; mPacketSender.setTimeout(mTimeOut); }
public Dispatcher build(Tracker tracker) { return new DefaultDispatcher( new EventCache(new EventDiskCache(tracker)), new Connectivity(tracker.getMatomo().getContext()), new PacketFactory(tracker.getAPIUrl()), new DefaultPacketSender() ); } }
/** * Set the interval to 0 to dispatch events as soon as they are queued. * If a negative value is used the dispatch timer will never run, a manual dispatch must be used. * * @param dispatchInterval in milliseconds */ public Tracker setDispatchInterval(long dispatchInterval) { mDispatcher.setDispatchInterval(dispatchInterval); return this; }
/** * Packets are collected and dispatched in batches. This boolean sets if post must be * gzipped or not. Use of gzip needs mod_deflate/Apache ou lua_zlib/NGINX * * @param dispatchGzipped boolean */ @Override public void setDispatchGzipped(boolean dispatchGzipped) { mDispatchGzipped = dispatchGzipped; mPacketSender.setGzipData(mDispatchGzipped); }
/** * {@link Dispatcher#setConnectionTimeOut(int)} */ public void setDispatchTimeout(int timeout) { mDispatcher.setConnectionTimeOut(timeout); }
/** * Processes all queued events in background thread */ public void dispatch() { if (mOptOut) return; mDispatcher.forceDispatch(); }
/** * Defines if when dispatched, posted JSON must be Gzipped. * Need to be handle from web server side with mod_deflate/APACHE lua_zlib/NGINX. * * @param dispatchGzipped boolean */ public Tracker setDispatchGzipped(boolean dispatchGzipped) { mDispatcher.setDispatchGzipped(dispatchGzipped); return this; }
/** * If we are in dry-run mode then this will return a datastructure. * * @return a datastructure or null */ public List<Packet> getDryRunTarget() { return mDispatcher.getDryRunTarget(); }
/** * Packets are collected and dispatched in batches, this intervals sets the pause between batches. * * @param dispatchInterval in milliseconds */ @Override public void setDispatchInterval(long dispatchInterval) { mDispatchInterval = dispatchInterval; if (mDispatchInterval != -1) launch(); }
public Dispatcher build(Tracker tracker) { return new DefaultDispatcher( new EventCache(new EventDiskCache(tracker)), new Connectivity(tracker.getMatomo().getContext()), new PacketFactory(tracker.getAPIUrl()), new DefaultPacketSender() ); } }
@Override public void clear() { mEventCache.clear(); // Try to exit the loop as the queue is empty if (mRunning) forceDispatch(); }
/** * Timeout when trying to establish connection and when trying to read a response. * Values take effect on next dispatch. * * @param timeOut timeout in milliseconds */ @Override public void setConnectionTimeOut(int timeOut) { mTimeOut = timeOut; mPacketSender.setTimeout(mTimeOut); }
/** * Set the interval to 0 to dispatch events as soon as they are queued. * If a negative value is used the dispatch timer will never run, a manual dispatch must be used. * * @param dispatchInterval in milliseconds */ public Tracker setDispatchInterval(long dispatchInterval) { mDispatcher.setDispatchInterval(dispatchInterval); return this; }
/** * Packets are collected and dispatched in batches. This boolean sets if post must be * gzipped or not. Use of gzip needs mod_deflate/Apache ou lua_zlib/NGINX * * @param dispatchGzipped boolean */ @Override public void setDispatchGzipped(boolean dispatchGzipped) { mDispatchGzipped = dispatchGzipped; mPacketSender.setGzipData(mDispatchGzipped); }
/** * If we are in dry-run mode then this will return a datastructure. * * @return a datastructure or null */ public List<Packet> getDryRunTarget() { return mDispatcher.getDryRunTarget(); }
/** * Packets are collected and dispatched in batches, this intervals sets the pause between batches. * * @param dispatchInterval in milliseconds */ @Override public void setDispatchInterval(long dispatchInterval) { mDispatchInterval = dispatchInterval; if (mDispatchInterval != -1) launch(); }