Package at.molindo.notify.model

Examples of at.molindo.notify.model.IPushChannelPreferences


  }

  private void pushChannel(IPushChannel channel, IPreferences prefs, Notification notification,
      boolean ignoreFrequency) throws PushException, RenderException {

    IPushChannelPreferences cPrefs = prefs.getChannelPrefs().get(channel.getId());
    if (cPrefs == null) {
      cPrefs = channel.newDefaultPreferences();
      if (cPrefs == null) {
        // don't flood user after he configures this channel
        throw new PushException("channel not configured for user", false);
      }
    }

    if (!channel.getNotificationTypes().contains(notification.getType())) {
      // channel not applicable for type
      throw new PushException("channel not applicable for type " + notification.getType(), false);
    }

    Dispatch dispatch = _dispatchService.create(notification, prefs, cPrefs);

    if (!channel.isConfigured(dispatch.getParams())) {
      // don't flood user after he configures this channel
      throw new PushException("channel not configured for user", false);
    }

    if (!ignoreFrequency && !Frequency.INSTANT.equals(cPrefs.getFrequency())) {
      // temporary as other dispatcher will handle this
      throw new PushException("channel not configured for this frequency", true);
    }

    channel.push(dispatch);
View Full Code Here


  @Override
  public Map<String, IPushChannelPreferences> newDefaultPreferences() {
    Map<String, IPushChannelPreferences> map = Maps.newHashMap();
    for (IPushChannel channel : _pushChannels) {
      IPushChannelPreferences cPrefs = channel.newDefaultPreferences();
      if (cPrefs != null) {
        map.put(channel.getId(), cPrefs);
      }
    }
    return map;
View Full Code Here

TOP

Related Classes of at.molindo.notify.model.IPushChannelPreferences

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.