Java Code Examples for org.springframework.web.bind.annotation.RequestMethod

The following examples show how to use org.springframework.web.bind.annotation.RequestMethod. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jeewx   Source File: QywxMenuController.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 删除
 * @return
 */
@RequestMapping(params="doDelete",method = RequestMethod.GET)
@ResponseBody
public AjaxJson doDelete(@RequestParam(required = true, value = "id" ) String id){
		AjaxJson j = new AjaxJson();
		try {
		    QywxMenu qywxMenu = new QywxMenu();
			qywxMenu.setId(id);
			qywxMenuDao.delete(qywxMenu);
			j.setMsg("删除成功");
		} catch (Exception e) {
		    log.info(e.getMessage());
			j.setSuccess(false);
			j.setMsg("删除失败");
		}
		return j;
}
 
Example 2
Source Project: batch-scheduler   Source File: SysConfigController.java    License: MIT License 6 votes vote down vote up
@ApiOperation(value = "更新系统参数", notes = "更新结果只对当前操作的域有效")
@ApiImplicitParams({
        @ApiImplicitParam(required = true, name = "domain_id", value = "域编码"),
        @ApiImplicitParam(required = true, name = "config_id", value = "参数编码"),
        @ApiImplicitParam(required = true, name = "config_value", value = "参数值"),
})
@RequestMapping(value = "/v1/dispatch/config/user", method = RequestMethod.POST)
public String updateConfigValue(HttpServletResponse response, HttpServletRequest request) {
    String domainId = request.getParameter("domain_id");
    String configId = request.getParameter("config_id");
    String configValue = request.getParameter("config_value");

    int size = sysConfigService.setValue(domainId, configId, configValue);
    if (size != 1) {
        response.setStatus(421);
        return Hret.error(421, "更新ETL调度系统核心参数失败", null);
    }
    return Hret.success(200, "success", null);
}
 
Example 3
@RequestMapping(value = "", method = RequestMethod.GET)
public ModelAndView renderApplicationPage() {
    log.debug("renderApplicationPage()");

    final List<ModuleType> moduleTypes = moduleTypeHystrixClient.getAllModuleTypes();
    final Set<Resource> resources = new HashSet<>();

    moduleTypes.forEach(moduleType -> {
        resources.addAll(moduleType.getResources());
    });

    resources.forEach(resource -> log.debug("resource: {}", resource));
    List<Resource> uniqueResources = resources.stream().filter(distinctByKey(resource -> resource.getRelativeUrl())).collect(Collectors.toList());


    List<String> angularJsModules = moduleTypes.stream().filter(moduleType -> moduleType.getAngularJsNameApplication() != null).filter(distinctByKey(moduleType -> moduleType.getAngularJsNameApplication())).map(moduleType -> moduleType.getAngularJsNameApplication()).collect(Collectors.toList());
    angularJsModules.forEach(angularJsModule -> log.debug(angularJsModule));

    ModelAndView modelAndView = new ModelAndView("application/index");
    modelAndView.addObject("resources", uniqueResources);
    modelAndView.addObject("angularJsModules", angularJsModules);

    return modelAndView;
}
 
Example 4
Source Project: onboard   Source File: StepApiController.java    License: Apache License 2.0 6 votes vote down vote up
@RequestMapping(value = "", method = RequestMethod.POST)
@Interceptors({ ProjectMemberRequired.class })
@ResponseBody
@Caching(evict = { @CacheEvict(value = IterationApiController.ITERATION_CACHE_NAME, key = "#projectId + '*'"),
        @CacheEvict(value = IterationApiController.ITERATIONS_CACHE_NAME, key = "#projectId + '*'"),
        @CacheEvict(value = StoryApiController.GET_STORIES_CACHE, key = "#projectId + '*'") })
public StepDTO newStep(@RequestBody Step step, @PathVariable int projectId) {
    step.setCreatorId(sessionService.getCurrentUser().getId());
    step.setCreatorName(sessionService.getCurrentUser().getName());
    step.setStatus(IterationItemStatus.TODO.getValue());
    step = stepService.create(step);
    if (step.getAssigneeId() != null) {
        step.setAssignee(userService.getById(step.getAssigneeId()));
    }
    return StepTransform.stepToStepDTO(step);
}
 
