Package com.sissi.protocol.iq.register.simple

Examples of com.sissi.protocol.iq.register.simple.Username.valid()


  private final Error error = new ServerError().type(ProtocolType.CANCEL).add(NotAcceptable.DETAIL);

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Username username = protocol.cast(Register.class).findField(Username.NAME, Username.class);
    return username != null && username.valid() ? true : this.writeAndReturn(context, protocol);
  }

  private boolean writeAndReturn(JIDContext context, Protocol protocol) {
    context.write(protocol.parent().reply().setError(this.error));
    return false;
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.