
ibt.ortc.extensibility.DispatchedMessages Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of messaging Show documentation
Show all versions of messaging Show documentation
Realtime Cloud Messaging (ORTC) SDK for Java
package ibt.ortc.extensibility;
import java.util.HashMap;
class DispatchedMessages {
private static final int LIMIT = 1024;
private int currentIdx;
private String[] ids;
private HashMap hMap;
public DispatchedMessages(){
this.currentIdx = 0;
this.ids = new String[LIMIT];
this.hMap = new HashMap();
}
protected void addMessageId(String messageId){
currentIdx++;
if(currentIdx>=LIMIT)
currentIdx = 0;
if(ids[currentIdx] != null){
hMap.remove(ids[currentIdx]);
}
hMap.put(messageId, currentIdx);
ids[currentIdx] = messageId;
}
protected boolean checkIfDispatched(String messageId){
return hMap.containsKey(messageId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy