Examples of Sender


Examples of edu.pitt.dbmi.nlp.noble.util.Sender

  /**
   * TextTools located on a server (forward to some implementation)
   * @param remote servlet
   */
  public TextTools(URL servlet){
    sender = new Sender(servlet);
  }
View Full Code Here

Examples of edu.pitt.terminology.util.Sender

  /**
   * TextTools located on a server (forward to some implementation)
   * @param remote servlet
   */
  public TextTools(URL servlet){
    sender = new Sender(servlet);
  }
View Full Code Here

Examples of evolaris.framework.smsservices.datamodel.Sender

    long[] sourceSenderIds = f.getSourceSenderIds();
    if (sourceSenderIds != null){  // at least one mapping
      long[] selectedSenderIds = f.getSelectedSenderIds();
      for (int i = 0; i < sourceSenderIds.length; i++){
        long sourceSenderId = sourceSenderIds[i];
        Sender sourceSender = senderManager.getSmsSenderById(sourceSenderId);
        if (sourceSender == null){
          throw new InputException(getResources(req).getMessage(locale, "smssvc.SourceSenderNotAvailableAnymore"),"sender #" + sourceSenderId + " not found",null,null);
        }
        if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && !senderManager.isValidForGroup(sourceSender,webUser.getGroup())) {
          throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
        }
        long selectedSenderId = selectedSenderIds[i];
        if (selectedSenderId >= 1){  // mapping entry => assign; no entry => add to group
          Sender selectedSender = senderManager.getSmsSenderById(selectedSenderId);
          if (selectedSender == null){
            throw new InputException(getResources(req).getMessage(locale, "smssvc.SelectedSenderNotAvaliableAnymore"),"sender #" + selectedSenderId + " not found",null,null);
          }
          if (!req.isUserInRole(UserManagerBase.ADMINISTRATOR) && !senderManager.isValidForGroup(selectedSender,webUser.getGroup())) {
            throw new InputException(getResources(req).getMessage(locale, "smssvc.insufficientRights"));
View Full Code Here

Examples of hudson.plugins.im.Sender

    public void onMessage(IMMessage msg) {
        // is it a command for me ? (returns null if not, the payload if so)
        String payload = retrieveMessagePayLoad(msg.getBody());
        if (payload != null) {
            Sender s = getSender(msg);
         
          try {
              if (!this.commandsAccepted) {
                  this.chat.sendMessage(s.getNickname() + " you may not issue bot commands in this chat!");
                  return;
              } else if (!msg.isAuthorized()) {
            this.chat.sendMessage(s.getNickname() + " you're not a buddy of me. I won't take any commands from you!");
            return;
              }
          } catch (IMException e) {
                LOGGER.warning(ExceptionHelper.dump(e));
                return;
            }
         
            // split words
            String[] args = MessageHelper.extractCommandLine(payload);
            if (args.length > 0) {
                // first word is the command name
                String cmd = args[0];
               
                try {
                  BotCommand command = this.cmdsAndAliases.get(cmd);
                    if (command != null) {
                      Authentication oldAuthentication = SecurityContextHolder.getContext().getAuthentication();
                      try {
                          if (this.authentication != null) {
                              SecurityContextHolder.getContext().setAuthentication(this.authentication.getAuthentication());
                          }
                        command.executeCommand(this, this.chat, msg, s, args);
                      } finally {
                          if (this.authentication != null) {
                              SecurityContextHolder.getContext().setAuthentication(oldAuthentication);
                          }
                      }
                    } else {
                        this.chat.sendMessage(s.getNickname() + " did you mean me? Unknown command '" + cmd
                                + "'\nUse '" + this.commandPrefix + " help' to get help!");
                    }
                } catch (IMException e) {
                    LOGGER.warning(ExceptionHelper.dump(e));
                }
View Full Code Here

Examples of io.undertow.io.Sender

            return;
        }
        final DirectBufferCache.CacheEntry existing = dataCache.get(cacheKey);
        //it is not cached yet, install a wrapper to grab the data
        if (existing == null || !existing.enabled() || !existing.reference()) {
            Sender newSender = sender;

            final DirectBufferCache.CacheEntry entry;
            if (existing == null) {
                entry = dataCache.add(cacheKey, length.intValue());
            } else {
View Full Code Here

Examples of io.undertow.io.Sender

            return;
        }
        final DirectBufferCache.CacheEntry existing = dataCache.get(cacheKey);
        //it is not cached yet, install a wrapper to grab the data
        if (existing == null || !existing.enabled() || !existing.reference()) {
            Sender newSender = sender;

            final DirectBufferCache.CacheEntry entry;
            if (existing == null) {
                entry = dataCache.add(cacheKey, length.intValue());
            } else {
View Full Code Here

Examples of io.undertow.io.Sender

                Set<Integer> codes = responseCodes;
                if (codes == null ? exchange.getResponseCode() >= 400 : codes.contains(Integer.valueOf(exchange.getResponseCode()))) {
                    final String errorPage = "<html><head><title>Error</title></head><body>" + exchange.getResponseCode() + " - " + StatusCodes.getReason(exchange.getResponseCode()) + "</body></html>";
                    exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, "" + errorPage.length());
                    exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html");
                    Sender sender = exchange.getResponseSender();
                    sender.send(errorPage);
                    return true;
                }
                return false;
            }
        });
View Full Code Here

Examples of io.undertow.io.Sender

            underlyingResource.serve(sender, exchange, completionCallback);
            return;
        }
        //it is not cached yet, install a wrapper to grab the data
        if (existing == null || !existing.enabled() || !existing.reference()) {
            Sender newSender = sender;

            final DirectBufferCache.CacheEntry entry;
            if (existing == null) {
                entry = dataCache.add(cacheKey, length.intValue(), cachingResourceManager.getMaxAge());
            } else {
View Full Code Here

Examples of net.sf.saxon.event.Sender

    public boolean sendSource(Source source, Receiver receiver, PipelineConfiguration pipe) throws XPathException {
        if (source instanceof DOMSource) {
            Node startNode = ((DOMSource)source).getNode();
            if (startNode instanceof NodeOverNodeInfo) {
                NodeInfo base = ((NodeOverNodeInfo)startNode).getUnderlyingNodeInfo();
                Sender driver = new Sender(pipe);
                driver.send(base, receiver, null);
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of net.sf.xbus.technical.Sender

  static public void callSender(Message message, XBUSSystem destination)
      throws XException
  {
    try
    {
      Sender sender = SenderFactory.createSender(destination);

      String senderType = Configuration.getInstance().getValueOptional(
          "System", destination.getName(), "Type");
      if (senderType == null)
      {
        senderType = sender.getType();
      }

      if (Constants.TYPE_TEXT.equals(senderType))
      {
        boolean sendMessage = true;
        String request = ((TextMessage) message)
            .getRequestText(destination);
        if (isEmpty(request))
        {
          String onEmpty = retrieveOnEmpty(destination.getName(),
              true);
          if (onEmpty.equals(Constants.READ_IGNORE))
          {
            sendMessage = false;
          }
          else if (onEmpty.equals(Constants.READ_PROCESS))
          {
            sendMessage = true;
          }
          else if (onEmpty.equals(Constants.READ_ERROR))
          {
            throw new XException(Constants.LOCATION_EXTERN,
                Constants.LAYER_APPLICATION,
                Constants.PACKAGE_APPLICATION_ADAPTER, "4");
          }
        }

        if (sendMessage)
        {
          // Send the message to the destination system
          // The message is already transformed and must only be
          // retrieved.
          // Structure information for message serialisation is due to
          // the
          // destination system.
          TextSender textsender = (TextSender) sender;

          String resData = textsender.execute(message.getFunction(),
              request);

          ((TextMessage) message).setResponseText(resData,
              destination);
          message.setResponseTimestamp(new Date());
        }
      }
      else if (Constants.TYPE_OBJECT.equals(senderType))
      {
        boolean sendMessage = true;
        Object request = ((ObjectMessage) message)
            .getRequestObject(destination);
        if (isEmpty(request))
        {
          String onEmpty = retrieveOnEmpty(destination.getName(),
              true);
          if (onEmpty.equals(Constants.READ_IGNORE))
          {
            sendMessage = false;
          }
          else if (onEmpty.equals(Constants.READ_PROCESS))
          {
            sendMessage = true;
          }
          else if (onEmpty.equals(Constants.READ_ERROR))
          {
            throw new XException(Constants.LOCATION_EXTERN,
                Constants.LAYER_APPLICATION,
                Constants.PACKAGE_APPLICATION_ADAPTER, "4");
          }
        }

        if (sendMessage)
        {
          // Send the message to the destination system
          // The message is already transformed and must only be
          // retrieved.
          // Structure information for message serialisation is due to
          // the
          // destination system.
          ObjectSender objectsender = (ObjectSender) sender;

          Object resData = objectsender.execute(
              message.getFunction(), ((ObjectMessage) message)
                  .getRequestObject(destination));

          ((ObjectMessage) message).setResponseObject(resData,
              destination);
          message.setResponseTimestamp(new Date());
        }
      }
      else if (Constants.TYPE_XML.equals(senderType))
      {
        boolean sendMessage = true;
        Object request = ((ObjectMessage) message)
            .getRequestObject(destination);
        if (isEmpty(request))
        {
          String onEmpty = retrieveOnEmpty(destination.getName(),
              true);
          if (onEmpty.equals(Constants.READ_IGNORE))
          {
            sendMessage = false;
          }
          else if (onEmpty.equals(Constants.READ_PROCESS))
          {
            sendMessage = true;
          }
          else if (onEmpty.equals(Constants.READ_ERROR))
          {
            throw new XException(Constants.LOCATION_EXTERN,
                Constants.LAYER_APPLICATION,
                Constants.PACKAGE_APPLICATION_ADAPTER, "4");
          }
        }

        if (sendMessage)
        {
          // Send the message to the destination system
          // The message is already transformed and must only be
          // retrieved.
          ObjectSender objectsender = (ObjectSender) sender;

          Document resData = (Document) objectsender.execute(message
              .getFunction(), ((XMLMessage) message)
              .getRequestDocument(destination));

          ((XMLMessage) message).setResponseDocument(resData,
              destination);
          message.setResponseTimestamp(new Date());
        }
      }
      else
      {
        List params = new Vector();
        params.add(sender.getType());
        throw new XException(Constants.LOCATION_INTERN,
            Constants.LAYER_APPLICATION,
            Constants.PACKAGE_APPLICATION_ADAPTER, "1", params);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.