Generate an order to add a message to the System's audit log

@param response
The response to add an order to
@param oid
The object ID we are logging
@param message
The message we want to log
349604
private void audit(JsonSimple response, String oid, String message) {
		JsonObject order = newSubscription(response, oid);
		JsonObject messageObject = (JsonObject) order.get("message");
		messageObject.put("eventType", message);
	}
1319330
public void setResponse(JsonRpcResponse response) {
    if (response.isError()) {
      setException(response.error());
      return;
    }

    try {
      set((V) Messages.fromJson(method.outputBuilder(), response.result()));
    } catch (Exception e) {
      setException(e);
    }
  }
729008
public static Print print(final String... _oid)
    {
        return (Print) org.efaps.eql2.EQL2.print(_oid);
    }
1146467
@Override
	public void onAdd(Response response) {
		ensureInitialized();

		KeyValuePair keyValuePair = new KeyValuePair(KafkaConstants.RESPONSE_TYPE, gson.toJson(response));
		String message = gson.toJson(keyValuePair);
		
		try {
			kafkaSender.send(buildTopicNames(response), message);
		} catch (InterruptedException | ExecutionException e) {
			logger.error("Failed to send add response message to output topic.", e);
		}
	}
1140863
@Override
    protected Long logResponse(Response response) {
        Long responseId = super.logResponse(response);
        int code = response.getStatusCode() == null ? 0 : response.getStatusCode();
        String message = response.getStatusMessage() == null ? StatusResponse.forCode(code).getStatus().getMessage() :
                response.getStatusMessage();
        Status status = new Status(code, message);
        try {
            updateServiceSummary(status, responseId);
        }
        catch (ActivityException | SQLException ex) {
            logexception(ex.getMessage(), ex);
        }
        return responseId;
    }
