Validates an incoming tracker message.

<p>
Verifies that the message is not an error message (throws an exception
with the error message if it is) and that the transaction ID matches the
current one.
</p>

@param message The incoming tracker message.
327004
private void validateTrackerResponse(TrackerMessage message)
          throws AnnounceException {
    if (message instanceof ErrorMessage) {
      throw new AnnounceException(((ErrorMessage) message).getReason());
    }

    if (message instanceof UDPTrackerMessage &&
            (((UDPTrackerMessage) message).getTransactionId() != this.transactionId)) {
      throw new AnnounceException("Invalid transaction ID!");
    }
  }
504388
public void trace(Object message) {
        differentiatedLog(null, LOGGER_FQCN, LocationAwareLogger.TRACE_INT, message, null);
    }
673059
@Override public void addError(String message) {
		ast.printMessage(Diagnostic.Kind.ERROR, message, this, null, true);
	}
868358
public static void assertTrue(boolean condition, String message) {
		if (imp != null && !condition) {
			imp.assertFailed(message);
		}
	}
1307119
private boolean okayToSendMessage(IRTMPEvent message) {
        if (message instanceof IStreamData) {
            final long now = System.currentTimeMillis();
            // check client buffer size
            if (isClientBufferFull(now)) {
                return false;
            }
            // get pending message count
            long pending = pendingMessages();
            if (bufferCheckInterval > 0 && now >= nextCheckBufferUnderrun) {
                if (pending > underrunTrigger) {
                    // client is playing behind speed, notify him
                    sendInsufficientBandwidthStatus(currentItem.get());
                }
                nextCheckBufferUnderrun = now + bufferCheckInterval;
            }
            // check for under run
            if (pending > underrunTrigger) {
                // too many messages already queued on the connection
                return false;
            }
            return true;
        } else {
            String itemName = "Undefined";
            // if current item exists get the name to help debug this issue
            if (currentItem.get() != null) {
                itemName = currentItem.get().getName();
            }
            Object[] errorItems = new Object[] { message.getClass(), message.getDataType(), itemName };
            throw new RuntimeException(String.format("Expected IStreamData but got %s (type %s) for %s", errorItems));
        }
    }
617515
public static void checkNotEmpty(@Nullable String value, @NonNull String message) {
        if (value == null) {
            throw new NullPointerException(message);
        } else if (value.length() == 0) {
            throw new IllegalStateException(message);
        }
    }
816150
public void log(final String message) {
		if (!SwingUtilities.isEventDispatchThread()) {
			SwingUtilities.invokeLater(new Runnable() {
				@Override
				public void run() {
					log(message);
				}
			});
		} else {
			log.append(message);
		}
	}
855566
private void notifyStatus(SmsMessage message) {
        URI callback = message.getStatusCallback();
        if (callback != null) {
            String method = message.getStatusCallbackMethod();
            if (method != null && !method.isEmpty()) {

                if (!org.apache.http.client.methods.HttpGet.METHOD_NAME.equalsIgnoreCase(method)
                        && !org.apache.http.client.methods.HttpPost.METHOD_NAME.equalsIgnoreCase(method)) {
                    final Notification notification = notification(WARNING_NOTIFICATION, 14104, method
                            + " is not a valid HTTP method for <Sms>");
                    storage.getNotificationsDao().addNotification(notification);
                    method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
                }
            } else {
                method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
            }


            List<NameValuePair> parameters = populateReqParams(message);
            HttpRequestDescriptor request = new HttpRequestDescriptor(callback, method, parameters);
            downloader().tell(request, self());

        }
    }
1029209
public void setMessage(String message) {
        this.message = message;
        if (errorMessage == null) {
            logger.debug("Setting status bar message to \"" + message + "\"");
            messageLabel.setText(this.message);
        }
    }
333997
void validateAndPrepare(Message message, Address[] addresses) throws MessagingException {
        if (message.getFrom() == null || message.getFrom().length == 0) {
            fail(message, addresses, "No or empty FROM address set!");
        }
        if (addresses.length == 0) {
            fail(message, addresses, "No RECIPIENTS set!");
        }
        Address[] messageAddresses = message.getAllRecipients();
        if (messageAddresses == null) {
            for(Address address : addresses) {
                message.addRecipient(Message.RecipientType.TO, address);
            }
        } else {
            out:
            for(Address address : addresses) {
                for(Address a : messageAddresses) {
                    if (a == null) {
                        continue;
                    }
                    if (a.equals(address)) {
                        continue out;
                    }
                }
                message.addRecipient(Message.RecipientType.TO, address);
            }
        }
    }
1160626
private void handleTrackerConnectResponse(TrackerMessage message)
          throws AnnounceException {
    this.validateTrackerResponse(message);

    if (!(message instanceof ConnectionResponseMessage)) {
      throw new AnnounceException("Unexpected tracker message type " +
              message.getType().name() + "!");
    }

    UDPConnectResponseMessage connectResponse =
            (UDPConnectResponseMessage) message;

    this.connectionId = connectResponse.getConnectionId();
    Calendar now = Calendar.getInstance();
    now.add(Calendar.MINUTE, 1);
    this.connectionExpiration = now.getTime();
  }
788578
private void checkMessageID(Message message) {
        if (!MessageUtils.isOutbound(message)) return;

        AddressingProperties maps =
                ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message));
        if (maps == null) {
            maps = new AddressingProperties();
        }
        if (maps.getMessageID() == null) {
            String messageID = ContextUtils.generateUUID();
            boolean isRequestor = ContextUtils.isRequestor(message);
            maps.setMessageID(ContextUtils.getAttributedURI(messageID));
            ContextUtils.storeMAPs(maps, message, ContextUtils.isOutbound(message), isRequestor);
        }
    }
1218449
public void javacError(String message, Throwable t) {
		messager.printMessage(Diagnostic.Kind.ERROR, message + (t == null ? "" : (": " + t)));
		if (t != null) t.printStackTrace();
	}
680370
void logError(final String message) {
      if(logger != null) {
         try {
            StringBuilder buf = new StringBuilder(name);
            buf.append(":");
            buf.append(message);
            logger.error(buf.toString());            
         } catch(Throwable t) {
            //Ignore - logging should not kill anything
         }
      }
   }
1070915
public Result check(IMessage message) {
    if (message == null) {
      throw new IllegalArgumentException("Message is null");
    }
    if (!enable) {
      return SUCCESS;
    }
    // todo
    return null;
  }
639838
protected void validate(BasicMessageWithExtraData<REQ> envelope) {
        if (envelope.getBasicMessage().getResourceId() == null) {
            throw new IllegalArgumentException(
                    String.format("resourceId of a [%s] cannot be null", envelope.getClass().getName()));
        }
    }
1098116
@Override
    public void receiveMessage(VoidMessage message) {
        try {
            log.info("Message received, saving...");
            messages.put(message);
        } catch (Exception e) {
            // do nothing
        }
    }