Example 5
Source Project: Mario   Source File: MenuController.java    License: Apache License 2.0 6 votes vote down vote up
@RequiresRoles("admin")
@RequestMapping(value = "create", method = RequestMethod.POST)
public String create(@Valid Menu menu, BindingResult result, Model model,
        RedirectAttributes redirectAttributes) {
    if (result.hasErrors()) {
        Menu topMenu = accountService.getTopMenu();
        menu.setParent(topMenu);

        model.addAttribute("menu", menu);
        model.addAttribute("allShows", allShows);
        model.addAttribute("action", "create");

        return "account/menuForm";
    }
    generateMenuParentIds(menu);
    accountService.saveMenu(menu);
    redirectAttributes.addFlashAttribute("message", "创建菜单成功");

    return "redirect:/account/menu";
}
 
Example 6
Source Project: jeesuite-config   Source File: AppAdminController.java    License: Apache License 2.0 6 votes vote down vote up
@RequestMapping(value = "add", method = RequestMethod.POST)
public ResponseEntity<WrapperResponseEntity> addApp(@RequestBody AddOrEditAppRequest addAppRequest){
	SecurityUtil.requireSuperAdmin();
	if(addAppRequest.getMasterUid() == null || addAppRequest.getMasterUid() == 0){
		throw new JeesuiteBaseException(1002, "请选择项目负责人");
	}
	if(appMapper.findByName(addAppRequest.getName()) != null){
		throw new JeesuiteBaseException(1002, "应用["+addAppRequest.getName()+"]已存在");
	}
	AppEntity appEntity = BeanUtils.copy(addAppRequest, AppEntity.class);
	//
	UserEntity master = userMapper.selectByPrimaryKey(addAppRequest.getMasterUid());
	appEntity.setMaster(master.getName());
	appMapper.insertSelective(appEntity);
	return new ResponseEntity<WrapperResponseEntity>(new WrapperResponseEntity(true),HttpStatus.OK);
}
 
Example 7
Source Project: lams   Source File: OutcomeController.java    License: GNU General Public License v2.0 6 votes vote down vote up
@RequestMapping(path = "/outcomeRemoveMapping", method = RequestMethod.POST)
   public void outcomeRemoveMapping(HttpServletRequest request, HttpServletResponse response) throws Exception {
Long mappingId = WebUtil.readLongParam(request, "mappingId");
OutcomeMapping outcomeMapping = (OutcomeMapping) userManagementService.findById(OutcomeMapping.class,
	mappingId);
Organisation organisation = outcomeMapping.getOutcome().getOrganisation();
Integer organisationId = organisation == null ? null : organisation.getOrganisationId();
Integer userId = getUserDTO().getUserID();
if (organisationId == null) {
    if (!request.isUserInRole(Role.SYSADMIN) && !request.isUserInRole(Role.AUTHOR)) {
	String error = "User " + userId
		+ " is not sysadmin nor an author and can not remove an outcome mapping";
	log.error(error);
	throw new SecurityException(error);
    }
} else {
    securityService.hasOrgRole(organisationId, userId, new String[] { Role.AUTHOR }, "remove outcome mapping",
	    true);
}
userManagementService.delete(outcomeMapping);
if (log.isDebugEnabled()) {
    log.debug("Deleted outcome mapping " + outcomeMapping);
}
   }
 
Example 8
Source Project: Blog-System   Source File: CommentController.java    License: Apache License 2.0 6 votes vote down vote up
@RequestMapping(value = "/api/comment/add", method = RequestMethod.POST)
public @ResponseBody Object commentAdd(HttpServletRequest request) {
    Comment comment=new Comment();
    comment.setArticleId(Long.parseLong(request.getParameter("articleId")));
    comment.setContent(request.getParameter("content"));
    comment.setDate(new Date());
    comment.setName(request.getParameter("name"));
    comment.setEmail(request.getParameter("email"));
    HashMap<String, String> res = new HashMap<String, String>();
    if(commentService.insertComment(comment)>0){
        res.put("stateCode", "1");
    }else {
        res.put("stateCode", "0");
    }
    return res;
}
 
