Esempio n. 1
0
  @Override
  public synchronized String getStatusHtml() {
    StringBuilder buf = new StringBuilder();
    buf.append("Contact: " + status.name() + "<br/>");
    if (status == Status.ERROR) {
      buf.append("Last error: " + Formatter.formatLongDateTime(lastFailed) + "<br/>");
      buf.append("Error message: " + lastException.getMessage());
      if (lastException.getExtraMessage() != null) {
        buf.append(": " + lastException.getExtraMessage());
      }
    } else {
      buf.append("Last contact: " + Formatter.formatLongDateTime(lastContact));
    }

    return buf.toString();
  }
Esempio n. 2
0
 public synchronized void markContactError(ShoreServiceException e) {
   lastFailed = new Date();
   status = Status.ERROR;
   this.lastException = e;
   shortStatusText = "Last failed shore contact: " + Formatter.formatLongDateTime(lastFailed);
 }