Package com.sissi.protocol.iq.roster

Examples of com.sissi.protocol.iq.roster.GroupItem


  }

  private Roster prepare(JIDContext context, Roster roster) {
    for (Relation each : super.myRelations(context.jid())) {
      JID to = super.build(each.jid());
      roster.add(new GroupItem(each.cast(RosterRelation.class)).nickname(this.vcardContext.pull(to, VCardContext.FIELD_NICK).getValue(), to.user()));
    }
    return roster;
  }
View Full Code Here


    this.group = group;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    GroupItem item = protocol.cast(Roster.class).first();
    JID to = super.build(item.getJid());
    item.addOnEmpty(this.group).setAsk(this.ask()).setSubscription(this.subscription(context.jid(), to)).setJid(to.asStringWithBare());
    // Roster Set/Remove From必须=null
    super.broadcast(context.jid(), protocol.parent().setFrom((String) null));
    return true;
  }
View Full Code Here

  @Override
  public RelationCascade update(JID master, JID slave) {
    RosterRelation relation = this.ourRelation.ourRelation(master, slave).cast(RosterRelation.class);
    // 激活则广播
    if (relation.activate()) {
      this.broadcastProtocol.broadcast(master, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(relation))).setType(ProtocolType.SET));
    }
    return this;
  }
View Full Code Here

    }
    return this;
  }

  public RelationCascade remove(JID master, JID slave) {
    this.broadcastProtocol.broadcast(master, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(slave).addOnEmpty(this.remove).setSubscription(RosterSubscription.REMOVE))).setType(ProtocolType.SET));
    return this;
  }
View Full Code Here

*/
public class RosterSetProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    GroupItem item = protocol.cast(Roster.class).first();
    super.establish(context.jid(), new ItemRosterRelation(super.ourRelation(context.jid(), super.build(item.getJid())).cast(RosterRelation.class), item));
    return true;
  }
View Full Code Here

public class PresenceRosterUnSubscribed2ItemProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID to = super.build(protocol.getTo());
    super.broadcast(to, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(to, context.jid()).cast(RosterRelation.class)))).setType(ProtocolType.SET));
    return true;
  }
View Full Code Here

*/
public class PresenceRosterSubscribe2ItemProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    super.broadcast(context.jid(), new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(context.jid(), super.build(protocol.getTo())).cast(RosterRelation.class)))).setType(ProtocolType.SET));
    return true;
  }
View Full Code Here

    this.writeRoster(context, to).writeSubscribed(context, to, presence).writeAvailable(context, to, presence);
    return false;
  }

  private PresenceRosterSubscribe2ReplySelfsProcessor writeRoster(JIDContext context, JID to) {
    super.broadcast(context.jid(), new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(context.jid(), to).cast(RosterRelation.class)))).setType(ProtocolType.SET));
    return this;
  }
View Full Code Here

*/
public class PresenceRosterUnSubscribe2ItemProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    super.broadcast(context.jid(), new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(context.jid(), super.build(protocol.getTo())).cast(RosterRelation.class)))).setType(ProtocolType.SET));
    return true;
  }
View Full Code Here

public class PresenceRosterSubscribed2ItemProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID to = super.build(protocol.getTo());
    super.broadcast(to, new IQ().setId(UUID.randomUUID().toString()).add(new Roster(new GroupItem(super.ourRelation(to, context.jid()).cast(RosterRelation.class)))).setType(ProtocolType.SET));
    return true;
  }
View Full Code Here

TOP

Related Classes of com.sissi.protocol.iq.roster.GroupItem

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.