/** * @return the STOMP server handler dealing with this connection */ public io.vertx.rxjava.ext.stomp.StompServerHandler handler() { io.vertx.rxjava.ext.stomp.StompServerHandler ret = io.vertx.rxjava.ext.stomp.StompServerHandler.newInstance(delegate.handler()); return ret; }
/** * @return the STOMP server handler dealing with this connection */ public io.vertx.rxjava.ext.stomp.StompServerHandler handler() { io.vertx.rxjava.ext.stomp.StompServerHandler ret = io.vertx.rxjava.ext.stomp.StompServerHandler.newInstance(delegate.handler()); return ret; }
private void authenticate(Frame frame, StompServerConnection connection, Handler<AsyncResult<Void>> remainingActions) { if (connection.server().options().isSecured()) { String login = frame.getHeader(Frame.LOGIN); String passcode = frame.getHeader(Frame.PASSCODE); connection.handler().onAuthenticationRequest(connection, login, passcode, ar -> { if (ar.result()) { remainingActions.handle(Future.succeededFuture()); } else { connection.write(Frames.createErrorFrame( "Authentication failed", Headers.create( Frame.VERSION, getSupportedVersionsHeaderLine(connection), Frame.CONTENT_TYPE, "text/plain"), "The connection frame does not contain valid credentials.") ); connection.close(); } }); } else { remainingActions.handle(Future.succeededFuture()); } }
private void replayChunk(StompServerConnection connection, List<Frame> frames) { final List<Destination> destinations = connection.handler().getDestinations(); for (Frame frame : frames) { switch (frame.getCommand()) { case SEND: // We are sure that the destination is set, as the check is made before enqueuing the frame. String destination = frame.getHeader(Frame.DESTINATION); Destination dest = connection.handler().getDestination(destination); if (dest != null) { dest.dispatch(connection, frame); } break; case ACK: for (Destination d : destinations) { if (d.ack(connection, frame)) { break; } } break; case NACK: for (Destination d : destinations) { if (d.nack(connection, frame)) { break; } } break; } } } }
List<Destination> destinations = connection.handler().getDestinations(); boolean handled = false; for (Destination destination : destinations) {
final List<Destination> destinations = connection.handler().getDestinations(); for (Destination destination : destinations) { if (destination.ack(connection, frame)) {
final List<Destination> destinations = connection.handler().getDestinations(); for (Destination destination : destinations) { if (destination.nack(connection, sf.frame())) {
final Destination dest = sf.connection().handler().getDestination(destination); if (dest == null && sf.connection().server().options().isSendErrorOnNoSubscriptions()) { Frame errorFrame = Frames.createErrorFrame(