コード例 #1
0
 @GET
 @Transactional(readOnly = true)
 public Response getTeamResource(@PathParam("teamName") final String teamName) {
   final List<Sprint> sprints = this.sprintAPI.getSprintsForTeam(teamName);
   for (final Sprint sprint : sprints) {
     sprint.getRemoteReferences().size();
     sprint.getParticipants();
     sprint.getUserStories().size();
   }
   return Response.status(Response.Status.OK)
       .entity(new GenericEntity<List<Sprint>>(sprints) {})
       .build();
 }
コード例 #2
0
  @Override
  @Transactional
  public Sprint createNewSprintForTeam(final String teamName, final Date startDate) {
    final Sprint newSprint = new Sprint();
    newSprint.setTeamName(teamName);
    newSprint.setStartDate(startDate);

    final List<Sprint> possibleSprints = this.getSprintsForTeam(teamName);
    newSprint.setSprintKey("S" + (possibleSprints.size() + 1));

    LOGGER.info(
        "Created a new sprint for team \"" + teamName + "\" as key: " + newSprint.getSprintKey());

    this.entityManager.persist(newSprint);
    return newSprint;
  }
コード例 #3
0
  @Override
  @Transactional
  public void updateRemote(Sprint sprint) {
    final Map<String, SprintProvider> sprintProviderMap;
    sprintProviderMap = new HashMap<>();

    for (final SprintProvider provider : this.sprintProviders) {
      sprintProviderMap.put(provider.getSystemId(), provider);
    }

    for (final RemoteReference reference : sprint.getRemoteReferences()) {
      if (reference.isDirty()) {
        sprintProviderMap.get(reference.getSystemId()).refreshSprint(sprint);
      }
    }
  }