Search in sources :

Example 66 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project geode by apache.

the class IndexCommandsController method defineIndex.

@RequestMapping(method = RequestMethod.POST, value = "/indexes", params = "op=define")
@ResponseBody
public String defineIndex(@RequestParam(CliStrings.DEFINE_INDEX_NAME) final String name, @RequestParam(CliStrings.DEFINE_INDEX__EXPRESSION) final String expression, @RequestParam(CliStrings.DEFINE_INDEX__REGION) final String regionNamePath, @RequestParam(value = CliStrings.DEFINE_INDEX__TYPE, defaultValue = DEFAULT_INDEX_TYPE) final String type) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.DEFINE_INDEX);
    command.addOption(CliStrings.DEFINE_INDEX_NAME, name);
    command.addOption(CliStrings.DEFINE_INDEX__EXPRESSION, expression);
    command.addOption(CliStrings.DEFINE_INDEX__REGION, regionNamePath);
    command.addOption(CliStrings.DEFINE_INDEX__TYPE, type);
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 67 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project geode by apache.

the class IndexCommandsController method listIndex.

@RequestMapping(method = RequestMethod.GET, value = "/indexes")
@ResponseBody
public String listIndex(@RequestParam(value = CliStrings.LIST_INDEX__STATS, defaultValue = "false") final Boolean withStats) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.LIST_INDEX);
    command.addOption(CliStrings.LIST_INDEX__STATS, String.valueOf(Boolean.TRUE.equals(withStats)));
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 68 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project geode by apache.

the class MemberCommandsController method describeMember.

@RequestMapping(method = RequestMethod.GET, value = "/members/{name}")
@ResponseBody
public String describeMember(@PathVariable("name") final String memberNameId) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.DESCRIBE_MEMBER);
    command.addOption(CliStrings.DESCRIBE_MEMBER__IDENTIFIER, decode(memberNameId));
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 69 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project geode by apache.

the class PdxCommandsController method pdxRename.

@RequestMapping(method = RequestMethod.POST, value = "/pdx/type")
@ResponseBody
public String pdxRename(@RequestParam(value = CliStrings.PDX_RENAME_OLD) final String oldClassName, @RequestParam(value = CliStrings.PDX_RENAME_NEW) final String newClassName, @RequestParam(value = CliStrings.PDX_DISKSTORE) final String diskStore, @RequestParam(value = CliStrings.PDX_DISKDIR, required = false) final String[] diskDirs) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.PDX_RENAME);
    command.addOption(CliStrings.PDX_RENAME_OLD, oldClassName);
    command.addOption(CliStrings.PDX_RENAME_NEW, newClassName);
    command.addOption(CliStrings.PDX_DISKSTORE, diskStore);
    if (hasValue(diskDirs)) {
        command.addOption(CliStrings.PDX_DISKDIR, StringUtils.join(diskDirs, StringUtils.COMMA_DELIMITER));
    }
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 70 with ResponseBody

use of org.springframework.web.bind.annotation.ResponseBody in project geode by apache.

the class MiscellaneousCommandsController method showDeadLock.

// TODO determine if Async functionality is required
@RequestMapping(method = RequestMethod.GET, value = "/deadlocks")
@ResponseBody
public String showDeadLock(@RequestParam(CliStrings.SHOW_DEADLOCK__DEPENDENCIES__FILE) final String dependenciesFile) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.SHOW_DEADLOCK);
    command.addOption(CliStrings.SHOW_DEADLOCK__DEPENDENCIES__FILE, decode(dependenciesFile));
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1991 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1700 HashMap (java.util.HashMap)458 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)212 IOException (java.io.IOException)207 JSONObject (com.alibaba.fastjson.JSONObject)200 Map (java.util.Map)172 ApiOperation (io.swagger.annotations.ApiOperation)170 ArrayList (java.util.ArrayList)169 GetMapping (org.springframework.web.bind.annotation.GetMapping)112 ResponseEntity (org.springframework.http.ResponseEntity)102 ApiRest (build.dream.common.api.ApiRest)101 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)101 AuthPassport (com.ngtesting.platform.util.AuthPassport)99 PostMapping (org.springframework.web.bind.annotation.PostMapping)94 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)87 Date (java.util.Date)81 UserVo (com.ngtesting.platform.vo.UserVo)78 LogDetail (com.bc.pmpheep.annotation.LogDetail)71 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)65