Process responses to sysproc invocations generated by this daemon
via processPeriodicWork
@param response
@return
546870
public Future<Void> processClientResponse(final Callable<ClientResponseImpl> response) {
        return m_es.submit(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                try {
                    ClientResponseImpl resp = response.call();
                    long handle = resp.getClientHandle();
                    m_procedureCallbacks.remove(handle).clientCallback(resp);
                } catch (Exception e) {
                    SNAP_LOG.warn("Error when SnapshotDaemon invoked callback for a procedure invocation", e);
                    /*
                     * Don't think it is productive to propagate any exceptions here, Ideally
                     * they should be handled by the procedure callbacks
                     */
                }
                return null;
            }
        });
    }
348196
private void processScanResponse(ClientResponse response) {
        setState(State.WAITING);
        if (response.getStatus() != ClientResponse.SUCCESS) {
            logFailureResponse("Initial snapshot scan failed", response);
            return;
        }

        final VoltTable results[] = response.getResults();
        if (results.length == 1) {
            final VoltTable result = results[0];
            boolean advanced = result.advanceRow();
            assert(advanced);
            assert(result.getColumnCount() == 1);
            assert(result.getColumnType(0) == VoltType.STRING);
            SNAP_LOG.warn("Initial snapshot scan failed with failure response: " + result.getString("ERR_MSG"));
            return;
        }
        assert(results.length == 3);

        final VoltTable snapshots = results[0];
        assert(snapshots.getColumnCount() == 10);

        final File myPath = new File(m_path);
        while (snapshots.advanceRow()) {
            final String path = snapshots.getString("PATH");
            final File pathFile = new File(path);
            if (pathFile.equals(myPath)) {
                final String nonce = snapshots.getString("NONCE");
                if (nonce.startsWith(m_prefixAndSeparator)) {
                    final Long txnId = snapshots.getLong("TXNID");
                    m_snapshots.add(new Snapshot(path, SnapshotPathType.SNAP_AUTO, nonce, txnId));
                }
            }
        }

        java.util.Collections.sort(m_snapshots);

        deleteExtraSnapshots();
    }
608112
protected boolean shouldResponseBeRecordedAsFailure(final HttpServletResponse response) {
        val status = response.getStatus();
        return status != HttpStatus.SC_CREATED && status != HttpStatus.SC_OK && status != HttpStatus.SC_MOVED_TEMPORARILY;
    }
588550
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		syslog_server_responses result = (syslog_server_responses) service.get_payload_formatter().string_to_resource(syslog_server_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.syslog_server_response_array);
		}
		syslog_server[] result_syslog_server = new syslog_server[result.syslog_server_response_array.length];
		
		for(int i = 0; i < result.syslog_server_response_array.length; i++)
		{
			result_syslog_server[i] = result.syslog_server_response_array[i].syslog_server[0];
		}
		
		return result_syslog_server;
	}
1297603
private static ResponseSwitch createResponseSwitch(Object response)
  {
      if (response instanceof HttpServletResponse)
      {
          return new HttpServletResponseSwitch((HttpServletResponse) response);
      }
      else if (response instanceof ServletResponse)
      {
          return new ServletResponseSwitch((ServletResponse) response);
      }
      return null;
  }
641872
public void onSuccess (final WriteResponse response) {
    for (final Thunk thunk: this.thunks) {
      thunk.callback.onSuccess(new WriteResponse() {
        @Override
        public Object getRawResponse() {
          return response.getRawResponse();
        }

        @Override
        public String getStringResponse() {
          return response.getStringResponse();
        }

        @Override
        public long bytesWritten() {
          return thunk.sizeInBytes;
        }
      });
    }
  }
286220
public static StringBuilder computeMessageBuffer(HttpResponse response) {
    StringBuilder builder = new StringBuilder();
    int statusCode = response.getStatusCode();
    if (statusCode != 0) {
      builder.append(statusCode);
    }
    String statusMessage = response.getStatusMessage();
    if (statusMessage != null) {
      if (statusCode != 0) {
        builder.append(' ');
      }
      builder.append(statusMessage);
    }
    return builder;
  }
672767
public static <T> ResultQueueEntry<T> fromResponse(T response) {
    Preconditions.checkArgument(response != null, "Response may not be null");
    return new ResponseResultQueueEntry<T>(response);
  }
323949
@Override
    public void onProcessUnstructuredSSResponse(ProcessUnstructuredSSResponse procUnstrResInd) {
        // Server shouldn't be getting ProcessUnstructuredSSResponseIndication
        logger.error(String.format("onProcessUnstructuredSSResponseIndication for Dialog=%d and invokeId=%d", procUnstrResInd
                .getMAPDialog().getLocalDialogId(), procUnstrResInd.getInvokeId()));
    }
