def METHOD_NAME(self, parameters):
    """Handle the request based on the parameters."""
    try:
        for values in self.get_results(parameters):
            self.fp.write_int32(constants.NSLCD_RESULT_BEGIN)
            self.write(*values)
            if self.cache:
                self.cache.store(*values)
    except ldap.SERVER_DOWN:
        if self.cache:
            logging.debug('read from cache')
            # we assume server went down before writing any entries
            for values in self.cache.retrieve(parameters):
                self.fp.write_int32(constants.NSLCD_RESULT_BEGIN)
                self.write(*values)
        else:
            raise
    # write the final result code
    self.fp.write_int32(constants.NSLCD_RESULT_END)