private void checkOveractivity(HttpConnection connection) throws HttpBindException {
        int pendingConnections;
        OveractivityType overactivity = OveractivityType.NONE;

        synchronized (connectionQueue) {
            pendingConnections = connectionQueue.size();
        }

        Instant time = Instant.now();
        Duration deltaFromLastPoll = Duration.between(lastPoll, time).abs();
        if(pendingConnections >= maxRequests) {
            overactivity = OveractivityType.TOO_MANY_SIM_REQS;
        }
        else if(connection.isPoll()) {
            boolean localIsPollingSession = isPollingSession();
            if (deltaFromLastPoll.compareTo(maxPollingInterval) < 0) {
                if (localIsPollingSession) {
                    overactivity = lastResponseEmpty ? OveractivityType.POLLING_TOO_QUICK : OveractivityType.NONE;
                } else {
                    overactivity = pendingConnections >= maxRequests ? OveractivityType.POLLING_TOO_QUICK : OveractivityType.NONE;
                }
            }
            lastPoll = time;
            Log.debug("Updated session {} lastPoll to {} with rid {} lastResponseEmpty = {} overactivity = {} deltaFromLastPoll = {} isPollingSession() = {} maxRequests = {} pendingConnections = {}",
                      getStreamID(), lastPoll, connection.getRequestId(), lastResponseEmpty, overactivity, deltaFromLastPoll, localIsPollingSession, maxRequests, pendingConnections);
        }
        setLastResponseEmpty(false);

        if( overactivity != OveractivityType.NONE) {
            StringBuilder errorMessage = new StringBuilder("Overactivity detected");
            switch (overactivity) {
                case TOO_MANY_SIM_REQS: {
                    errorMessage.append(", too many simultaneous requests.");
                    break;
                }
                case POLLING_TOO_QUICK: {
                    errorMessage.append(", minimum polling interval is ");
                    errorMessage.append(maxPollingInterval);
                    errorMessage.append(", current session ");
                    errorMessage.append(" interval ");
                    errorMessage.append(deltaFromLastPoll);
                    break;
                }
                default: {
                    throw new HttpBindException("Unhandled overactivity type: " + overactivity, BoshBindingError.internalServerError);
                }
            }
            String errorMessageStr = errorMessage.toString();
            Log.debug(errorMessageStr);
            if (!JiveGlobals.getBooleanProperty("xmpp.httpbind.client.requests.ignoreOveractivity", false)) {
                throw new HttpBindException(errorMessageStr, BoshBindingError.policyViolation);
            }
        }
    }
Check that the client SHOULD NOT make more simultaneous requests than specified
by the 'requests' attribute in the connection manager's Session Creation Response.
However, the client MAY make one additional request if it is to pause or terminate a session.

@see <a href="http://www.xmpp.org/extensions/xep-0124.html#overactive">overactive</a>
@param connection the new connection.
@throws HttpBindException if the connection has violated a facet of the HTTP binding
        protocol.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpSession.java