Example 9
@RequestMapping(value="/confirm", method=RequestMethod.POST)
 public String ConfirmBooking(@ModelAttribute UIData uiData, Model model) {
  	Flight flight= uiData.getSelectedFlight();
BookingRecord booking = new BookingRecord(flight.getFlightNumber(),flight.getOrigin(),
		  flight.getDestination(), flight.getFlightDate(),null,
		  flight.getFares().getFare());
Set<Passenger> passengers = new HashSet<Passenger>();
Passenger pax = uiData.getPassenger();
pax.setBookingRecord(booking);
passengers.add(uiData.getPassenger());
		booking.setPassengers(passengers);
long bookingId =0;
try { 
	//long bookingId = bookingClient.postForObject("http://book-service/booking/create", booking, long.class); 
	 bookingId = bookingClient.postForObject("http://book-apigateway/api/booking/create", booking, long.class); 
	logger.info("Booking created "+ bookingId);
}catch (Exception e){
	logger.error("BOOKING SERVICE NOT AVAILABLE...!!!");
}
model.addAttribute("message", "Your Booking is confirmed. Reference Number is "+ bookingId);
return "confirm";
 }
 
Example 10
Source Project: lams   Source File: MonitoringController.java    License: GNU General Public License v2.0 6 votes vote down vote up
@RequestMapping(path = "/appointScribe", method = RequestMethod.POST)
   public String appointScribe(@ModelAttribute("monitoringForm") MonitoringForm monitoringForm,
    HttpServletRequest request) {

ScribeSession session = scribeService.getSessionBySessionId(monitoringForm.getToolSessionID());
ScribeUser user = scribeService.getUserByUID(monitoringForm.getAppointedScribeUID());

session.setAppointedScribe(user);
scribeService.saveOrUpdateScribeSession(session);

ScribeDTO scribeDTO = setupScribeDTO(session.getScribe());
boolean isGroupedActivity = scribeService.isGroupedActivity(session.getScribe().getToolContentId());
request.setAttribute("isGroupedActivity", isGroupedActivity);
request.setAttribute("monitoringDTO", scribeDTO);
request.setAttribute("contentFolderID", monitoringForm.getContentFolderID());

monitoringForm.setCurrentTab(WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true));

return "pages/monitoring/monitoring";
   }
 
Example 11
@RequestMapping(value = "/save", method = RequestMethod.POST)
@Override
public ModelAndView save(RoleVO roleVO, HttpServletRequest request, HttpServletResponse response) {
	ModelAndView mv = new ModelAndView();
	String roleName = roleVO.getRoleName();
	if (StringUtils.isEmpty(roleName)) {
		mv.setViewName(this.getJspPrefix() + "/add");
		mv.addObject("error", "角色名称不能为空");
		return mv;
	}
	QueryWrapper<Role> queryWrapper = new QueryWrapper<>();
	queryWrapper.eq("role_name", roleVO.getRoleName());
	RoleDTO roleDTO = this.roleService.getOne(queryWrapper);
	if (roleDTO != null) {
		mv.setViewName(this.getJspPrefix() + "/add");
		mv.addObject("error", "角色名称已存在");
		return mv;
	}
	roleVO.setCreateDate(DateUtils.formatDateTime(new Date()));
	mv = super.save(roleVO, request, response);
	mv.setViewName(redirect(request, "/admin/role/list"));
	return mv;
}
 
Example 12
Source Project: springboot-security-wechat   Source File: UserController.java    License: Apache License 2.0 6 votes vote down vote up
@RequestMapping(method = {RequestMethod.POST}, value = "/wechatJoin")
@ResponseBody
public Response wechatJoin(@RequestParam(value = "name") String name,
                           @RequestParam(value = "phone") String phone,
                           @RequestParam(value = "vCode") String vCode,
                           @RequestParam(value = "password") String password,
                           HttpServletRequest request) {
    UserResponse userResponse = null;
    try {
        User user = userService.wechatJoin(name, phone, vCode, password, getUser());
        user.setPassword("");
        userResponse = userService.getUserInfo(user);
    } catch (Exception e) {
        return errorResponse("绑定失败", e.toString());
    }
    return successResponse("绑定成功", userResponse);
}
 
