Package com.sissi.protocol.iq

Examples of com.sissi.protocol.iq.IQ


   *
   * @see com.sissi.persistent.PersistentElement#read(java.util.Map)
   */
  @Override
  public Element read(Map<String, Object> element) {
    return IQ.class.cast(super.read(element, new IQ())).setId(element.get(Dictionary.FIELD_SID).toString()).setFrom(this.delegation).add(new Si().setId(element.get(Dictionary.FIELD_SID).toString()).setSource(element.get(Dictionary.FIELD_FROM).toString()).setProfile(this.profile).setFeature(this.feature).setFile(new File().setName(element.get(Dictionary.FIELD_NAME).toString()).setSize(element.get(Dictionary.FIELD_SIZE).toString())).delay(super.toString(element, Dictionary.FIELD_DELAY)));
  }
View Full Code Here


   *
   * @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
   */
  public boolean input(JIDContext context, Protocol protocol) {
    String host = protocol.cast(Si.class).setId(protocol.parent().getId()).host(super.build(protocol.parent().getTo()).asString(this.resource), context.jid().asString(this.resource));
    context.write(new IQ().add(new Bytestreams().setSid(this.persistent.peek(MongoUtils.asMap(BasicDBObjectBuilder.start(Dictionary.FIELD_SID, protocol.parent().getId()).get()), MongoUtils.asMap(BasicDBObjectBuilder.start("$addToSet", BasicDBObjectBuilder.start(Dictionary.FIELD_HOST, host).get()).get())).get(Dictionary.FIELD_SID).toString()).add(this.streamhost, true)).setFrom(this.delegation).setId(host).setType(ProtocolType.SET));
    return true;
  }
View Full Code Here

*/
public class IQTimeCallProcessor implements Input {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    context.write(new IQ().add(ServerAck.now().setId(protocol.parent().getId())).setId(UUID.randomUUID().toString()).setFrom(protocol.getTo()).setType(ProtocolType.SET));
    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

    this.proxy = proxy;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    return this.proxy.input(context, new Owner().destory(new Destory().reason(this.tip)).parent(new IQ().setTo(protocol.parent().getTo()).setType(ProtocolType.SET)));
  }
View Full Code Here

  }

  @Override
  public PingKeepalive ping(JIDContext context) {
    String uid = UUID.randomUUID().toString();
    this.timeouts.offer(new PingTimeout(context.ping(uid.hashCode()).write(new IQ().setId(uid).add(Ping.PING).setType(ProtocolType.GET), true)));
    return this;
  }
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

TOP

Related Classes of com.sissi.protocol.iq.IQ

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.