コード例 #1
0
 @RequestMapping(
     value = "/log/{name}",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @ResponseBody
 public List<LogEvent> getLogEvent(@PathVariable String name) {
   return delegate.getLogEvents(name);
 }
コード例 #2
0
 @RequestMapping(
     value = "/logger/{name}/{level}",
     method = RequestMethod.PUT,
     consumes = MediaType.APPLICATION_JSON_VALUE)
 @ResponseBody
 @ResponseStatus(HttpStatus.NO_CONTENT)
 public void changeLevel(@PathVariable String name, @PathVariable String level) {
   delegate.changeLevel(LoggerBuilder.builder().withName(name).withLevel(level).build());
 }
コード例 #3
0
 @RequestMapping(
     value = "/log/{name}/{after}",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @ResponseBody
 public List<LogEvent> getLogEvent(
     @PathVariable String name, @PathVariable @DateTimeFormat(iso = ISO.DATE_TIME) Date after) {
   return delegate.getLogEvents(name, after);
 }
コード例 #4
0
  @RequestMapping(
      value = "/logger/{name}",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  @ResponseBody
  public LoggerResource getLogger(@PathVariable String name) {
    Logger logger = delegate.getLogger(name);
    LoggerResource loggerResource = new LoggerResource(logger);
    loggerResource.add(
        linkTo(LoggingHateoasMvcEndpoint.class)
            .slash(this.getPath() + "/logger/" + logger.getName())
            .withSelfRel());

    return loggerResource;
  }
コード例 #5
0
  @RequestMapping(
      value = "/logger",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  @ResponseBody
  public Resources<LoggerResource> getLoggers() {
    List<Logger> loggers = delegate.getLoggers();
    List<LoggerResource> loggerResources = new ArrayList<>();
    for (Logger logger : loggers) {
      LoggerResource loggerResource = new LoggerResource(logger);
      loggerResource.add(
          linkTo(LoggingHateoasMvcEndpoint.class)
              .slash(this.getPath() + "/logger/" + logger.getName())
              .withSelfRel());
      loggerResources.add(loggerResource);
    }

    return new Resources<LoggerResource>(
        loggerResources,
        linkTo(LoggingHateoasMvcEndpoint.class).slash(this.getPath() + "/logger").withSelfRel());
  }
コード例 #6
0
  @RequestMapping(
      value = "/log",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  @ResponseBody
  public Resources<AppenderResource> getAppenders() {
    List<Appender> appenders = delegate.getAppenders();
    List<AppenderResource> appenderResources = new ArrayList<>();
    for (Appender appender : appenders) {
      AppenderResource appenderResource = new AppenderResource(appender);
      appenderResource.add(
          linkTo(LoggingHateoasMvcEndpoint.class)
              .slash(this.getPath() + "/log/" + appender.getName())
              .withSelfRel());
      appenderResources.add(appenderResource);
    }

    return new Resources<AppenderResource>(
        appenderResources,
        linkTo(LoggingHateoasMvcEndpoint.class).slash(this.getPath() + "/log").withSelfRel());
  }
コード例 #7
0
 @Override
 public Class<? extends Endpoint> getEndpointType() {
   return delegate.getClass();
 }
コード例 #8
0
 @Override
 public boolean isSensitive() {
   return delegate.isSensitive();
 }