コード例 #1
0
  @Override
  public void delete(String id) {
    logger.info("> delete");

    counterService.increment("services.issueservice.delete.invoked");

    issueRepository.delete(id);

    logger.info("< delete");
  }
コード例 #2
0
  @Override
  public Issue update(Issue issue) {
    logger.info("> update");

    counterService.increment("services.issueservice.update.invoked");

    Issue updatedIssue = issueRepository.save(issue);

    logger.info("< update");
    return updatedIssue;
  }
コード例 #3
0
  @Override
  public Issue find(String id) {
    logger.info("> find id:{}", id);

    counterService.increment("services.issueservice.find.invoked");

    Issue issue = issueRepository.findOne(id);

    logger.info("< find id:{}", id);
    return issue;
  }
コード例 #4
0
  @Override
  public Iterable<Issue> findAll() {
    logger.info("> findAll");

    counterService.increment("services.issueservice.findAll.invoked");

    Iterable<Issue> issues = issueRepository.findAll();

    logger.info("< findAll");
    return issues;
  }
コード例 #5
0
  @Override
  public Issue create(Issue issue) {
    logger.info("> create");

    counterService.increment("services.issueservice.create.invoked");

    // Set default attribute values
    issue.setStatus(IssueStatus.OPEN);

    if (issue.getPriority() == null) {
      issue.setPriority(IssuePriority.MEDIUM);
    }

    Issue persistedIssue = issueRepository.save(issue);

    logger.info("< create");
    return persistedIssue;
  }