Example 13
Source Project: mumu   Source File: SystemPermissionController.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 添加权限
 * @return
 */
@ResponseBody
@RequiresPermissions("system:permission:add")
@MumuLog(name = "添加权限",operater = "POST")
@RequestMapping(value="/add",method=RequestMethod.POST)
public ResponseEntity savePermission(SysPermission permission, HttpServletRequest request){
	//获取权限内码和权限名称下面的权限列表
	List<SysPermission> permissions = permissionService.querySysPermissionByCondition(null, permission.getPermissionCode(), permission.getPermissionName(), PublicEnum.NORMAL.value());
	if(permissions!=null&&permissions.size()>0){
		return new ResponseEntity(500, "权限内码、权限名称不可重复", null);
	}
	try {
		permission.setCreator(SecurityUtils.getSubject().getPrincipal().toString());
		permissionService.addPermission(permission);
	} catch (Exception e) {
		log.error(e);
		return new ResponseEntity(500,"保存权限内码出现异常",null);
	}
	return new ResponseEntity(200, "保存权限操作成功", null);
}
 
Example 14
@RequestMapping(value = "${jwt.route.authentication.path}", method = RequestMethod.POST)
public ResponseEntity<?> createAuthenticationToken(@RequestBody JwtAuthenticationRequest authenticationRequest, Device device) throws AuthenticationException {

    // Perform the security
    final Authentication authentication = authenticationManager.authenticate(
            new UsernamePasswordAuthenticationToken(
                    authenticationRequest.getUsername(),
                    authenticationRequest.getPassword()
            )
    );
    SecurityContextHolder.getContext().setAuthentication(authentication);

    // Reload password post-security so we can generate token
    final UserDetails userDetails = userDetailsService.loadUserByUsername(authenticationRequest.getUsername());
    final String token = jwtTokenUtil.generateToken(userDetails, device);

    // Return the token
    return ResponseEntity.ok(new JwtAuthenticationResponse(token));
}
 
Example 15
Source Project: cf-SpringBootTrader   Source File: UserController.java    License: Apache License 2.0 6 votes vote down vote up
@RequestMapping(value = "/registration", method = RequestMethod.POST)
public String register(Model model, @ModelAttribute(value="account") Account account) {
	logger.info("register: user:" + account.getUserid());
	
	//need to set some stuff on account...
	
	account.setOpenbalance(account.getBalance());
	account.setCreationdate(new Date());
	
	AuthenticationRequest login = new AuthenticationRequest();
	login.setUsername(account.getUserid());
	model.addAttribute("login", login);
	model.addAttribute("marketSummary", summaryService.getMarketSummary());
	accountService.createAccount(account);
	return "index";
}
 
Example 16
@RequestMapping(value = "{siteSlug}/{postFileId}/delete", method = RequestMethod.POST)
public RedirectView delete(@PathVariable String siteSlug, @PathVariable String postFileId) {
    Site site = Site.fromSlug(siteSlug);
    ensureCanDoThis(site, PermissionsArray.Permission.EDIT_POSTS);
    PostFile postFile = FenixFramework.getDomainObject(postFileId);
    Post post = postFile.getPost();
    if(site.equals(postFile.getSite())) {
        FenixFramework.atomic(()-> {
            postFile.delete();
            post.fixOrder(post.getFilesSorted());
        });
    }
    return mediaLibraryRedirect(site);
}
 
Example 17
@RequestMapping(value = "/{matchId}", method = RequestMethod.GET, produces = CONTENT_TYPE)
public ResponseEntity<byte[]> downloadIcsCalendarFile(@PathVariable("matchId") Long matchId) {
    final IcsFile icsFile = icsCalendarService.createCalendarEventFromMatch(matchId, LocaleContextHolder.getLocale());

    if (icsFile == null) {
        return ResponseEntity.notFound().build();
    }

    return ResponseEntity.ok().header("Content-Type", CONTENT_TYPE)
            .header("Content-Disposition", "inline; filename=\"" + icsFile.getFileName() + "\"")
            .body(icsFile.getBinary());
}
 
