org.eclipse.californium.core.coap.Request.setResponse()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(234)

本文整理了Java中org.eclipse.californium.core.coap.Request.setResponse方法的一些代码示例,展示了Request.setResponse的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setResponse方法的具体详情如下:
包路径:org.eclipse.californium.core.coap.Request
类名称:Request
方法名:setResponse

Request.setResponse介绍

[英]Sets the response.

Also notifies waiting threads and invokes this request's registered
[中]设置响应。
还通知等待的线程并调用此请求的已注册线程

代码示例

代码示例来源:origin: eclipse/californium

@Override
  public void deliverResponse(Exchange exchange, Response response) {
    if (exchange == null)
      throw new NullPointerException();
    if (exchange.getRequest() == null)
      throw new NullPointerException();
    if (response == null)
      throw new NullPointerException();
    exchange.getRequest().setResponse(response);
  }
}

代码示例来源:origin: org.eclipse.californium/californium-core

@Override
  public void deliverResponse(Exchange exchange, Response response) {
    if (exchange == null) throw new NullPointerException();
    if (exchange.getRequest() == null) throw new NullPointerException();
    if (response == null) throw new NullPointerException();
    exchange.getRequest().setResponse(response);
  }
}

代码示例来源:origin: org.eclipse.californium/californium-core

@Override
  public void deliverResponse(Exchange exchange, Response response) {
    if (response == null) throw new NullPointerException();
    if (exchange == null) throw new NullPointerException();
    if (exchange.getRequest() == null) throw new NullPointerException();
    exchange.getRequest().setResponse(response);
  }
}

代码示例来源:origin: com.sitewhere/sitewhere-core

@Override
public void deliverResponse(Exchange exchange, Response response) {
if (response == null) {
  throw new NullPointerException("Response must not be null");
} else if (exchange == null) {
  throw new NullPointerException("Exchange must not be null");
} else if (exchange.getRequest() == null) {
  throw new IllegalArgumentException("Exchange does not contain request");
} else {
  exchange.getRequest().setResponse(response);
}
}

代码示例来源:origin: sitewhere/sitewhere

@Override
public void deliverResponse(Exchange exchange, Response response) {
if (response == null) {
  throw new RuntimeException("Response must not be null");
} else if (exchange == null) {
  throw new RuntimeException("Exchange must not be null");
} else if (exchange.getRequest() == null) {
  throw new IllegalArgumentException("Exchange does not contain request");
} else {
  exchange.getRequest().setResponse(response);
}
}

代码示例来源:origin: eclipse/californium

@Override
  public void deliverResponse(Exchange exchange, Response response) {
    if (response == null) {
      throw new NullPointerException("Response must not be null");
    } else if (exchange == null) {
      throw new NullPointerException("Exchange must not be null");
    } else if (exchange.getRequest() == null) {
      throw new IllegalArgumentException("Exchange does not contain request");
    } else {
      exchange.getRequest().setResponse(response);
    }
  }
}

代码示例来源:origin: org.eclipse.leshan/leshan-client

@Override
  public void deliverResponse(final Exchange exchange, final Response response) {
    if (response == null) {
      throw new NullPointerException();
    }
    if (exchange == null) {
      throw new NullPointerException();
    }
    if (exchange.getRequest() == null) {
      throw new NullPointerException();
    }
    exchange.getRequest().setResponse(response);
  }
}

代码示例来源:origin: org.github.leshan/leshan-client

@Override
  public void deliverResponse(final Exchange exchange, final Response response) {
    if (response == null) {
      throw new NullPointerException();
    }
    if (exchange == null) {
      throw new NullPointerException();
    }
    if (exchange.getRequest() == null) {
      throw new NullPointerException();
    }
    exchange.getRequest().setResponse(response);
  }
}

代码示例来源:origin: eclipse/californium

@Override
  public void sendResponse(Response response) {
    // Redirect the response to the HttpStack instead of a normal
    // CoAP endpoint.
    // TODO: When we change endpoint to be an interface, we can
    // redirect the responses a little more elegantly.
    try {
      request.setResponse(response);
      responseProduced(request, response);
      httpStack.doSendResponse(request, response);
      LOGGER.info("HTTP returned " + response);
    } catch (Exception e) {
      LOGGER.log(Level.WARNING, "Exception while responding to Http request", e);
    }
  }
};

代码示例来源:origin: org.eclipse.californium/californium-proxy

@Override
  public void sendResponse(Response response) {
    // Redirect the response to the HttpStack instead of a normal
    // CoAP endpoint.
    // TODO: When we change endpoint to be an interface, we can
    // redirect the responses a little more elegantly.
    try {
      request.setResponse(response);
      responseProduced(request, response);
      httpStack.doSendResponse(request, response);
    } catch (Exception e) {
      LOGGER.log(Level.WARNING, "Exception while responding to Http request", e);
    }
  }
};

代码示例来源:origin: eclipse/californium

boolean processed = preDeliverResponse(exchange, response);
if (!processed) {
  exchange.getRequest().setResponse(response);

相关文章