Tabnine Logo
ProjectQueryService.findBy
Code IndexAdd Tabnine to your IDE (free)

How to use
findBy
method
in
com.clusterra.pmbok.project.application.ProjectQueryService

Best Java code snippets using com.clusterra.pmbok.project.application.ProjectQueryService.findBy (Showing top 8 results out of 315)

origin: com.clusterra/clusterra-pmbok-rest-api

@RequestMapping(value = "/search", method = RequestMethod.GET)
public ResponseEntity<PagedResources<ProjectResource>> searchProjects(
    @PageableDefault Pageable pageable,
    @RequestParam(required = false) String searchBy,
    PagedResourcesAssembler<Project> assembler) throws NotAuthenticatedException {
  Page<Project> pageResult = projectQueryService.findBy(pageable, searchBy);
  PagedResources<ProjectResource> resources = assembler.toResource(pageResult, projectResourceAssembler);
  return new ResponseEntity<>(resources, HttpStatus.OK);
}
origin: com.clusterra/clusterra-pmbok-rest-api

@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseEntity<ProjectResource> get(@PathVariable String id) throws ProjectNotFoundException {
  Project project = projectQueryService.findBy(new ProjectId(id));
  return new ResponseEntity<>(projectResourceAssembler.toResource(project), HttpStatus.OK);
}
origin: com.clusterra/pmbok-rest-api

@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public ResponseEntity<ProjectResource> get(@PathVariable String id) throws ProjectNotFoundException {
  Project project = projectQueryService.findBy(new ProjectId(id));
  return new ResponseEntity<>(projectResourceAssembler.toResource(project), HttpStatus.OK);
}
origin: com.clusterra/pmbok-rest-api

@RequestMapping(value = "/search", method = RequestMethod.GET)
public ResponseEntity<PagedResources<ProjectResource>> searchProjects(
    @PageableDefault Pageable pageable,
    @RequestParam(required = false) String searchBy,
    PagedResourcesAssembler<Project> assembler) throws NotAuthenticatedException {
  Page<Project> pageResult = projectQueryService.findBy(pageable, searchBy);
  PagedResources<ProjectResource> resources = assembler.toResource(pageResult, projectResourceAssembler);
  return new ResponseEntity<>(resources, HttpStatus.OK);
}
origin: com.clusterra/clusterra-pmbok-rest-api

@RequestMapping(value = "/{id}/stakeholders/{stakeholderId}", method = RequestMethod.DELETE)
public ResponseEntity<ProjectResource> removeStakeholder(@PathVariable String id, @PathVariable String stakeholderId) throws ProjectNotFoundException, BindException {
  Project project = projectQueryService.findBy(new ProjectId(id));
  Stakeholder toRemove = null;
  for (Stakeholder stakeholder : project.getStakeholders()) {
    if (stakeholder.getId().equals(stakeholderId)) {
      toRemove = stakeholder;
      break;
    }
  }
  if (toRemove != null) {
    project = projectCommandService.removeStakeholder(new ProjectId(id), toRemove);
  }
  return new ResponseEntity<>(projectResourceAssembler.toResource(project), HttpStatus.OK);
}
origin: com.clusterra/pmbok-rest-api

@RequestMapping(value = "/{id}/stakeholders/{stakeholderId}", method = RequestMethod.DELETE)
public ResponseEntity<ProjectResource> removeStakeholder(@PathVariable String id, @PathVariable String stakeholderId) throws ProjectNotFoundException, BindException {
  Project project = projectQueryService.findBy(new ProjectId(id));
  Stakeholder toRemove = null;
  for (Stakeholder stakeholder : project.getStakeholders()) {
    if (stakeholder.getId().equals(stakeholderId)) {
      toRemove = stakeholder;
      break;
    }
  }
  if (toRemove != null) {
    project = projectCommandService.removeStakeholder(new ProjectId(id), toRemove);
  }
  return new ResponseEntity<>(projectResourceAssembler.toResource(project), HttpStatus.OK);
}
origin: com.clusterra/clusterra-pmbok-rest-api

@RequestMapping(value = "/{id}/stakeholders", method = RequestMethod.POST)
public ResponseEntity<ProjectResource> addStakeholder(@PathVariable String id, @RequestBody StakeholderPod pod, BindingResult bindingResult) throws ProjectNotFoundException, BindException {
  if (bindingResult.hasErrors()) {
    throw new BindException(bindingResult);
  }
  Project project = projectQueryService.findBy(new ProjectId(id));
  project = projectCommandService.addStakeholder(new ProjectId(id), new Stakeholder(project.getTenantId(), pod.getName(), StakeholderType.INTERNAL, pod.getRole(), StakeholderClassification.NEUTRAL));
  return new ResponseEntity<>(projectResourceAssembler.toResource(project), HttpStatus.OK);
}
origin: com.clusterra/pmbok-rest-api

@RequestMapping(value = "/{id}/stakeholders", method = RequestMethod.POST)
public ResponseEntity<ProjectResource> addStakeholder(@PathVariable String id, @RequestBody StakeholderPod pod, BindingResult bindingResult) throws ProjectNotFoundException, BindException {
  if (bindingResult.hasErrors()) {
    throw new BindException(bindingResult);
  }
  Project project = projectQueryService.findBy(new ProjectId(id));
  project = projectCommandService.addStakeholder(new ProjectId(id), new Stakeholder(project.getTenantId(), pod.getName(), StakeholderType.INTERNAL, pod.getRole(), StakeholderClassification.NEUTRAL));
  return new ResponseEntity<>(projectResourceAssembler.toResource(project), HttpStatus.OK);
}
com.clusterra.pmbok.project.applicationProjectQueryServicefindBy

Popular methods of ProjectQueryService

  • findAllVersionsBy
  • findVersionBy

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • getSystemService (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now