Back to project page playnomics-android.
The source code is released under:
Apache License
If you think the Android project playnomics-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.playnomics.android.client; //from ww w.j a v a 2 s . c om import java.util.concurrent.ConcurrentLinkedQueue; import com.playnomics.android.events.PlaynomicsEvent; import com.playnomics.android.util.IConfig; import com.playnomics.android.util.Util; public class EventQueue implements IEventQueue { private IConfig config; private IHttpConnectionFactory factory; private ConcurrentLinkedQueue<String> eventUrlQueue; public EventQueue(IConfig config, IHttpConnectionFactory builder) { this.config = config; eventUrlQueue = new ConcurrentLinkedQueue<String>(); this.factory = builder; } public void enqueueEvent(PlaynomicsEvent event) { String eventUrl = factory.buildUrl(config.getEventsUrl(), event.getUrlPath(), event.getEventParameters()); enqueueEventUrl(eventUrl); } public void enqueueEventUrl(String eventUrl) { if (!Util.stringIsNullOrEmpty(eventUrl)) { eventUrlQueue.add(eventUrl); } } public boolean isEmpty() { return eventUrlQueue.isEmpty(); } public String dequeueEventUrl() { return eventUrlQueue.remove(); } }