Handles the tracker announce response message.

<p>
Verifies the transaction ID of the message before passing it over to
{@link Announce#()}.
</p>

@param message The message received from the tracker in response to the
announce request.
558911
@Override
  protected void handleTrackerAnnounceResponse(TrackerMessage message,
                                               boolean inhibitEvents, String hexInfoHash) throws AnnounceException {
    this.validateTrackerResponse(message);
    super.handleTrackerAnnounceResponse(message, inhibitEvents, hexInfoHash);
  }
170834
private void doQueueElement(final Message<JsonObject> message) {
    final String name = message.body().getString("name");
    if (name == null) {
      message.reply(new JsonObject().putString("status", "error").putString("message", "No name specified."));
      return;
    }

    context.execute(new Action<Object>() {
      @Override
      public Object perform() {
        return data.getQueue(formatKey(name)).element();
      }
    }, new Handler<AsyncResult<Object>>() {
      @Override
      public void handle(AsyncResult<Object> result) {
        if (result.failed()) {
          message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
        } else {
          message.reply(new JsonObject().putString("status", "ok").putValue("result", result.result()));
        }
      }
    });
  }
1241947
public void info(final String message) {
        messages.add(new LogMessage(message, LogMessage.Type.INFO));
        log.info(message);
    }
209289
public static void pass(String message) {
        if (Boolean.getBoolean("visibleassertions.silence") || Boolean.getBoolean("visibleassertions.silence.passes")) {
            return;
        }
        System.out.println("        " + green(TICK_MARK + " " + message));
    }
983992
public void setMessage(String message) {
        requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty.");
        this.message = message;
    }
558579
@Override
    public void handleMessage(Message message) throws Fault {

        //ignore the messages from SAM Server service itself
        BindingOperationInfo boi = message.getExchange().getBindingOperationInfo();
        if (null != boi){
            String operationName = boi.getName().toString();
            if (SAM_OPERATION.equals(operationName)) {
                return;
            }
        }

        if (isRestWadlRequest(message)) {
            // skip handling REST service WADL requests - temporary fix since will be fixed in CXF soon
            return;
        }

        if (isOnewayResponse(message)) {
            // skip oneway response events
            return;
        }

        // Skip Swagger UI web static, swagger.json and swagger.yaml requests
        if (isSwaggerResourceRequest(message)) {
            return;
        }

        //check MessageID
        checkMessageID(message);

        Event event = mapper.mapToEvent(message);

        if (LOG.isLoggable(Level.FINE)) {
            String id = (event.getMessageInfo() != null) ? event.getMessageInfo().getMessageId() : null;
            LOG.fine("Store event [message_id=" + id + "] in cache.");
        }
        if (null != event) {
            queue.add(event);
        }

        // TESB-20624 skip duplicated event processing
        message.getInterceptorChain().remove(this);
    }
560461
public final void trace(Object message) {

        if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
            log(SimpleLog.LOG_LEVEL_TRACE, message, null);
        }
    }
624829
public void sendMessage(Message message)
    {
        try   {
            if (((RemoteMessageQueue)this.getMessageQueue()).isSendRemoteMessage((BaseMessage)message) == false)
                return;
            if (((BaseMessage)message).isProcessedByServer())
                return;     // Don't send back down (the server already processed it).
            if (((BaseMessage)message).isConsumed())
                return;     // Don't send if already handled.
            if (MessageConstants.LOCAL_QUEUE.equalsIgnoreCase(((BaseMessage)message).getMessageHeader().getQueueType()))
                return;     // Local queue only
            synchronized (m_sendQueue)
            {   // In case this is called from another task
                m_sendQueue.sendMessage(message);
            }
        } catch (RemoteException ex)    {
            ex.printStackTrace();
        }
    }
