Examples of SubscriptionType


Examples of com.opengamma.livedata.msg.SubscriptionType

  protected void handleSubscriptionRequest(Collection<SubscriptionHandle> subHandles) {
    ArgumentChecker.notEmpty(subHandles, "Subscription handle collection");
   
    // Determine common user and subscription type
    UserPrincipal user = null;
    SubscriptionType type = null;
   
    ArrayList<LiveDataSpecification> specs = new ArrayList<>();
    for (SubscriptionHandle subHandle : subHandles) {

      // TODO - as a LiveDataSpec is immutable, why do we copy rather than just use it?
      specs.add(new LiveDataSpecification(subHandle.getRequestedSpecification()));
     
      if (user == null) {
        user = subHandle.getUser();
      } else if (!user.equals(subHandle.getUser())) {
        throw new OpenGammaRuntimeException("Not all usernames are equal");       
      }
     
      if (type == null) {
        type = subHandle.getSubscriptionType();
      } else if (!type.equals(subHandle.getSubscriptionType())) {
        throw new OpenGammaRuntimeException("Not all subscription types are equal");
      }
    }
   
    // Build request message
View Full Code Here

Examples of com.seyren.core.domain.SubscriptionType

    }
   
    public Subscription subscriptionFrom(DBObject dbo) {
        String id = dbo.get("_id").toString();
        String target = getString(dbo, "target");
        SubscriptionType type = getSubscriptionType(getString(dbo, "type"));
        boolean su = getBoolean(dbo, "su");
        boolean mo = getBoolean(dbo, "mo");
        boolean tu = getBoolean(dbo, "tu");
        boolean we = getBoolean(dbo, "we");
        boolean th = getBoolean(dbo, "th");
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

                continue;
            }

            String name = readAttribute(node, "name");
            String typeString = readAttribute(node, "type");
            SubscriptionType subscriptionType = null;
            try {
                subscriptionType = SubscriptionType.valueOf(typeString == null ? "NONE" : typeString.toUpperCase());
            } catch (IllegalArgumentException e) {
                logger.warn("when loading roster for user " + bareJid + ", contact " + contactJid + " misses a subscription type", bareJid, contactJid);
            }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

                throw new IllegalArgumentException("unhandled SubscriptionType " + addAskSubscriptionType.value());
        }
    }

    protected Result addAskSubscribe(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        AskSubscriptionType typeAsk = item.getAskSubscriptionType();
        if (type.includesTo()) return ALREADY_SET;
        if (typeAsk == ASK_SUBSCRIBE) return OK;
        // IGNORE this, overwrite! if (typeAsk == ASK_SUBSCRIBED) return ALREADY_SET;
        item.setAskSubscriptionType(ASK_SUBSCRIBE);
        return OK;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

        item.setAskSubscriptionType(ASK_SUBSCRIBE);
        return OK;
    }

    protected Result addAskSubscribed(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        AskSubscriptionType typeAsk = item.getAskSubscriptionType();
        if (type.includesFrom()) return ALREADY_SET;
        if (typeAsk == ASK_SUBSCRIBE) return FAILED; // TODO think about return value
        if (typeAsk == ASK_SUBSCRIBED) return OK;
        item.setAskSubscriptionType(ASK_SUBSCRIBED);
        return OK;
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

        item.setAskSubscriptionType(ASK_SUBSCRIBED);
        return OK;
    }

    protected Result addTo(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (type.includesTo()) return ALREADY_SET;
        if (type == NONE) {
            type = TO;
        } else if (type == FROM) {
            type = BOTH;
        }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

        if (item.getAskSubscriptionType() == ASK_SUBSCRIBE) item.setAskSubscriptionType(NOT_SET);
        return OK;
    }

    protected Result addFrom(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (type.includesFrom()) return ALREADY_SET;
        if (type == NONE) {
            type = FROM;
        } else if (type == TO) {
            type = BOTH;
        }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

                throw new IllegalArgumentException("unhandled SubscriptionType " + removeSubscriptionType.value());
        }
    }

    protected Result removeTo(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (!type.includesTo()) {
            // if sub was asked, remove that.
            AskSubscriptionType askType = item.getAskSubscriptionType();
            if (askType != ASK_SUBSCRIBE) return ALREADY_SET;
            item.setAskSubscriptionType(NOT_SET);
            return OK;
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

        item.setSubscriptionType(type);
        return OK;
    }

    protected Result removeFrom(RosterItem item) {
        SubscriptionType type = item.getSubscriptionType();
        if (!type.includesFrom()) {
            // if sub was asked, remove that.
            AskSubscriptionType askType = item.getAskSubscriptionType();
            if (askType != ASK_SUBSCRIBED) return ALREADY_SET;
            item.setAskSubscriptionType(NOT_SET);
            return OK;
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.roster.SubscriptionType

                continue;
            }

            String name = readAttribute(node, "name");
            String typeString = readAttribute(node, "type");
            SubscriptionType subscriptionType = null;
            try {
                subscriptionType = SubscriptionType.valueOf(typeString == null ? "NONE" : typeString.toUpperCase());
            } catch (IllegalArgumentException e) {
                logger.warn("when loading roster for user " + bareJid + ", contact " + contactJid
                        + " misses a subscription type", bareJid, contactJid);
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.