Example 18
Source Project: seppb   Source File: AnalysisController.java    License: MIT License 5 votes vote down vote up
@RequestMapping(value = "/sqa/bugTmsDensity", method =  RequestMethod.POST)
public List<Map<String, Object>> defectTmsDensity(HttpServletRequest request) {
	Map<String, Object> dataMap = new HashMap<>();
	dataMap.put(PRODUCT_ID, request.getParameter(PRODUCT_ID));
	dataMap.put(QRY_TIME_BEGIN, request.getParameter(QRY_TIME_BEGIN) + " 00:00:00");
	dataMap.put(QRY_TIME_END, request.getParameter(QRY_TIME_END) + " 23:59:59");
	return analysisService.defectTmsDensity(dataMap);
}
 
Example 19
Source Project: cicada   Source File: EntityApi.java    License: MIT License 5 votes vote down vote up
/**
 * 分页获取span.
 */
@RequestMapping(value = "/spans", method = RequestMethod.POST)
@ApiOperation(value = ApiDocs.FETCH_SPAN_PAGE, notes = ApiDocs.FETCH_SPAN_PAGE)
public List<SpanModel> fetchSpansPage(@RequestBody final EntityPageRequest request) {
  if (!request.isValid()) {
    log.error("request invalid error : fetch span pages request's param incomplete!");
    throw new BadRequestException(AppError.INCOMPLETE_PAGE_REQUEST_PARAMS);
  }

  return spanService.fetchSpanPage(request);
}
 
Example 20
Source Project: NFVO   Source File: RestNetworkServiceRecord.java    License: Apache License 2.0 5 votes vote down vote up
@ApiOperation(
    value = "Upgrade a Virtual Network Function Record in a NSR",
    notes = "Specify the ids of the parent NSR and of the VNFR which will be upgraded")
@RequestMapping(
    value = "{idNsr}/vnfrecords/{idVnfr}/upgrade",
    method = RequestMethod.POST,
    consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.ACCEPTED)
public void upgradeVnfr(
    @PathVariable("idNsr") String idNsr,
    @PathVariable("idVnfr") String idVnfr,
    @RequestHeader(value = "project-id") String projectId,
    @RequestBody @Valid JsonObject body)
    throws NotFoundException, BadFormatException, BadRequestException, ExecutionException,
        InterruptedException, IOException, VimException, PluginException, VimDriverException {
  NetworkServiceRecord nsr = networkServiceRecordManagement.query(idNsr, projectId);
  VirtualNetworkFunctionRecord vnfRecord =
      networkServiceRecordManagement.getVirtualNetworkFunctionRecord(idNsr, idVnfr, projectId);
  nsr.getVnfr().add(vnfRecord);

  String upgradeRequestEntityKey = "vnfdId";

  if (!body.has(upgradeRequestEntityKey)
      || !body.getAsJsonPrimitive(upgradeRequestEntityKey).isString())
    throw new BadRequestException(
        "The passed JSON is not correct. It should include a string field named: "
            + upgradeRequestEntityKey);

  // String vnfPackageId = body.getAsJsonPrimitive("vnfPackageId").getAsString();
  String upgradeVnfdId = body.getAsJsonPrimitive(upgradeRequestEntityKey).getAsString();

  log.info("Executing UPGRADE for VNFR: " + vnfRecord.getName());

  networkServiceRecordManagement.upgradeVnfr(idNsr, idVnfr, projectId, upgradeVnfdId);
}
 
Example 21
Source Project: fileServer   Source File: ImgController.java    License: Apache License 2.0 5 votes vote down vote up
@ApiOperation(value="上传并裁剪图片", notes="上传并裁剪图片")
@RequestMapping(value = "/uploadCutImg", method = RequestMethod.POST)
public FileServerModel uploadImage(

        @ApiParam(value = "文件流,name=file")
        @RequestParam("file") MultipartFile file,

        @ApiParam(value = "裁剪尺寸(数组类型)如:20x20,30x30,100x100")
        @RequestParam("cutSize") String cutSize) throws ServiceException {
    return imgService.uploadImage(file,cutSize);
}
 