1296025
@Override
  protected void deliverLog(String msg)
  {
    synchronized (_os) {
      try {
        _os.print(msg);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
1133570
static void generateLogForContentProviderBeginning(SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
		if (method.getParent().isLogEnabled()) {
			methodBuilder.addStatement("$T.info($S, uri.toString())", Logger.class, "Execute " + method.jql.operationType + " for URI %s");
		}

	}
148311
@Override
  public void processResponse(CloseableHttpResponse response) throws IOException, UnexpectedResponseException {
    if (response.getStatusLine().getStatusCode() >= 400) {
      if (response.getEntity() != null) {
        throw new RuntimeException("Failed. " + EntityUtils.toString(response.getEntity())
                                 + " , response: " + ToStringBuilder.reflectionToString(response, ToStringStyle.SHORT_PREFIX_STYLE));
      }
      throw new RuntimeException("Failed. Response: " + ToStringBuilder.reflectionToString(response, ToStringStyle.SHORT_PREFIX_STYLE));
    }
  }
995233
function _doVoid($oID, $note = '') {
    global $db, $messageStack;

    $new_order_status = (int)MODULE_PAYMENT_AUTHORIZENET_AIM_REFUNDED_ORDER_STATUS_ID;
    if ($new_order_status == 0) $new_order_status = 1;
    $voidNote = strip_tags(zen_db_input($_POST['voidnote'] . $note));
    $voidAuthID = trim(strip_tags(zen_db_input($_POST['voidauthid'])));
    $proceedToVoid = true;
    if (isset($_POST['ordervoid']) && $_POST['ordervoid'] == MODULE_PAYMENT_AUTHORIZENET_AIM_ENTRY_VOID_BUTTON_TEXT) {
      if (isset($_POST['voidconfirm']) && $_POST['voidconfirm'] != 'on') {
        $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_VOID_CONFIRM_ERROR, 'error');
        $proceedToVoid = false;
      }
    }
    if ($voidAuthID == '') {
      $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_TRANS_ID_REQUIRED_ERROR, 'error');
      $proceedToVoid = false;
    }
    // Populate an array that contains all of the data to be sent to gateway
    $submit_data = array('x_type' => 'VOID',
                         'x_trans_id' => trim($voidAuthID) );
    /**
     * Submit void request to Gateway
     */
    if ($proceedToVoid) {
      $response = $this->_sendRequest($submit_data);
      $response_code = $response[0];
      $response_text = $response[3];
      $response_alert = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');
      $this->reportable_submit_data['Note'] = $voidNote;
      $this->_debugActions($response);

      if ($response_code != '1' || ($response[0]==1 && $response[2] == 310) ) {
        $messageStack->add_session($response_alert, 'error');
      } else {
        // Success, so save the results
        $sql_data_array = array('orders_id' => (int)$oID,
                                'orders_status_id' => (int)$new_order_status,
                                'date_added' => 'now()',
                                'comments' => 'VOIDED. Trans ID: ' . $response[6] . ' ' . $response[4] . "\n" . $voidNote,
                                'customer_notified' => 0
                             );
        zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
        $db->Execute("update " . TABLE_ORDERS  . "
                      set orders_status = '" . (int)$new_order_status . "'
                      where orders_id = '" . (int)$oID . "'");
        $messageStack->add_session(sprintf(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_VOID_INITIATED, $response[6], $response[4]), 'success');
        return true;
      }
    }
    return false;
  }
448870
def gotMessage(self, message_id, message):
        
        d = defer.maybeDeferred(self._handle_message, message)
        d.addCallback(self.generate_response)
        d.addCallback(lambda resp: self.reply(message_id, resp))
        return d
775668
private void storeRequestData(JsonSimple message, String oid)
			throws TransactionException {

		// Get our incoming data to look at
		JsonObject toRespond = message.getObject("respond");
		JSONArray newRelations = message.getArray("relationships");
		if (toRespond == null && newRelations == null) {
			log.warn("This request requires no responses and specifies"
					+ " no relationships.");
			return;
		}

		// Get from storage
		DigitalObject object = null;
		Payload payload = null;
		InputStream inStream = null;
		try {
			object = storage.getObject(oid);
			payload = getDataPayload(object);
			inStream = payload.open();
		} catch (StorageException ex) {
			log.error("Error accessing object '{}' in storage: ", oid, ex);
			throw new TransactionException(ex);
		}

		// Parse existing data
		JsonSimple metadata = null;
		try {
			metadata = new JsonSimple(inStream);
			inStream.close();
		} catch (IOException ex) {
			log.error("Error parsing/reading JSON '{}'", oid, ex);
			throw new TransactionException(ex);
		}

		// Store our new response
		if (toRespond != null) {
			JSONArray responses = metadata.writeArray("responses");
			boolean duplicate = false;
			String newOid = (String) toRespond.get("oid");
			for (Object response : responses) {
				String oldOid = (String) ((JsonObject) response).get("oid");
				if (newOid.equals(oldOid)) {
					log.debug("Ignoring duplicate response request by '{}'"
							+ " on object '{}'", newOid, oid);
					duplicate = true;
				}
			}
			if (!duplicate) {
				log.debug("New response requested by '{}' on object '{}'",
						newOid, oid);
				responses.add(toRespond);
			}
		}

		// Store relationship(s), with some basic de-duping
		if (newRelations != null) {
			JSONArray relations = metadata.writeArray("relationships");
			for (JsonSimple newRelation : JsonSimple.toJavaList(newRelations)) {
				boolean duplicate = false;
				String identifier = newRelation.getString(null, "identifier");
				// Compare to each existing relationship
				for (JsonSimple relation : JsonSimple.toJavaList(relations)) {
					String storedId = relation.getString(null, "identifier");
					if (identifier.equals(storedId)) {
						log.debug("Ignoring duplicate relationship '{}'",
								identifier);
						duplicate = true;
					}
				}

				// Store new entries
				if (!duplicate) {
					log.debug("New relationship added to '{}'", oid);
					relations.add(newRelation.getJsonObject());
				}
			}
		}

		// Store modifications
		if (toRespond != null || newRelations != null) {
			log.info("Updating object in storage '{}'", oid);
			String jsonString = metadata.toString(true);
			try {
				updateDataPayload(object, jsonString);
			} catch (Exception ex) {
				log.error("Unable to store data '{}': ", oid, ex);
				throw new TransactionException(ex);
			}
		}
	}
256710
protected final <R extends PrimaryBackupResponse> R logResponse(R response) {
    log.trace("Sending {}", response);
    return response;
  }
690091
public void add(
            ASN1ObjectIdentifier oid,
            String value) {
        ASN1EncodableVector v = new ASN1EncodableVector();
        v.add(oid);
        v.add(new DERPrintableString(value));
        add(new DERSet(new DERSequence(v)));
    }
81726
public void processResponse(ResponseEvent response) {
    ClientTransaction trans = response.getClientTransaction();
    if (trans == null) {
      return;
    }

    SipTransaction sip_trans = null;

    synchronized (respTransactions) {
      sip_trans = (SipTransaction) respTransactions.get(trans);
    }

    if (sip_trans == null) {
      return;
    }

    if (response.getResponse().getStatusCode() > 199) {
      synchronized (respTransactions) {
        respTransactions.remove(trans);
      }
    }

    // check for listener handling
    MessageListener listener = sip_trans.getClientListener();
    if (listener != null) {
      listener.processEvent(response);
      return;
    }

    // if no listener, use the default blocking mechanism
    synchronized (sip_trans.getBlock()) {
      sip_trans.getEvents().addLast(response);
      sip_trans.getBlock().notifyEvent();
    }
  }
1304572
public void addResponse(RecordResponse response) {
        if (records == null) {
            records = new RecordResponse[1];
        }
        else {
            RecordResponse old[] = records;
            records = new RecordResponse[old.length + 1];

            System.arraycopy(old, 0, records, 0, old.length);
        }
        records[records.length - 1] = response;
    }
1312931
@Override
	public void onAdd(Response response) {
		String message = gson.toJson(response);
		
		try {
			ActiveMqUtils.sendMessage(message, buildQueueNames(response), environment);
		} catch (JMSException e) {
			logger.error("Failed to send response message to output queue.", e);
		}
	}
409407
public void doLog(String clientID, String name, long time, Level level,
			Object message, Throwable t) {
		if (logOpen && formatter != null) {
			sendMessage(syslogMessage.createMessageData(formatter.format(clientID, name, time, level, message, t)));
		}
	}