@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(); }
@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; }
@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); } } }