166575
@Override
    @SuppressWarnings("unchecked")
    public void onMessage(StreamMessage message)
    {
        String endopointUri = getEndpointUri();

        Map<String, Object> resultMap;

        try
        {
            resultMap = this.converter.toMap(message);
        }
        catch (ConvertFailException ex)
        {
            String logFormat = "Fail convert to jdbc record. Dispose received message. : Message={0}";
            logger.warn(MessageFormat.format(logFormat, message), ex);
            ack();
            return;
        }

        List<Object> valueList = Lists.newArrayList();

        valueList.add(resultMap.get("messageId"));
        valueList.add(resultMap.get("timestamp"));
        valueList.add(resultMap.get("source"));

        List<String> bodyList = (List<String>) resultMap.get("body");

        valueList.addAll(bodyList);

        insert(endopointUri, valueList);
        ack();
    }
949509
@Override
    public void sendMsg(Message message) {
        try {
            message.setSender(this.getID());
            ShanksAgent receiver = this.simulation.getAgent(message
                    .getReceiver());
            receiver.putMessegaInInbox(message);
            logger.finer("Sent message from Agent: " + this.getID()
                    + " to Agent: " + message.getReceiver());
        } catch (UnkownAgentException e) {
            logger.severe("UnkownAgentException: " + e.getMessage());
            e.printStackTrace();
        } catch (ShanksException e) {
            e.printStackTrace();
        }
    }
248749
public CallActivityMock onExecutionSendMessage(final String message) {
    return onExecutionDo(execution -> execution.getProcessEngineServices()
      .getRuntimeService().correlateMessage(message));
  }
152329
public static void warn(String message) {
        if (Boolean.getBoolean("visibleassertions.silence")) {
            return;
        }

        System.out.println("        " + yellow(bright(WARN_MARK + " " + message)));
    }
828801
public void setMessage(CharSequence message){
        if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
            TextView msgView = (TextView) getDialog().findViewById(R.id.message);
            msgView.setText(message);
        }else{
            if(mMessage != null){
                mMessage.setText(message);
            }
        }
    }
118671
public ApiFuture<String> publish(String message) {
    ByteString data = ByteString.copyFromUtf8(message);
    PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();
    ApiFuture<String> messageIdFuture = publisher.publish(pubsubMessage);
    ApiFutures.addCallback(
        messageIdFuture,
        new ApiFutureCallback<String>() {
          public void onSuccess(String messageId) {
            System.out.println("published with message id: " + messageId);
          }

          public void onFailure(Throwable t) {
            System.out.println("failed to publish: " + t);
          }
        },
        Executors.newSingleThreadExecutor());
    return messageIdFuture;
  }
506031
public void deliver(final byte[] message) {
    synchronized (this.heartBeatManager) {
      if (this.currentStatus.isNotRunning()) {
        LOG.log(Level.WARNING,
            "Trying to send a message to a task that is in state: {0}. Ignoring.",
            this.currentStatus.getState());
      } else {
        try {
          this.deliverMessageToTask(message);
        } catch (final TaskMessageHandlerFailure taskMessageHandlerFailure) {
          LOG.log(Level.WARNING, "Exception while executing task close handler.",
              taskMessageHandlerFailure.getCause());
          this.currentStatus.setException(taskMessageHandlerFailure.getCause());
        }
      }
    }
  }
670723
public void trace(Object message) {
        log(Level.FINEST, String.valueOf(message), null);
    }
