gpt4 book ai didi

com.jetdrone.vertx.yoke.middleware.YokeRequest.uri()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 12:30:40 26 4
gpt4 key购买 nike

本文整理了Java中com.jetdrone.vertx.yoke.middleware.YokeRequest.uri()方法的一些代码示例,展示了YokeRequest.uri()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YokeRequest.uri()方法的具体详情如下:
包路径:com.jetdrone.vertx.yoke.middleware.YokeRequest
类名称:YokeRequest
方法名:uri

YokeRequest.uri介绍

暂无

代码示例

代码示例来源:origin: pmlopes/yoke

@Override
public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
 if (log.isTraceEnabled()) {
  log.trace("Got request in sockjs server: " + request.uri());
 }
 router.handle(request, next);
}

代码示例来源:origin: pmlopes/yoke

@Override
public String getFullRequestURL() {
  return getScheme() + "://" + getRequestHeader("Host") + request.uri();
}

代码示例来源:origin: pmlopes/yoke

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
    JsonObject session = request.get("session");
    if (session != null) {
      if (session.getString("id") != null) {
        next.handle(null);
        return;
      }
    }
    String redirect = request.getParam("redirect_url", Utils.encodeURIComponent(request.uri()));
    request.response().redirect(loginURI + "?redirect_url=" + Utils.decodeURIComponent(redirect));
  }
};

代码示例来源:origin: pmlopes/yoke

@Override
 public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
  if (log.isTraceEnabled()) log.trace("WS, all: " + request.uri());
  request.response().putHeader("Allow", "GET").setStatusCode(405).end();
 }
});

代码示例来源:origin: pmlopes/yoke

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {

    // common logging data
    final long timestamp = System.currentTimeMillis();
    final String remoteClient = getClientAddress(request.remoteAddress());
    final HttpMethod method = request.method();
    final String uri = request.uri();
    final String version = getVersionString(request.version());

    if (immediate) {
      log(request, timestamp, remoteClient, version, method.name(), uri);
    } else {
      request.response().endHandler(new Handler<Void>() {
        @Override
        public void handle(Void event) {
          log(request, timestamp, remoteClient, version, method.name(), uri);
        }
      });
    }

    next.handle(null);
  }
}

代码示例来源:origin: pmlopes/yoke

public EventSourceTransport(Vertx vertx, Router router, LocalMap<String, SockJSSession> sessions, SockJSHandlerOptions options,
           Handler<SockJSSocket> sockHandler) {
 super(vertx, sessions, options);
 String eventSourceRE = COMMON_PATH_ELEMENT_RE + "eventsource";
 router.get(Pattern.compile(eventSourceRE), (request, next) -> {
  if (log.isTraceEnabled()) log.trace("EventSource transport, get: " + request.uri());
  String sessionID = request.getParam("param0");
  SockJSSession session = getSession(request, options.getSessionTimeout(), options.getHeartbeatInterval(), sessionID, sockHandler);
  session.setInfo(request.localAddress(), request.remoteAddress(), request.uri(), request.headers());
  session.register(new EventSourceListener(options.getMaxBytesStreaming(), request, session));
 });
}

代码示例来源:origin: pmlopes/yoke

private void registerHandler(Router router, Handler<SockJSSocket> sockHandler, String re, boolean streaming, SockJSHandlerOptions options) {
 router.post(Pattern.compile(re), (request, next) -> {
  if (log.isTraceEnabled()) log.trace("XHR, post, " + request.uri());
  setNoCacheHeaders(request);
  String sessionID = request.getParam("param0");
  SockJSSession session = getSession(request, options.getSessionTimeout(), options.getHeartbeatInterval(), sessionID, sockHandler);
  session.setInfo(request.localAddress(), request.remoteAddress(), request.uri(), request.headers());
  session.register(streaming? new XhrStreamingListener(options.getMaxBytesStreaming(), request, session) : new XhrPollingListener(request, session));
 });
}