Example 22
Source Project: arctic-sea   Source File: Service.java    License: Apache License 2.0 5 votes vote down vote up
@RequestMapping(method = RequestMethod.DELETE)
public void delete(HttpServletRequest request, HttpServletResponse response) throws IOException {
    Stopwatch stopwatch = Stopwatch.createStarted();
    long currentCount = logRequest(request);
    addVersionHeader(response);
    try {
        getBinding(request).doDeleteOperation(request, response);
    } catch (HTTPException exception) {
        onHttpException(request, response, exception);
    } finally {
        logResponse(request, response, currentCount, stopwatch);
    }
}
 
Example 23
/**
 * Hadoop submit jobs.
 *
 * @param model the model
 * @param clusterId the cluster id
 * @return the string
 */
@RequestMapping(value = "/{clusterName}/{hybridTechnology}/submitJobs/C-D/{clusterId}/{clusterTechnology}", method = RequestMethod.GET)
public String hadoopSubmitJobs(ModelMap model
		,@PathVariable("clusterId") String clusterId
		,@PathVariable("clusterName") String clusterName
		,@PathVariable("clusterTechnology") String clusterTechnology
		,@PathVariable("hybridTechnology") String hybridTechnology) {
	logger.info("Inside Hadoop Submit Jobs view");
	model.addAttribute("clusterId",clusterId);
	model.addAttribute("clusterTechnology",clusterTechnology);
	model.addAttribute("clusterName",clusterName);
	model.addAttribute("hybridTechnology",hybridTechnology);
	model.addAttribute("page","submitJob");
	return "hadoop/monitoring_hadoop/jobSubmission";
}
 
Example 24
/**
 * Updates status of a business object data with 3 subpartition values. <p>Requires WRITE permission on namespace</p>
 *
 * @param namespace the namespace
 * @param businessObjectDefinitionName the business object definition name
 * @param businessObjectFormatUsage the business object format usage
 * @param businessObjectFormatFileType the business object format file type
 * @param businessObjectFormatVersion the business object format version
 * @param partitionValue the partition value
 * @param subPartition1Value the value of the first subpartition
 * @param subPartition2Value the value of the second subpartition
 * @param subPartition3Value the value of the third subpartition
 * @param businessObjectDataVersion the business object data version
 * @param request the business object data status update request
 *
 * @return the business object data status update response
 */
@RequestMapping(
    value = BUSINESS_OBJECT_DATA_STATUS_URI_PREFIX + "/namespaces/{namespace}" +
        "/businessObjectDefinitionNames/{businessObjectDefinitionName}/businessObjectFormatUsages/{businessObjectFormatUsage}" +
        "/businessObjectFormatFileTypes/{businessObjectFormatFileType}/businessObjectFormatVersions/{businessObjectFormatVersion}" +
        "/partitionValues/{partitionValue}/subPartition1Values/{subPartition1Value}/subPartition2Values/{subPartition2Value}" +
        "/subPartition3Values/{subPartition3Value}/businessObjectDataVersions/{businessObjectDataVersion}",
    method = RequestMethod.PUT, consumes = {"application/xml", "application/json"})
