Package at.molindo.notify.channel

Examples of at.molindo.notify.channel.IPullChannel$PullException


    if (StringUtils.empty(userId) || StringUtils.empty(channelId)) {
      response.sendError(404);
      return;
    }

    IPullChannel channel = getChannel(channelId);
    if (channel == null) {
      response.sendError(404);
      return;
    }

    IChannelPreferences prefs = channel.newDefaultPreferences();
    if (prefs instanceof IRequestConfigurable) {
      try {
        Map<?, ?> queryParams = request.getParameterMap();

        for (Map.Entry<?, ?> e : queryParams.entrySet()) {
          Object value = e.getValue();
          if (value != null && value.getClass().isArray()) {
            String[] vals = (String[]) value;
            value = vals.length > 0 ? vals[0] : null;
          }
          ((IRequestConfigurable) prefs).setParam((String) e.getKey(), (String) value);
        }
      } catch (NotifyException e) {
        response.sendError(404);
        return;
      }
    }

    if (channel.getNotificationTypes().contains(Type.PRIVATE) && !channel.isAuthorized(userId, prefs)) {
      response.sendError(403);
    } else if (channel.isConfigured(new Params(prefs.getParams()))) {
      try {
        String output = channel.pull(userId, prefs);
        if (StringUtils.empty(output)) {
          response.sendError(404);
        } else {
          response.getWriter().write(output);
        }
View Full Code Here


    return _channels.get(channelId);
  }

  @Override
  public String toPullPath(String channelId, String userId, IParams params) {
    IPullChannel channel = getChannel(channelId);
    if (channel == null) {
      return null;
    }

    IChannelPreferences cPrefs = channel.newDefaultPreferences();

    IParams fullParams = new Params().setAll(cPrefs.getParams()).setAll(params);

    StringBuilder buf = new StringBuilder(_baseUrl);
    buf.append(_mountPath).append(_pullPrefix).append(channelId).append("/").append(userId);
View Full Code Here

TOP

Related Classes of at.molindo.notify.channel.IPullChannel$PullException

Copyright © 2018 www.massapicom. 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.