'Determine, based on the user configured parameters:
- self.what_to_trap
- self.methods_to_trap
- self.what_not_to_trap
- self.trap
If the request needs to be trapped or not.
:param http_request: The request to analyze.'

def _should_be_trapped(self, http_request):

    if (not self.parent_process.trap):
        return False
    if (len(self.parent_process.methods_to_trap) and (http_request.get_method() not in self.parent_process.methods_to_trap)):
        return False
    url_string = http_request.get_uri().uri2url().url_string
    if self.parent_process.what_not_to_trap.search(url_string):
        return False
    if (not self.parent_process.what_to_trap.search(url_string)):
        return False
    return True
