Package com.sissi.context

Examples of com.sissi.context.JIDContext


*/
public class LastJIDProcessor extends ProxyProcessor {

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    JIDContext to = super.findOne(protocol.parent().to() ? super.build(protocol.parent().getTo()) : context.jid(), true);
    context.write(protocol.cast(Last.class).seconds().seconds(to.idle()).text(to.status().clauses().find(StatusClauses.KEY_STATUS)).parent().reply().setType(ProtocolType.RESULT));
    return false;
  }
View Full Code Here


      ctx.attr(MainServerHandlerBuilder.this.attrConnector).get().stop();
      return this;
    }

    private PersonalServerHandler closeContext(ChannelHandlerContext ctx) throws IOException {
      JIDContext context = ctx.attr(MainServerHandlerBuilder.this.attrContext).get();
      MainServerHandlerBuilder.this.getout.getout(context);
      MainServerHandlerBuilder.this.addressing.leave(context);
      this.closeParser();
      return this;
    }
View Full Code Here

      return output;
    }

    private ByteBuf logIfNecessary(ChannelHandlerContext ctx, ByteBuf byteBuf) {
      if (MainServerHandlerBuilder.this.log.isInfoEnabled()) {
        JIDContext context = ctx.attr(MainServerHandlerBuilder.this.attrContext).get();
        MainServerHandlerBuilder.this.log.info("Read on " + (context != null && context.jid() != null ? context.jid().asString() : "N/A") + ": " + byteBuf.toString(Charset.forName("UTF-8")));
        byteBuf.readerIndex(0);
      }
      return byteBuf;
    }
View Full Code Here

    }

    private MongoJIDContexts read(DBCursor cursor) {
      try (DBCursor iterator = cursor) {
        while (iterator.hasNext()) {
          JIDContext context = MongoAddressing.this.contexts.get(MongoUtils.asLong(iterator.next(), Dictionary.FIELD_INDEX));
          // Double check 4 multi thread
          if (context != null) {
            super.add(context);
          }
        }
View Full Code Here

  }

  @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.JIDContext

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.