public boolean isRejector(AgentSession agentSession) { Date rejectionTime = rejectionTimes.get(agentSession.getJID().toBareJID()); boolean rejector = false; if (rejectionTime != null) { if (rejectionTime.getTime() > System.currentTimeMillis() - rejectionTimeout) { rejector = true; } else { rejectionTimes.remove(agentSession.getJID().toBareJID()); } } return rejector; }
public void removeRejector(AgentSession agentSession) { rejections.remove(agentSession.getJID().toBareJID()); rejectionTimes.remove(agentSession.getJID().toBareJID()); }
private void addRejector(AgentSession agentSession) { rejections.add(agentSession.getJID().toBareJID()); rejectionTimes.put(agentSession.getJID().toBareJID(), new Date()); }