* @param request the request to add to a queue of this wokrgroup.
* @return true if the request was added to a queue.
*/
public boolean queueRequest(UserRequest request) {
// Retrieve routing manager
RoutingManager routingManager = RoutingManager.getInstance();
// Check if they require referer validation.
boolean contains = containsValidReferer(request);
if (!contains) {
return false;
}
if (getStatus() != Workgroup.Status.OPEN) {
return false;
}
// Check if the request may be accepted by the workgroup
PacketError.Condition error = requestFilterFactory.getFilter().filter(request);
if (error == null) {
synchronized (routingManager) {
// Add the request to the best queue of the workgroup
routingManager.routeRequest(this, request);
return true;
}
}
return false;
}