hudson.model.Messages.UpdateCenter_Status_ConnectionFailed()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(129)

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

Messages.UpdateCenter_Status_ConnectionFailed介绍

[英]<span class=error>Failed to connect to {0}. Perhaps you need to <a href="../pluginManager/advanced">configure HTTP proxy?</a></span>
[中]

代码示例

代码示例来源:origin: jenkinsci/jenkins

@Override
  public void run() {
    try {
      config.checkConnection(ConnectionCheckJob.this, connectionCheckUrl);
    } catch (Exception e) {
      if(e.getMessage().contains("Connection timed out")) {
        // Google can't be down, so this is probably a proxy issue
        connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.FAILED);
        statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl));
        return;
      }
    }
    connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.OK);
  }
});

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override
  public void run() {
    try {
      config.checkConnection(ConnectionCheckJob.this, connectionCheckUrl);
    } catch (Exception e) {
      if(e.getMessage().contains("Connection timed out")) {
        // Google can't be down, so this is probably a proxy issue
        connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.FAILED);
        statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl));
        return;
      }
    }
    connectionStates.put(ConnectionStatus.INTERNET, ConnectionStatus.OK);
  }
});

代码示例来源:origin: hudson/hudson-2.x

public void run() {
  LOGGER.fine("Doing a connectivity check");
  try {
    String connectionCheckUrl = site.getConnectionCheckUrl();
    if (connectionCheckUrl!=null) {
      statuses.add(Messages.UpdateCenter_Status_CheckingInternet());
      try {
        config.checkConnection(this, connectionCheckUrl);
      } catch (IOException e) {
        if(e.getMessage().contains("Connection timed out")) {
          // Google can't be down, so this is probably a proxy issue
          statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl));
          return;
        }
      }
    }
    statuses.add(Messages.UpdateCenter_Status_CheckingJavaNet());
    config.checkUpdateCenter(this, site.getUrl());
    statuses.add(Messages.UpdateCenter_Status_Success());
  } catch (UnknownHostException e) {
    statuses.add(Messages.UpdateCenter_Status_UnknownHostException(e.getMessage()));
    addStatus(e);
  } catch (IOException e) {
    statuses.add(Functions.printThrowable(e));
  }
}

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

public void run() {
  LOGGER.fine("Doing a connectivity check");
  try {
    String connectionCheckUrl = site.getConnectionCheckUrl();
    if (connectionCheckUrl != null) {
      statuses.add(Messages.UpdateCenter_Status_CheckingInternet());
      try {
        config.checkConnection(this, connectionCheckUrl);
      } catch (IOException e) {
        if (e.getMessage().contains("Connection timed out")) {
          // Google can't be down, so this is probably a proxy issue
          statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl));
          return;
        }
      }
    }
    statuses.add(Messages.UpdateCenter_Status_CheckingJavaNet());
    config.checkUpdateCenter(this, site.getUrl());
    statuses.add(Messages.UpdateCenter_Status_Success());
  } catch (UnknownHostException e) {
    statuses.add(Messages.UpdateCenter_Status_UnknownHostException(e.getMessage()));
    addStatus(e);
  } catch (IOException e) {
    statuses.add(Functions.printThrowable(e));
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public void run() {
  LOGGER.fine("Doing a connectivity check");
  try {
    String connectionCheckUrl = site.getConnectionCheckUrl();
    if (connectionCheckUrl!=null) {
      statuses.add(Messages.UpdateCenter_Status_CheckingInternet());
      try {
        config.checkConnection(this, connectionCheckUrl);
      } catch (IOException e) {
        if(e.getMessage().contains("Connection timed out")) {
          // Google can't be down, so this is probably a proxy issue
          statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl));
          return;
        }
      }
    }
    statuses.add(Messages.UpdateCenter_Status_CheckingJavaNet());
    config.checkUpdateCenter(this, site.getUrl());
    statuses.add(Messages.UpdateCenter_Status_Success());
  } catch (UnknownHostException e) {
    statuses.add(Messages.UpdateCenter_Status_UnknownHostException(e.getMessage()));
    addStatus(e);
  } catch (IOException e) {
    statuses.add(Functions.printThrowable(e));
  }
}

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

public void run() {
  LOGGER.fine("Doing a connectivity check");
  try {
    String connectionCheckUrl = site.getConnectionCheckUrl();
    if (connectionCheckUrl!=null) {
      statuses.add(Messages.UpdateCenter_Status_CheckingInternet());
      try {
        config.checkConnection(this, connectionCheckUrl);
      } catch (IOException e) {
        if(e.getMessage().contains("Connection timed out")) {
          // Google can't be down, so this is probably a proxy issue
          statuses.add(Messages.UpdateCenter_Status_ConnectionFailed(connectionCheckUrl));
          return;
        }
      }
    }
    statuses.add(Messages.UpdateCenter_Status_CheckingJavaNet());
    config.checkUpdateCenter(this, site.getUrl());
    statuses.add(Messages.UpdateCenter_Status_Success());
  } catch (UnknownHostException e) {
    statuses.add(Messages.UpdateCenter_Status_UnknownHostException(e.getMessage()));
    addStatus(e);
  } catch (IOException e) {
    statuses.add(Functions.printThrowable(e));
  }
}

相关文章

Messages类方法