653400
private void handleOutgoingMessage(MessageEnvelope message) {
		methodMapCatchAll = new ArrayList<FbBotClassMethod>();
		boolean isAuthorized = false;
		for (BotDefinition defClass : ConfigurationUtils.getBotDefinitionInstances()) {

			if (defClass.getClass().isAnnotationPresent(Bot.class)) {
				Bot botClass = defClass.getClass().getAnnotation(Bot.class);
				if (botClass.state().equals(BotBeanState.PROTOTYPE)) {
					try {
						defClass = defClass.getClass().newInstance();
					} catch (InstantiationException e) {
						e.printStackTrace();
					} catch (IllegalAccessException e) {
						e.printStackTrace();
					}
				}

				// Check authorization first.
				boolean authorizationFound = false;
				for (Method authorizationMethod : defClass.getClass().getMethods()) {
					if (authorizationMethod.isAnnotationPresent(BotAuthorization.class)) {
						authorizationFound = true;
						Boolean ob = false;
						try {

							defClass.getClass().getSuperclass()
									.getDeclaredMethod(CONST_INCOMING_MSG_SETNAME, MessageEnvelope.class)
									.invoke(defClass, message);

							ob = (Boolean) authorizationMethod.invoke(defClass, message);

						} catch (IllegalArgumentException e) {
							e.printStackTrace();
						} catch (IllegalAccessException e) {
							e.printStackTrace();
						} catch (InvocationTargetException e) {
							e.printStackTrace();
						} catch (SecurityException e) {
							e.printStackTrace();
						} catch (NoSuchMethodException e) {
							e.printStackTrace();
						}
						if (ob) {
							isAuthorized = true;
							break;
						}
					}
				}
				
				if(!authorizationFound) {
					isAuthorized = true;
				}


				// if (isAuthorized) {
				for (Method method : defClass.getClass().getMethods()) {

					if (method.isAnnotationPresent(FbBotMillController.class)) {
						FbBotMillController botMillController = method.getAnnotation(FbBotMillController.class);
						if (isAuthorized || botMillController.skipAuthorization()) {
							try {
								if (botMillController.pattern().equals(".*.")
										|| botMillController.eventType().equals(FbBotMillEventType.ANY)) {
									FbBotClassMethod fbCm = new FbBotClassMethod();
									fbCm.setCls(defClass);
									fbCm.setMethod(method);
									methodMapCatchAll.add(fbCm);
								} else {
									FbBotMillEvent event = toEventActionFrame(botMillController);
									if (event.verifyEventCondition(message)) {

										defClass.getClass().getSuperclass()
												.getDeclaredMethod(CONST_INCOMING_MSG_SETNAME, MessageEnvelope.class)
												.invoke(defClass, message);

										defClass.getClass().getSuperclass()
												.getDeclaredMethod(CONST_EVENT_SETNAME, FbBotMillEvent.class)
												.invoke(defClass, event);

										FbBotApi.setFbBot(defClass);

										method.invoke(defClass, message);
										return;
									}
								}
							} catch (Exception e) {
								e.printStackTrace();
								return;
							}
						}
					}
				}
				// }
			}
		}

		// Run the catch all last. This is to ensure that every possible AI
		// logic within the source was
		// scanned and considered.
		// if (isAuthorized) {
		synchronized (this) {
			for (FbBotClassMethod catchAllMethod : methodMapCatchAll) {
				if (catchAllMethod.getMethod().isAnnotationPresent(FbBotMillController.class)) {
					FbBotMillController botMillController = catchAllMethod.getMethod()
							.getAnnotation(FbBotMillController.class);
					if (isAuthorized || botMillController.skipAuthorization()) {
						try {

							FbBotMillEvent event = toEventActionFrame(botMillController);
							if (event.verifyEventCondition(message)) {

								catchAllMethod.getCls().getClass().getSuperclass()
										.getDeclaredMethod(CONST_INCOMING_MSG_SETNAME, MessageEnvelope.class)
										.invoke(catchAllMethod.getCls(), message);

								catchAllMethod.getCls().getClass().getSuperclass()
										.getDeclaredMethod(CONST_EVENT_SETNAME, FbBotMillEvent.class)
										.invoke(catchAllMethod.getCls(), event);

								FbBotApi.setFbBot(catchAllMethod.getCls());
								catchAllMethod.getMethod().invoke(catchAllMethod.getCls(), message);
								return;

							}
						} catch (Exception e) {
							e.printStackTrace();
							return;
						}
					}
				}
			}
		}
		// }
	}