580099
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
	{
		syslog_sslvpn_responses result = (syslog_sslvpn_responses) service.get_payload_formatter().string_to_resource(syslog_sslvpn_responses.class, response);
		if(result.errorcode != 0)
		{
			if (result.errorcode == SESSION_NOT_EXISTS)
				service.clear_session();
			throw new nitro_exception(result.message, result.errorcode, (base_response [])result.syslog_sslvpn_response_array);
		}
		syslog_sslvpn[] result_syslog_sslvpn = new syslog_sslvpn[result.syslog_sslvpn_response_array.length];
		
		for(int i = 0; i < result.syslog_sslvpn_response_array.length; i++)
		{
			result_syslog_sslvpn[i] = result.syslog_sslvpn_response_array[i].syslog_sslvpn[0];
		}
		
		return result_syslog_sslvpn;
	}
470352
public void dispatchResponse(ManagerResponse response)
    {
        final String actionId;
        String internalActionId;
        SendActionCallback listener;

        // shouldn't happen
        if (response == null)
        {
            logger.error("Unable to dispatch null response. This should never happen. Please file a bug.");
            return;
        }

        actionId = response.getActionId();
        internalActionId = null;
        listener = null;

        if (actionId != null)
        {
            internalActionId = ManagerUtil.getInternalActionId(actionId);
            response.setActionId(ManagerUtil.stripInternalActionId(actionId));
        }

        if (logger.isDebugEnabled())
        {
            logger.debug("Dispatching response with internalActionId '" + internalActionId + "':\n" + response);
        }

        if (internalActionId != null)
        {
            synchronized (this.responseListeners)
            {
                listener = responseListeners.get(internalActionId);
                if (listener != null)
                {
                    this.responseListeners.remove(internalActionId);
                }
                else
                {
                    // when using the async sendAction it's ok not to register a
                    // callback so if we don't find a response handler thats ok
                    logger.debug("No response listener registered for " + "internalActionId '" + internalActionId + "'");
                }
            }
        }
        else
        {
            logger.error(
                    "Unable to retrieve internalActionId from response: " + "actionId '" + actionId + "':\n" + response);
        }

        if (listener != null)
        {
            try
            {
                listener.onResponse(response);
            }
            catch (Exception e)
            {
                logger.warn("Unexpected exception in response listener " + listener.getClass().getName(), e);
            }
        }
    }
1314158
def ProcessResponses(self, responses, thread_pool):
    """"""
    for response in responses:
      thread_pool.AddTask(
          target=self._SafeProcessMessage,
          args=(response,),
          name=self.__class__.__name__)
1141002
public Long waitForProcess() throws InterruptedException {
        // take和history.put操作非原子，addReply操作时会出现并发问题，同一个processId插入两次
        Long processId = (Long) replyProcessIds.take();
        logger.debug("## {} get reply id [{}]", ClassUtils.getShortClassName(this.getClass()), processId);
        return processId;
    }
298598
public HttpClientResponseBuilder doReturn(int statusCode, String response) {
        return doReturn(statusCode, response, Charset.forName("UTF-8"));
    }
1227484
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
		ipseccounters_stats[] resources = new ipseccounters_stats[1];
		ipseccounters_response result = (ipseccounters_response) service.get_payload_formatter().string_to_resource(ipseccounters_response.class, response);
		if(result.errorcode != 0) {
			if (result.errorcode == 444) {
				service.clear_session();
			}
			if(result.severity != null)
			{
				if (result.severity.equals("ERROR"))
					throw new nitro_exception(result.message,result.errorcode);
			}
			else
			{
				throw new nitro_exception(result.message,result.errorcode);
			}
		}
		resources[0] = result.ipseccounters;
		return resources;
	}
357628
protected void processNoCache( HttpServletRequest request, HttpServletResponse response )
    {
        //
        // Set the no-cache headers if:
        //    1) the module is configured for it, or
        //    2) netui-config.xml has an "always" value for <pageflow-config><prevent-cache>, or
        //    3) netui-config.xml has an "inDevMode" value for <pageflow-config><prevent-cache>, and we're not in
        //       production mode.
        //
        boolean noCache = moduleConfig.getControllerConfig().getNocache();

        if ( ! noCache )
        {
            PageFlowConfig pfConfig = ConfigUtil.getConfig().getPageFlowConfig();
            
            if ( pfConfig != null )
            {
                PreventCache preventCache = pfConfig.getPreventCache();
                
                if ( preventCache != null )
                {
                    switch ( preventCache.getValue() )
                    {
                        case PreventCache.INT_ALWAYS:
                            noCache = true;
                            break;
                        case PreventCache.INT_IN_DEV_MODE:
                            noCache = ! _servletContainerAdapter.isInProductionMode();
                            break;
                    }
                }
            }
        }
        
        if ( noCache )
        {
            //
            // The call to PageFlowPageFilter.preventCache() will cause caching to be prevented
            // even when we end up forwarding to a page.  Normally, no-cache headers are lost
            // when a server forward occurs.
            //
            ServletUtils.preventCache( response );
            PageFlowUtils.setPreventCache( request );
        }
    }
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;
    }