restx.annotations.GET类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(118)

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

GET介绍

暂无

代码示例

代码示例来源:origin: restx/restx

@GET("/sessions/current")
public Optional<Session> currentSession() {
  return currentSessionResolver.resolveCurrentSession();
}

代码示例来源:origin: restx/restx

methodAnnotations.add(new ResourceMethodAnnotation("GET", elem, get.value()));

代码示例来源:origin: io.restx/restx-security-basic

@GET("/sessions/current")
public Optional<Session> currentSession() {
  return currentSessionResolver.resolveCurrentSession();
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/i18n/locales")
public Iterable<String> locales() {
  Collection<String> locales = new ArrayList<>();
  for (SupportedLocale supportedLocale : supportedLocales) {
    String tag = supportedLocale.getLocale().toLanguageTag();
    locales.add(Locale.ROOT.toLanguageTag().equals(tag) ? "/" : tag);
  }
  return locales;
}

代码示例来源:origin: io.restx/restx-i18n-admin

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/i18n/locales")
public Iterable<String> locales() {
  Collection<String> locales = new ArrayList<>();
  for (SupportedLocale supportedLocale : supportedLocales) {
    String tag = supportedLocale.getLocale().toLanguageTag();
    locales.add(Locale.ROOT.toLanguageTag().equals(tag) ? "/" : tag);
  }
  return locales;
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/thread-dump")
  public String threadDump() {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    threadDump.dump(out);
    return new String(out.toByteArray());
  }
}

代码示例来源:origin: io.restx/restx-monitor-admin

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/thread-dump")
  public String threadDump() {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    threadDump.dump(out);
    return new String(out.toByteArray());
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/specs/{id}")
public Optional<RestxSpec> getSpecById(String id) {
  try {
    // to decode the spec id we first URL decode it, and then we replace triple underscores by forward slashes
    // This let the client address the spec id without having to URI encode the forward slash as %2F, which is
    // not allowed on some servers (especially tomcat)
    // see https://github.com/restx/restx/issues/90
    String specId = URLDecoder.decode(id, Charsets.UTF_8.name()).replace("___", "/");
    return repository.findSpecById(specId);
  } catch (UnsupportedEncodingException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/sessionStats")
  public Iterable<Sessions.SessionData> metrics() {
    return sessions.getAll().values();
  }
}

代码示例来源:origin: io.restx/restx-monitor-admin

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/sessionStats")
  public Iterable<Sessions.SessionData> metrics() {
    return sessions.getAll().values();
  }
}

代码示例来源:origin: io.restx/restx-apidocs

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/specs/{id}")
public Optional<RestxSpec> getSpecById(String id) {
  try {
    // to decode the spec id we first URL decode it, and then we replace triple underscores by forward slashes
    // This let the client address the spec id without having to URI encode the forward slash as %2F, which is
    // not allowed on some servers (especially tomcat)
    // see https://github.com/restx/restx/issues/90
    String specId = URLDecoder.decode(id, Charsets.UTF_8.name()).replace("___", "/");
    return repository.findSpecById(specId);
  } catch (UnsupportedEncodingException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/logs")
public String getLogs() {
  // quick and dirty basic implementation to get logs from the default log file.
  // this doesn't scale at all, and is very limited
  try {
    File appLog = new File(System.getProperty("logs.base", "logs"), "app.log");
    String logs = Files.toString(
        appLog, Charsets.UTF_8);
    // limit to around 30k
    int limit = 30000;
    if (logs.length() > limit) {
      int length = logs.length();
      logs = logs.substring(logs.length() - limit);
      logs = logs.substring(logs.indexOf('\n') + 1);
      logs = "[... " + ((length - logs.length()) / 1024)  + " kB truncated ...]\n" + logs;
    }
    logs = "LOGS FROM: " + appLog.getAbsolutePath() + "\n" +
        "------------------------------------------------------------------------------------------------\n" +
        logs;
    return logs;
  } catch (IOException e) {
    return e.getMessage();
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/tests/results/{key}")
  public Optional<TestResult> getTestResultByKey(String key) {
    return server.getResultByKey(key);
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/restx-stats")
  public RestxStats getRestxStats() {
    return collector.getStats();
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/i18n/keys")
public Iterable<String> keys() {
  return messages.keys();
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/health-checks")
public Map healthChecks() {
  return healthChecks.runHealthChecks();
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/config/elements")
  public Iterable<ConfigElement> findConfigElements() {
    return config.elements();
  }
}

代码示例来源:origin: restx/restx

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
  @GET("/@/pages")
  public Iterable<AdminPage> findPages(@Param(kind = Param.Kind.CONTEXT, value = "baseUri") String baseUri) {
    List<AdminPage> rootedPages = Lists.newArrayList();
    for (AdminPage page : pages) {
      rootedPages.add(page.rootOn(baseUri));
    }
    return rootedPages;
  }
}

代码示例来源:origin: io.restx/restx-specs-admin

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/tests/requests/{key}")
public Optional<TestRequest> getTestRequestByKey(String key) {
  return server.getRequestByKey(key);
}

代码示例来源:origin: io.restx/restx-apidocs

@RolesAllowed(AdminModule.RESTX_ADMIN_ROLE)
@GET("/@/specs")
public Iterable<String> findSpecsForOperation(String httpMethod, String path) {
  return repository.findSpecsByOperation(httpMethod, path);
}

相关文章

微信公众号

最新文章

更多

GET类方法