代码示例来源:origin: pmlopes/yoke

@Override
public void handle(@NotNull final YokeRequest req, @NotNull final Handler<Object> next) {
  if (!req.uri().startsWith(prefix)) {
   next.handle(null);
   return;
  final String newUri = req.uri().replaceFirst(prefix, "");
  final HttpClient client = vertx().createHttpClient(new HttpClientOptions().setDefaultHost(host).setDefaultPort(port).setSsl(secure));

代码示例来源:origin: pmlopes/yoke

public XhrTransport(Vertx vertx, Router router, LocalMap<String, SockJSSession> sessions, SockJSHandlerOptions options,
       Handler<SockJSSocket> sockHandler) {
 super(vertx, sessions, options);
 String xhrBase = COMMON_PATH_ELEMENT_RE;
 String xhrRE = xhrBase + "xhr";
 String xhrStreamRE = xhrBase + "xhr_streaming";
 Middleware xhrOptionsHandler = createCORSOptionsHandler(options, "OPTIONS, POST");
 router.options(Pattern.compile(xhrRE), xhrOptionsHandler);
 router.options(Pattern.compile(xhrStreamRE), xhrOptionsHandler);
 registerHandler(router, sockHandler, xhrRE, false, options);
 registerHandler(router, sockHandler, xhrStreamRE, true, options);
 String xhrSendRE = COMMON_PATH_ELEMENT_RE + "xhr_send";
 router.options(Pattern.compile(xhrSendRE), xhrOptionsHandler);
 router.post(Pattern.compile(xhrSendRE), (request, next) -> {
  if (log.isTraceEnabled()) log.trace("XHR send, post, " + request.uri());
  String sessionID = request.getParam("param0");
  final SockJSSession session = sessions.get(sessionID);
  if (session != null && !session.isClosed()) {
   handleSend(request, session);
  } else {
   request.response().setStatusCode(404);
   setJSESSIONID(options, request);
   request.response().end();
  }
 });
}

代码示例来源:origin: pmlopes/yoke

public HtmlFileTransport(Vertx vertx, Router router, LocalMap<String, SockJSSession> sessions, SockJSHandlerOptions options,
         Handler<SockJSSocket> sockHandler) {
 super(vertx, sessions, options);
 String htmlFileRE = COMMON_PATH_ELEMENT_RE + "htmlfile.*";
 router.get(Pattern.compile(htmlFileRE), (request, next) -> {
  if (log.isTraceEnabled()) log.trace("HtmlFile, get: " + request.uri());
  String callback = request.getParam("callback");
  if (callback == null) {
   callback = request.getParam("c");
   if (callback == null) {
    request.response().setStatusCode(500).end("\"callback\" parameter required\n");
    return;
   }
  }
  String sessionID = request.params().get("param0");
  SockJSSession session = getSession(request, options.getSessionTimeout(), options.getHeartbeatInterval(), sessionID, sockHandler);
  session.setInfo(request.localAddress(), request.remoteAddress(), request.uri(), request.headers());
  session.register(new HtmlFileListener(options.getMaxBytesStreaming(), request, callback, session));
 });
}

代码示例来源:origin: pmlopes/yoke

if (log.isTraceEnabled()) log.trace("WS, get: " + request.uri());
request.response().setStatusCode(400);
request.response().end("Can \"Upgrade\" only to \"WebSocket\".");

代码示例来源:origin: pmlopes/yoke

if (log.isTraceEnabled()) log.trace("JsonP, get: " + request.uri());
 String callback = request.getParam("callback");
 if (callback == null) {
 session.setInfo(request.localAddress(), request.remoteAddress(), request.uri(), request.headers());
 session.register(new JsonPListener(request, session, callback));
});
 if (log.isTraceEnabled()) log.trace("JsonP, post: " + request.uri());
 String sessionID = request.getParam("param0");
 final SockJSSession session = sessions.get(sessionID);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com