Package com.sissi.context

Examples of com.sissi.context.JID


  abstract protected class BlockOutput implements Output {

    @Override
    public boolean output(JIDContext context, Element node) {
      JID applicant = this.applicant(context.jid(), node);
      if (this.isEmpty(context.jid(), applicant) || !BlockOutputBuilder.this.blockSupports.contains(node.getClass())) {
        return true;
      }
      return !BlockOutputBuilder.this.context.isBlock(this.verifier(context.jid(), node), applicant);
    }
View Full Code Here


  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    XUser user = this.extracter.extract(protocol.cast(Owner.class).getX(), new XUser()).cast(XUser.class);
    if (user.contain()) {
      JID group = super.build(protocol.parent().getTo());
      Protocol message = new Message().noneThread().muc(user).setType(MessageType.GROUPCHAT).setFrom(group);
      for (JID jid : super.whoSubscribedMe(group)) {
        super.findOne(jid, true).write(message);
      }
    }
View Full Code Here

*/
public class MucOwnerDestoryLeaveProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.parent().getTo());
    Presence presence = new Presence().destory(protocol.cast(Owner.class).getDestory());
    for (JID jid : super.whoSubscribedMe(super.build(protocol.parent().getTo()))) {
      super.findOne(jid, true).write(presence.setFrom(group.resource(super.ourRelation(jid, group).name())));
    }
    return true;
  }
View Full Code Here

    this.mapping = mapping;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    // From = MUC JID
    protocol.setFrom(group.clone().resource(super.ourRelation(context.jid(), group).name()));
    JIDs jids = this.mapping.mapping(group);
    return jids.isEmpty() ? this.writeAndReturn(context, protocol) : this.writeAndReturn(protocol, jids);
  }
View Full Code Here

    this.persistent = persistentElementBox;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    this.persistent.push(protocol.parent().setFrom(group.resource(super.ourRelation(context.jid(), group).name())));
    return true;
  }
View Full Code Here

*/
public class MessageMuc2SubjectProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    protocol.cast(Message.class).noneThread().setFrom(group);
    for (JID jid : super.whoSubscribedMe(group)) {
      super.findOne(jid, true).write(protocol);
    }
    return true;
View Full Code Here

    this.room = room;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JID group = super.build(protocol.getTo());
    Room room = this.room.build(group);
    return room.allowed(context.jid(), RoomConfig.AFFILIATIONEXISTS) ? this.writeAndReturn(super.build(protocol.cast(Message.class).getMuc().getInvite().getTo()), group, room) : true;
  }
View Full Code Here

    this.jidBuilder = jidBuilder;
  }

  @Override
  public boolean apply(JID invoker, JID target, Fields fields) {
    JID jid = this.jidBuilder.build(fields.findField(RequestConfig.JID.toString(), XField.class).getValue().toString());
    this.config.collection().update(BasicDBObjectBuilder.start().add(Dictionary.FIELD_JID, target.asStringWithBare()).add(Dictionary.FIELD_INFORMATIONS + "." + Dictionary.FIELD_JID, jid.asStringWithBare()).get(), BasicDBObjectBuilder.start("$pull", BasicDBObjectBuilder.start(Dictionary.FIELD_INFORMATIONS, BasicDBObjectBuilder.start(Dictionary.FIELD_JID, jid.asStringWithBare()).get()).get()).get());
    return false;
  }
View Full Code Here

    this.relationContext = relationContext;
  }

  @Override
  public AffiliationBroadcast broadcast(JID group, Room room, MucItem item, JIDContext invoker) {
    JID jid = this.jidBuilder.build(item.getJid());
    // 向MUC房客广播MUC JID所有资源岗位变更
    for (Relation relation : this.relationContext.ourRelations(jid, group)) {
      for (JID to : this.relationContext.whoSubscribedMe(group)) {
        this.addressing.findOne(to, true).write(item.presence(room.pull(Dictionary.FIELD_AFFILIATION, String.class)).add(this.adder.add(new XUser(group, to, room.allowed(to, RoomConfig.WHOISEXISTS, null)).item(item.hidden(room.allowed(to, RoomConfig.WHOISALLOW, jid)).relation(relation.cast(MucRelation.class).affiliation(item.getAffiliation(), true)))).cast(XUser.class)));
      }
View Full Code Here

    this.persistent = persistent;
  }

  @Override
  public Recall call(String to) {
    JID jid = this.jidBuilder.build(to);
    JIDContext context = this.addressing.find(jid);
    if (context.binding()) {
      context.write(this.persistent.pull(jid));
    }
    return this;
View Full Code Here

TOP

Related Classes of com.sissi.context.JID

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.