private void handleSynonymousTermsAsk(Message message, SynonymousTermsAsk content) {
   TermInfos termInfos = relatedTermsService.getTermInfos(Arrays.asList(content.getTerm()));
   List<TermInfo> l = termInfos.getTermInfos();
   List<Term> terms = new ArrayList<Term>();
   for (TermInfo termInfo : l) {
     terms.add(termInfo.getTerm());
   }
   send(message.tell(new SynonymousTermsTell(terms)));
 }
Example #2
0
    @Override
    protected Message askUserAgentForAuthentication(Agent agent, Message loginMsg)
        throws TimeoutException {
      String login = ((LoginAsk) loginMsg.getContent()).getLogin();
      MessageContent tell = null;

      if (login.equals(TIMEOUT_LOGIN)) {
        throw new TimeoutException();
      } else if (login.equals(WRONG_LOGIN)) {
        tell = new ErrorNotify(ErrorConstants.LOGIN_WRONG_PASSWORD);
      } else {
        tell = getLoginTell(login);
      }

      Message message = loginMsg.tell(tell);

      return message;
    }