@_synchronize<EOL><INDENT>def process_request(self, request, credential=None):<DEDENT>
self._client_identity = [None, None]<EOL>header = request.request_header<EOL>self._set_protocol_version(header.protocol_version)<EOL>max_response_size = None<EOL>if header.maximum_response_size:<EOL><INDENT>max_response_size = header.maximum_response_size.value<EOL><DEDENT>now = int(time.time())<EOL>if header.time_stamp:<EOL><INDENT>then = header.time_stamp.value<EOL>if (now >= then) and ((now - then) < <NUM_LIT>):<EOL><INDENT>self._logger.info("<STR_LIT>".format(<EOL>time.strftime(<EOL>"<STR_LIT>",<EOL>time.gmtime(then)<EOL>)<EOL>))<EOL><DEDENT>else:<EOL><INDENT>if now < then:<EOL><INDENT>self._logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>then,<EOL>now<EOL>)<EOL>)<EOL>raise exceptions.InvalidMessage(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>else:<EOL><INDENT>self._logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(then, now)<EOL>)<EOL>raise exceptions.InvalidMessage(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>self._logger.info("<STR_LIT>".format(<EOL>time.strftime(<EOL>"<STR_LIT>",<EOL>time.gmtime(now)<EOL>)<EOL>))<EOL><DEDENT>self.is_asynchronous = False<EOL>if header.asynchronous_indicator is not None:<EOL><INDENT>self.is_asynchronous = header.asynchronous_indicator.value<EOL><DEDENT>if self.is_asynchronous:<EOL><INDENT>raise exceptions.InvalidMessage(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if header.authentication:<EOL><INDENT>if header.authentication.credentials:<EOL><INDENT>auth_credentials = header.authentication.credentials[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>auth_credentials = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>auth_credentials = None<EOL><DEDENT>self._verify_credential(auth_credentials, credential)<EOL>batch_error_option = enums.BatchErrorContinuationOption.STOP<EOL>if header.batch_error_cont_option is not None:<EOL><INDENT>batch_error_option = header.batch_error_cont_option.value<EOL><DEDENT>if batch_error_option == enums.BatchErrorContinuationOption.UNDO:<EOL><INDENT>raise exceptions.InvalidMessage(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>batch_order_option = False<EOL>if header.batch_order_option:<EOL><INDENT>batch_order_option = header.batch_order_option.value<EOL><DEDENT>response_batch = self._process_batch(<EOL>request.batch_items,<EOL>batch_error_option,<EOL>batch_order_option<EOL>)<EOL>response = self._build_response(<EOL>header.protocol_version,<EOL>response_batch<EOL>)<EOL>return response, max_response_size, header.protocol_version<EOL>
Process a KMIP request message.

This routine is the main driver of the KmipEngine. It breaks apart and
processes the request header, handles any message errors that may
result, and then passes the set of request batch items on for
processing. This routine is thread-safe, allowing multiple client
connections to use the same KmipEngine.

Args:
    request (RequestMessage): The request message containing the batch
        items to be processed.
    credential (string): Identifying information about the client
        obtained from the client certificate. Optional, defaults to
        None.

Returns:
    ResponseMessage: The response containing all of the results from
        the request batch items.