org.restlet.data.Status.isConnectorError()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(114)

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

Status.isConnectorError介绍

[英]Indicates if the status is a connector error status, meaning "The connector failed to send or receive an apparently valid message".
[中]指示状态是否为连接器错误状态,表示“连接器未能发送或接收明显有效的消息”。

代码示例

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Indicates if the status is a connector error status, meaning "The
 * connector failed to send or receive an apparently valid message".
 * 
 * @return True if the status is a connector error status.
 */
public boolean isConnectorError() {
  return isConnectorError(getCode());
}

代码示例来源:origin: org.restlet/org.restlet

/**
 * Indicates if the status is a connector error status, meaning "The
 * connector failed to send or receive an apparently valid message".
 * 
 * @return True if the status is a connector error status.
 */
public boolean isConnectorError() {
  return isConnectorError(getCode());
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Indicates if the status is a connector error status, meaning "The
 * connector failed to send or receive an apparently valid message".
 * 
 * @return True if the status is a connector error status.
 */
public boolean isConnectorError() {
  return isConnectorError(getCode());
}

代码示例来源:origin: org.restlet/org.restlet

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @param code
 *            The code of the status.
 * @return True if the status is an error (client or server) status.
 */
public static boolean isError(int code) {
  return isClientError(code) || isServerError(code)
      || isConnectorError(code);
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @param code
 *            The code of the status.
 * @return True if the status is an error (client or server) status.
 */
public static boolean isError(int code) {
  return isClientError(code) || isServerError(code)
      || isConnectorError(code);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @param code
 *            The code of the status.
 * @return True if the status is an error (client or server) status.
 */
public static boolean isError(int code) {
  return isClientError(code) || isServerError(code)
      || isConnectorError(code) || isGlobalError(code);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Indicates if an error is recoverable, meaning that simply retrying after
 * a delay could result in a success. Tests {@link #isConnectorError()} and
 * if the status is {@link #CLIENT_ERROR_REQUEST_TIMEOUT} or
 * {@link #SERVER_ERROR_GATEWAY_TIMEOUT} or
 * {@link #SERVER_ERROR_SERVICE_UNAVAILABLE}.
 * 
 * @return True if the error is recoverable.
 */
public boolean isRecoverableError() {
  return isConnectorError()
      || equals(Status.CLIENT_ERROR_REQUEST_TIMEOUT)
      || equals(Status.SERVER_ERROR_GATEWAY_TIMEOUT)
      || equals(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Indicates if an error is recoverable, meaning that simply retrying after
 * a delay could result in a success. Tests {@link #isConnectorError()} and
 * if the status is {@link #CLIENT_ERROR_REQUEST_TIMEOUT} or
 * {@link #SERVER_ERROR_GATEWAY_TIMEOUT} or
 * {@link #SERVER_ERROR_SERVICE_UNAVAILABLE}.
 * 
 * @return True if the error is recoverable.
 */
public boolean isRecoverableError() {
  return isConnectorError()
      || equals(Status.CLIENT_ERROR_REQUEST_TIMEOUT)
      || equals(Status.SERVER_ERROR_GATEWAY_TIMEOUT)
      || equals(Status.SERVER_ERROR_SERVICE_UNAVAILABLE);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

if (status.isServerError()) {
  level = Level.WARNING;
} else if (status.isConnectorError()) {
  level = Level.INFO;
} else if (status.isClientError()) {

代码示例来源:origin: org.restlet.jee/org.restlet.ext.platform

if (e.getStatus().isConnectorError()) {
  throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e);
} else if (e.getStatus().isClientError()) {

代码示例来源:origin: org.restlet.osgi/org.restlet.ext.platform

if (e.getStatus().isConnectorError()) {
  throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e);
} else if (e.getStatus().isClientError()) {

代码示例来源:origin: org.restlet.gae/org.restlet.ext.platform

if (e.getStatus().isConnectorError()) {
  throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e);
} else if (e.getStatus().isClientError()) {

代码示例来源:origin: org.restlet.jee/org.restlet.ext.apispark

if (e.getStatus().isConnectorError()) {
  throw new RuntimeException("APISpark communication error. Please check the root cause below.", e);
} else if (e.getStatus().isClientError()) {

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Invoked when an error or an exception is caught during initialization,
 * handling or releasing. By default, updates the responses's status with
 * the result of {@link org.restlet.service.StatusService#toStatus(Throwable, Resource)}.
 * 
 * @param throwable
 *            The caught error or exception.
 */
protected void doCatch(Throwable throwable) {
  Level level = Level.INFO;
  Status status = getStatusService().toStatus(throwable, this);
  if (status.isServerError()) {
    level = Level.SEVERE;
  } else if (status.isConnectorError()) {
    level = Level.INFO;
  } else if (status.isClientError()) {
    level = Level.FINE;
  }
  getLogger().log(level, "Exception or error caught in server resource",
      throwable);
  if (getResponse() != null) {
    getResponse().setStatus(status);
    Representation errorEntity = getStatusService().toRepresentation(
        status, this);
    getResponse().setEntity(errorEntity);
  }
}

代码示例来源:origin: org.restlet.jse/org.restlet.ext.platform

if (e.getStatus().isConnectorError()) {
  throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e);
} else if (e.getStatus().isClientError()) {

相关文章