Example #1
0
 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;
 }
Example #2
0
 public void reject(AgentSession agentSession) {
   if (pendingSessions.contains(agentSession)) {
     addRejector(agentSession);
     pendingSessions.remove(agentSession);
     agentSession.removeOffer(this);
   }
 }
Example #3
0
 public void removeRejector(AgentSession agentSession) {
   rejections.remove(agentSession.getJID().toBareJID());
   rejectionTimes.remove(agentSession.getJID().toBareJID());
 }
Example #4
0
 private void addRejector(AgentSession agentSession) {
   rejections.add(agentSession.getJID().toBareJID());
   rejectionTimes.put(agentSession.getJID().toBareJID(), new Date());
 }