@Secured(SecurityFunctions.FN_BUSINESS_OBJECT_DATA_STATUS_PUT)
public BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(@PathVariable("namespace") String namespace,
    @PathVariable("businessObjectDefinitionName") String businessObjectDefinitionName,
    @PathVariable("businessObjectFormatUsage") String businessObjectFormatUsage,
    @PathVariable("businessObjectFormatFileType") String businessObjectFormatFileType,
    @PathVariable("businessObjectFormatVersion") Integer businessObjectFormatVersion, @PathVariable("partitionValue") String partitionValue,
    @PathVariable("subPartition1Value") String subPartition1Value, @PathVariable("subPartition2Value") String subPartition2Value,
    @PathVariable("subPartition3Value") String subPartition3Value, @PathVariable("businessObjectDataVersion") Integer businessObjectDataVersion,
    @RequestBody BusinessObjectDataStatusUpdateRequest request)
{
    // Update status of the business object data.
    BusinessObjectDataStatusUpdateResponse businessObjectDataStatusUpdateResponse = businessObjectDataStatusService.updateBusinessObjectDataStatus(
        new BusinessObjectDataKey(namespace, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType,
            businessObjectFormatVersion, partitionValue, Arrays.asList(subPartition1Value, subPartition2Value, subPartition3Value),
            businessObjectDataVersion), request);

    // Create business object data notification.
    notificationEventService.processBusinessObjectDataNotificationEventAsync(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG,
        businessObjectDataStatusUpdateResponse.getBusinessObjectDataKey(), businessObjectDataStatusUpdateResponse.getStatus(),
        businessObjectDataStatusUpdateResponse.getPreviousStatus());

    return businessObjectDataStatusUpdateResponse;
}
 
Example 25
Source Project: Spring   Source File: HomeController.java    License: Apache License 2.0 5 votes vote down vote up
@RequestMapping(value="/logout", method = RequestMethod.GET)
  public ModelAndView logout(SecurityContextHolder sch, HttpServletRequest request) throws ServletException {
  	final ModelAndView mav = new ModelAndView("home");
      request.logout(); // clearing security context the application #1

  	//sch.getContext().setAuthentication(null); clearing security context the application #2
//sch.clearContext(); clearing security context the application #3
      return mav;
  }
 
Example 26
@RequestMapping(value = "/nodeMaintenance", method = RequestMethod.GET)
public String nodeMaintenance(ModelMap model,@RequestParam("clusterId") String clusterId,@RequestParam("host") String host) {	
	model.addAttribute("title", "nodeMaintenance");
	model.addAttribute("clusterId", clusterId);
	model.addAttribute("host", host);
	return "dashboard/nodeMaintenance";
}
 
Example 27
/**
 * Fetch restaurants with the specified name. A partial case-insensitive
 * match is supported. So <code>http://.../restaurants/rest</code> will find
 * any restaurants with upper or lower case 'rest' in their name.
 *
 * @param name
 * @return A non-null, non-empty collection of restaurants.
 */
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<Collection<Restaurant>> findByName(@RequestParam("name") String name) {
    logger.info(String.format("restaurant-service findByName() invoked:{} for {} ", restaurantService.getClass().getName(), name));
    name = name.trim().toLowerCase();
    Collection<Restaurant> restaurants;
    try {
        restaurants = restaurantService.findByName(name);
    } catch (Exception ex) {
        logger.log(Level.SEVERE, "Exception raised findByName REST Call", ex);
        return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
    }
    return restaurants.size() > 0 ? new ResponseEntity<>(restaurants, HttpStatus.OK)
            : new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
 
Example 28
Source Project: qconfig   Source File: ActionController.java    License: MIT License 5 votes vote down vote up
@RequestMapping(value = "/publish", method = RequestMethod.POST)
@ResponseBody
public Object publish(@RequestBody CandidateDTO candidate) {
    logger.info("publish with {}", candidate);
    checkCandidate(candidate);
    Monitor.PUBLISH_STATICS.inc();
    try {
        applyService.publish(candidate, "");
        return JsonV2.success();
    } catch (Exception e) {
        return handleException(candidate, e);
    }
}
 
Example 29
@RequestMapping(value="/", method=RequestMethod.GET)
public String greetingForm(Model model) {
	SearchQuery query = new  SearchQuery("NYC","SFO","22-JAN-18");
	UIData uiData = new UIData();
	uiData.setSearchQuery(query);
    model.addAttribute("uidata",uiData );
    return "search";
}
 
Example 30
Source Project: Spring-MVC-Blueprints   Source File: AdminLoginController.java    License: MIT License 5 votes vote down vote up
@RequestMapping(method=RequestMethod.GET)
public String initForm(Model model, HttpServletRequest req){
	LoginForm adminLoginForm = new LoginForm();
	
	model.addAttribute("adminLoginForm", adminLoginForm);
	return "admin_login_form";
	
}