Commits

John McDonnell committed a3c8658

Added in the ability to chose National, Under20, Club and Youth team, players fixtures etc...

  • Participants
  • Parent commits 8f5cd4e

Comments (0)

Files changed (27)

             <member.2.id>${member.2.id}</member.2.id>
             <player.1.id>${player.1.id}</player.1.id>
             <player.2.id>${player.2.id}</player.2.id>
+            <player.national.id>${player.national.id}</player.national.id>
+            <player.undertwenty.id>${player.undertwenty.id}</player.undertwenty.id>
+            <player.youth.id>${player.youth.id}</player.youth.id>
             <standing.id>${standing.id}</standing.id>
           </systemPropertyVariables>
         </configuration>

src/main/java/org/jmcdonnell/blackoutrugby/BlackoutApi.java

     
     //<editor-fold defaultstate="collapsed" desc="Team Related API Methods">
     @Override
-    public Team getTeamById(Long teamId) throws BlackoutException {
-        return teamService.getTeamById(teamId);
+    public Team getTeamById(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return teamService.getTeamById(teamId, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<Team> getTeamsByIds(List<Long> teamIds) throws BlackoutException {
-        return teamService.getTeamsByIds(teamIds);
+    public List<Team> getTeamsByIds(List<Long> teamIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return teamService.getTeamsByIds(teamIds, isNationalTeam, isYouthTeam);
     }
     //</editor-fold>
     
     //<editor-fold defaultstate="collapsed" desc="Player Related API Methods">
     @Override
-    public Player getPlayerById(Long playerId) throws BlackoutException {
-        return playerService.getPlayerById(playerId);
+    public Player getPlayerById(Long playerId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return playerService.getPlayerById(playerId, isNationalTeam, isYouthTeam);
     }
     
     @Override
-    public List<Player> getPlayersByIds(List<Long> playerIds) throws BlackoutException {
-        return playerService.getPlayersByIds(playerIds);
+    public List<Player> getPlayersByIds(List<Long> playerIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return playerService.getPlayersByIds(playerIds, isNationalTeam, isYouthTeam);
     }
     
     @Override
-    public List<Player> getPlayersInTeamSquad(Long teamId) throws BlackoutException {
-        return playerService.getPlayersInTeamSquad(teamId);
+    public List<Player> getPlayersInTeamSquad(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return playerService.getPlayersInTeamSquad(teamId, isNationalTeam, isYouthTeam);
     }
     //</editor-fold>
 
     //<editor-fold defaultstate="collapsed" desc="Fixture Related API Methods">
     @Override
-    public Fixture getFixtureById(Long fixtureId) throws BlackoutException {
-        return fixtureService.getFixtureById(fixtureId);
+    public Fixture getFixtureById(Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return fixtureService.getFixtureById(fixtureId, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<Fixture> getFixturesByIds(List<Long> fixtureIds) throws BlackoutException {
-        return fixtureService.getFixturesByIds(fixtureIds);
+    public List<Fixture> getFixturesByIds(List<Long> fixtureIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return fixtureService.getFixturesByIds(fixtureIds, isNationalTeam, isYouthTeam);
     }
     //</editor-fold>
     
     //<editor-fold defaultstate="collapsed" desc="Standing Related API Methods">
     @Override
-    public List<Standing> getStandingsForLeagueId(Long leagueId) throws BlackoutException {
-        return standingService.getStandingsForLeagueId(leagueId);
+    public List<Standing> getStandingsForLeagueId(Long leagueId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return standingService.getStandingsForLeagueId(leagueId, isNationalTeam, isYouthTeam);
     }
     //</editor-fold>
 
     //<editor-fold defaultstate="collapsed" desc="Statistics Related API Methods">
     @Override
-    public PlayerStatistics getPlayerStatisticsByPlayerId(Long playerId) throws BlackoutException {
-        return statisticsService.getPlayerStatisticsByPlayerId(playerId);
+    public PlayerStatistics getPlayerStatisticsByPlayerId(Long playerId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return statisticsService.getPlayerStatisticsByPlayerId(playerId, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<PlayerStatistics> getPlayerStatisticsByPlayerIds(List<Long> playerIds) throws BlackoutException {
-        return statisticsService.getPlayerStatisticsByPlayerIds(playerIds);
+    public List<PlayerStatistics> getPlayerStatisticsByPlayerIds(List<Long> playerIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return statisticsService.getPlayerStatisticsByPlayerIds(playerIds, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public TeamStatistics getTeamStatisticsByTeamId(Long teamId) throws BlackoutException {
-        return statisticsService.getTeamStatisticsByTeamId(teamId);
+    public TeamStatistics getTeamStatisticsByTeamId(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return statisticsService.getTeamStatisticsByTeamId(teamId, isNationalTeam, isYouthTeam);
     }
     //</editor-fold>
 
     //<editor-fold defaultstate="collapsed" desc="Lineup Related API Methods">
     @Override
-    public Lineup getDefaultLineupForTeam(Long teamId) throws BlackoutException {
-        return lineupService.getDefaultLineupForTeam(teamId);
+    public Lineup getDefaultLineupForTeam(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return lineupService.getDefaultLineupForTeam(teamId, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public Lineup getLineUpForTeamFromFixture(Long teamId, Long fixtureId) throws BlackoutException {
-        return lineupService.getLineUpForTeamFromFixture(teamId, fixtureId);
+    public Lineup getLineUpForTeamFromFixture(Long teamId, Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return lineupService.getLineUpForTeamFromFixture(teamId, fixtureId, isNationalTeam, isYouthTeam);
     }
     //</editor-fold>
 }

src/main/java/org/jmcdonnell/blackoutrugby/requests/RequestManager.java

 import org.jmcdonnell.blackoutrugby.exceptions.BlackoutLoginException;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 import javax.crypto.Cipher;
 
         LOG.debug(responseBody);
 
-        return responseBody;
+        return new String(responseBody.getBytes(), Charset.forName("UTF-8"));
     }
     
     private String sendHttpPost(String url, String request) throws IOException {
 
         return responseBody;
     }
-
-    public <T extends AbstractBlackoutEntity> T getEntityFromApi(Long entityId, Class<T> entityType) throws BlackoutException {
-        
-        RequestBuilder builder = null;
-        
-        builder = initRequestBuilderByEntityType(entityType, builder);
-        
-        builder.addId(entityId);
-        BlackoutApiResponse sendApiEntityRequest = sendApiEntityRequest(builder.build());
-        
-        // there should always only be one entity in the list, so we should only
-        // return the first entity from the list.
-        return (T) sendApiEntityRequest.getEntities().get(0);
-    }
     
     public <T extends AbstractBlackoutEntity> T getEntityFromApi(Long entityId, Class<T> entityType,
             Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
     
     public <T extends AbstractBlackoutEntity> List<T> getEntitiesFromApi(
             List<Long> entitiesId,
-            Class<T> entityType) throws BlackoutException {
+            Class<T> entityType, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
         
         RequestBuilder builder = null;
                 
         builder = initRequestBuilderByEntityType(entityType, builder);
         
         builder.addIds(entitiesId);
+        builder.addTeamSettings(isNationalTeam, isYouthTeam);
         BlackoutApiResponse sendApiEntityRequest = sendApiEntityRequest(builder.build());
         
         return (List<T>) sendApiEntityRequest.getEntities();
     }
 
     public <T extends AbstractBlackoutEntity> List<T> getListOfEntityByIdFromApi(
-            Long entityId, Class<T> entityType) throws BlackoutException {
+            Long entityId, Class<T> entityType, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
         
         RequestBuilder builder = null;
                 
         builder = initRequestBuilderByEntityType(entityType, builder);
         
         builder.addId(entityId);
+        builder.addTeamSettings(isNationalTeam, isYouthTeam);
         BlackoutApiResponse sendApiEntityRequest = sendApiEntityRequest(builder.build());
 
         return (List<T>) sendApiEntityRequest.getEntities();
     }
     
-    List<Player> getPlayersByTeamId(Long teamId) throws BlackoutException {
-        List<Player> players = new ArrayList<Player>();
+    public List<Player> getPlayersByTeamId(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        List<Player> players = new ArrayList<>();
         
         RequestBuilder builder = RequestBuilder.initBuilderForPlayersByTeam();
         
         builder.addId(teamId);
-            
+        builder.addTeamSettings(isNationalTeam, isYouthTeam);
         BlackoutApiResponse sendApiEntityRequest = sendApiEntityRequest(builder.build());
         
         for(AbstractBlackoutEntity player :sendApiEntityRequest.getEntities())
         return builder;
     }
 
-    public Lineup getLineupForTeamAndFixture(Long teamId, Long fixtureId) throws BlackoutException {
+    public Lineup getLineupForTeamAndFixture(Long teamId, Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
         RequestBuilder builder = null;
                 
         builder = RequestBuilder.initBuilderForLineups();
         
         builder.addId(teamId);
         builder.andAddFixtureId(fixtureId);
+        builder.addTeamSettings(isNationalTeam, isYouthTeam);
         BlackoutApiResponse sendApiEntityRequest = sendApiEntityRequest(builder.build());
         
         return (Lineup) sendApiEntityRequest.getEntities().get(0);
     }
-
-    public List<Player> getSquadForTeamId(Long teamId) {
-        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/fixtures/IFixtureService.java

  * @author john
  */
 public interface IFixtureService {
-     Fixture getFixtureById(Long fixtureId) throws BlackoutException;
+     Fixture getFixtureById(Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-     List<Fixture> getFixturesByIds(List<Long> fixtureIds) throws BlackoutException;
+     List<Fixture> getFixturesByIds(List<Long> fixtureIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/fixtures/IFixtureServiceImpl.java

     @Inject private RequestManager requestManager;
     
     @Override
-    public Fixture getFixtureById(Long fixtureId) throws BlackoutException {
-        return requestManager.getEntityFromApi(fixtureId, Fixture.class);
+    public Fixture getFixtureById(Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntityFromApi(fixtureId, Fixture.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<Fixture> getFixturesByIds(List<Long> fixtureIds) throws BlackoutException {
-        return requestManager.getEntitiesFromApi(fixtureIds, Fixture.class);
+    public List<Fixture> getFixturesByIds(List<Long> fixtureIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntitiesFromApi(fixtureIds, Fixture.class, isNationalTeam, isYouthTeam);
     }
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/lineups/ILineupService.java

  */
 public interface ILineupService {
     
-    Lineup getDefaultLineupForTeam(Long teamId) throws BlackoutException;
+    Lineup getDefaultLineupForTeam(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-    Lineup getLineUpForTeamFromFixture(Long teamId, Long fixtureId) throws BlackoutException;
+    Lineup getLineUpForTeamFromFixture(Long teamId, Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/lineups/ILineupServiceImpl.java

     @Inject private RequestManager requestManager;
     
     @Override
-    public Lineup getDefaultLineupForTeam(Long teamId) throws BlackoutException {
-        return requestManager.getEntityFromApi(teamId, Lineup.class);
+    public Lineup getDefaultLineupForTeam(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntityFromApi(teamId, Lineup.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public Lineup getLineUpForTeamFromFixture(Long teamId, Long fixtureId) throws BlackoutException {
-        return requestManager.getLineupForTeamAndFixture(teamId, fixtureId);
+    public Lineup getLineUpForTeamFromFixture(Long teamId, Long fixtureId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getLineupForTeamAndFixture(teamId, fixtureId, isNationalTeam, isYouthTeam);
     }
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/members/IMemberServiceImpl.java

     
     @Override
     public Member getMemberById(Long memberId) throws BlackoutException {
-        return requestManager.getEntityFromApi(memberId, Member.class);
+        return requestManager.getEntityFromApi(memberId, Member.class, Boolean.FALSE, Boolean.FALSE);
     }
 
     @Override
     public List<Member> getMembersByIds(List<Long> memberIds) throws BlackoutException {
-        return requestManager.getEntitiesFromApi(memberIds, Member.class);
+        return requestManager.getEntitiesFromApi(memberIds, Member.class, Boolean.FALSE, Boolean.FALSE);
     }
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/players/IPlayerService.java

  */
 public interface IPlayerService {
     
-    Player getPlayerById(Long playerId) throws BlackoutException;
+    Player getPlayerById(Long playerId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-    List<Player> getPlayersByIds(List<Long> playerIds) throws BlackoutException;
+    List<Player> getPlayersByIds(List<Long> playerIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-    List<Player> getPlayersInTeamSquad(Long teamId) throws BlackoutException;
+    List<Player> getPlayersInTeamSquad(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/players/IPlayerServiceImpl.java

     @Inject private RequestManager requestManager;
     
     @Override
-    public Player getPlayerById(Long playerId) throws BlackoutException {
-        return requestManager.getEntityFromApi(playerId, Player.class);
+    public Player getPlayerById(Long playerId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntityFromApi(playerId, Player.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<Player> getPlayersByIds(List<Long> playerIds) throws BlackoutException {
-        return requestManager.getEntitiesFromApi(playerIds, Player.class);
+    public List<Player> getPlayersByIds(List<Long> playerIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntitiesFromApi(playerIds, Player.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<Player> getPlayersInTeamSquad(Long teamId) throws BlackoutException {
-        return requestManager.getSquadForTeamId(teamId);
+    public List<Player> getPlayersInTeamSquad(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getPlayersByTeamId(teamId, isNationalTeam, isYouthTeam);
     }
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/standing/IStandingService.java

  */
 public interface IStandingService {
     
-    List<Standing> getStandingsForLeagueId(Long leagueId) throws BlackoutException;
+    List<Standing> getStandingsForLeagueId(Long leagueId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/standing/IStandingServiceImpl.java

     @Inject private RequestManager requestManager;
     
     @Override
-    public List<Standing> getStandingsForLeagueId(Long leagueId) throws BlackoutException {
-        return requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class);
+    public List<Standing> getStandingsForLeagueId(Long leagueId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class, isNationalTeam, isYouthTeam);
     }
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/statistics/IStatisticsService.java

  */
 public interface IStatisticsService {
     
-    PlayerStatistics getPlayerStatisticsByPlayerId(Long playerId) throws BlackoutException;
+    PlayerStatistics getPlayerStatisticsByPlayerId(Long playerId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-    List<PlayerStatistics> getPlayerStatisticsByPlayerIds(List<Long>playerIds) throws BlackoutException;
+    List<PlayerStatistics> getPlayerStatisticsByPlayerIds(List<Long>playerIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-    TeamStatistics getTeamStatisticsByTeamId(Long teamId) throws BlackoutException;
+    TeamStatistics getTeamStatisticsByTeamId(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/statistics/IStatisticsServiceImpl.java

     @Inject private RequestManager requestManager;
     
     @Override
-    public PlayerStatistics getPlayerStatisticsByPlayerId(Long playerId) throws BlackoutException {
-        return requestManager.getEntityFromApi(playerId, PlayerStatistics.class);
+    public PlayerStatistics getPlayerStatisticsByPlayerId(Long playerId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntityFromApi(playerId, PlayerStatistics.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<PlayerStatistics> getPlayerStatisticsByPlayerIds(List<Long> playerIds) throws BlackoutException {
-        return requestManager.getEntitiesFromApi(playerIds, PlayerStatistics.class);
+    public List<PlayerStatistics> getPlayerStatisticsByPlayerIds(List<Long> playerIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntitiesFromApi(playerIds, PlayerStatistics.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public TeamStatistics getTeamStatisticsByTeamId(Long teamId) throws BlackoutException {
-        return requestManager.getEntityFromApi(teamId, TeamStatistics.class);
+    public TeamStatistics getTeamStatisticsByTeamId(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntityFromApi(teamId, TeamStatistics.class, isNationalTeam, isYouthTeam);
     }
 
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/team/ITeamService.java

  */
 public interface ITeamService {
     
-    Team getTeamById(Long teamId) throws BlackoutException;
+    Team getTeamById(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
     
-    List<Team> getTeamsByIds(List<Long> teamIds) throws BlackoutException;
+    List<Team> getTeamsByIds(List<Long> teamIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException;
 }

src/main/java/org/jmcdonnell/blackoutrugby/services/team/ITeamServiceImpl.java

     @Inject private RequestManager requestManager;
     
     @Override
-    public Team getTeamById(Long teamId) throws BlackoutException {
-        return requestManager.getEntityFromApi(teamId, Team.class);
+    public Team getTeamById(Long teamId, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntityFromApi(teamId, Team.class, isNationalTeam, isYouthTeam);
     }
 
     @Override
-    public List<Team> getTeamsByIds(List<Long> teamIds) throws BlackoutException {
-        return requestManager.getEntitiesFromApi(teamIds, Team.class);
+    public List<Team> getTeamsByIds(List<Long> teamIds, Boolean isNationalTeam, Boolean isYouthTeam) throws BlackoutException {
+        return requestManager.getEntitiesFromApi(teamIds, Team.class, isNationalTeam, isYouthTeam);
     }
 }

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerFixtureTest.java

     }
     
     @Test
-    public void testGetSingleFixtureByIdNotNull() throws BlackoutException
+    public void testGetNationalFixtureByIdNotNull() throws BlackoutException
     {
         Fixture fixture 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("fixture.1.id")), Fixture.class);
+            = requestManager.getEntityFromApi(new Long(6537), Fixture.class, Boolean.TRUE, Boolean.FALSE);
+        
+        assertNotNull(fixture);
+    }
+    
+    @Test
+    public void testGetUnderTwentyFixtureByIdNotNull() throws BlackoutException
+    {
+        Fixture fixture 
+            = requestManager.getEntityFromApi(new Long(3716), Fixture.class, Boolean.TRUE, Boolean.TRUE);
+        
+        assertNotNull(fixture);
+    }
+    
+    @Test
+    public void testGetClubFixtureByIdNotNull() throws BlackoutException
+    {
+        Fixture fixture 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("fixture.1.id")), Fixture.class, Boolean.FALSE, Boolean.FALSE);
+        
+        assertNotNull(fixture);
+    }
+    
+    @Test
+    public void testGetYouthFixtureByIdNotNull() throws BlackoutException
+    {
+        Fixture fixture 
+            = requestManager.getEntityFromApi(new Long(10023659), Fixture.class, Boolean.FALSE, Boolean.TRUE);
         
         assertNotNull(fixture);
     }
         fixtureIds.add(new Long(System.getProperty("fixture.1.id")));
         fixtureIds.add(new Long(System.getProperty("fixture.2.id")));
         List<Fixture> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(fixtureIds, Fixture.class);
+            = requestManager.getEntitiesFromApi(fixtureIds, Fixture.class, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entitiesFromApi);
     }
     public void testContentsOfSingleFixtureById() throws BlackoutException
     {
         Fixture fixture 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("fixture.1.id")), Fixture.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("fixture.1.id")), Fixture.class, Boolean.FALSE, Boolean.FALSE);
                 
         assertNotNull(fixture.getBotMatch());
         assertNotNull(fixture.getCompetition());
         fitureIds.add(new Long(System.getProperty("fixture.1.id")));
         fitureIds.add(new Long(System.getProperty("fixture.2.id")));
         List<Fixture> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(fitureIds, Fixture.class);
+            = requestManager.getEntitiesFromApi(fitureIds, Fixture.class, Boolean.FALSE, Boolean.FALSE);
             
         Fixture fixture1 = entitiesFromApi.get(0);
         Fixture fixture2 = entitiesFromApi.get(1);

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerLineupsTest.java

     }
     
     @Test
-    public void testGetDefaultLineupNotNull() throws BlackoutException
+    public void testGetClubLineupNotNull() throws BlackoutException
     {
         Lineup team 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Lineup.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Lineup.class, Boolean.FALSE, Boolean.FALSE);
+        
+        assertNotNull(team);
+    }
+    
+    @Test
+    public void testGetYouthLineupNotNull() throws BlackoutException
+    {
+        Lineup team 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Lineup.class, Boolean.FALSE, Boolean.TRUE);
         
         assertNotNull(team);
     }
     public void testGetDefaultLineup() throws BlackoutException
     {
         Lineup lineup 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Lineup.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Lineup.class, Boolean.FALSE, Boolean.FALSE);
         
         assertNotNull(lineup.getB1());
         assertNotNull(lineup.getB2());
         Long teamId = new Long(System.getProperty("member.team.id"));
         Long fixtureId = new Long(System.getProperty("match.saved.id"));
         Lineup entityFromApi 
-            = requestManager.getLineupForTeamAndFixture(teamId, fixtureId);
+            = requestManager.getLineupForTeamAndFixture(teamId, fixtureId, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entityFromApi);
     }
         Long teamId = new Long(System.getProperty("member.team.id"));
         Long fixtureId = new Long(System.getProperty("match.saved.id"));
         Lineup lineup 
-            = requestManager.getLineupForTeamAndFixture(teamId, fixtureId);
+            = requestManager.getLineupForTeamAndFixture(teamId, fixtureId, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(lineup.getB1());
         assertNotNull(lineup.getB2());

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerMatchEventTest.java

     }
     
     @Test
-    public void testGetMultipleEventsByMatchIdNotNull() throws BlackoutException
+    public void testGetMatchCommentaryForNationalMatchIdNotNull() throws BlackoutException
+    {
+        Long fixtureId = new Long(6537);
+        List<MatchEvent> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class, Boolean.TRUE, Boolean.FALSE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetMatchCommentaryForUnderTwentyMatchIdNotNull() throws BlackoutException
+    {
+        Long fixtureId = new Long(3716);
+        List<MatchEvent> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class, Boolean.TRUE, Boolean.TRUE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetMatchCommentaryForClubMatchIdNotNull() throws BlackoutException
     {
         Long fixtureId = new Long(System.getProperty("match.saved.id"));
         List<MatchEvent> entitiesFromApi 
-            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class);
+            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class, Boolean.FALSE, Boolean.FALSE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetMatchCommentaryForYouthMatchIdNotNull() throws BlackoutException
+    {
+        Long fixtureId = new Long(10023659);
+        List<MatchEvent> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class, Boolean.FALSE, Boolean.TRUE);
             
         assertNotNull(entitiesFromApi);
     }
     {
         Long fixtureId = new Long(System.getProperty("match.saved.id"));
         List<MatchEvent> entitiesFromApi 
-            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class);
+            = requestManager.getListOfEntityByIdFromApi(fixtureId, MatchEvent.class, Boolean.FALSE, Boolean.FALSE);
             
         assertTrue(entitiesFromApi.size() > 0);
         MatchEvent get = entitiesFromApi.get(0);

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerMatchScoreTest.java

     }
     
     @Test
-    public void testGetMatchScoreByIdNotNull() throws BlackoutException
+    public void testGetNationalMatchScoreByIdNotNull() throws BlackoutException
     {
         MatchScore team 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("match.saved.id")), MatchScore.class);
+            = requestManager.getEntityFromApi(new Long(6537), MatchScore.class, Boolean.TRUE, Boolean.FALSE);
+        assertNotNull(team);
+    }
+    
+    @Test
+    public void testGetUnderTwentyMatchScoreByIdNotNull() throws BlackoutException
+    {
+        MatchScore team 
+            = requestManager.getEntityFromApi(new Long(3716), MatchScore.class, Boolean.TRUE, Boolean.TRUE);
+        
+        assertNotNull(team);
+    }
+    
+    @Test
+    public void testGetClubMatchScoreByIdNotNull() throws BlackoutException
+    {
+        MatchScore team 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("match.saved.id")), MatchScore.class, Boolean.FALSE, Boolean.FALSE);
+        
+        assertNotNull(team);
+    }
+    
+    @Test
+    public void testGetYouthMatchScoreByIdNotNull() throws BlackoutException
+    {
+        MatchScore team 
+            = requestManager.getEntityFromApi(new Long(10023659), MatchScore.class, Boolean.FALSE, Boolean.TRUE);
         
         assertNotNull(team);
     }
     public void testGetMatchScoreById() throws BlackoutException
     {
         MatchScore matchScore 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("match.saved.id")), MatchScore.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("match.saved.id")), MatchScore.class, Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(matchScore.isMatchStarted());
         assertTrue(matchScore.isMatchFinished());

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerMemberTest.java

     public void testGetMemberByIdNotNull() throws BlackoutException
     {
         Member member 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.1.id")), Member.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.1.id")), Member.class, Boolean.FALSE, Boolean.FALSE);
         
         assertNotNull(member);
     }
         memberIds.add(new Long(System.getProperty("member.1.id")));
         memberIds.add(new Long(System.getProperty("member.2.id")));
         List<Member> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, Member.class);
+            = requestManager.getEntitiesFromApi(memberIds, Member.class, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entitiesFromApi);
     }
     public void testGetMemberByIdCorrectMember() throws BlackoutException
     {
         Member member 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.1.id")), Member.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.1.id")), Member.class, Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(member.getMemberId().equals(new Long(System.getProperty("member.1.id"))));
         assertNotNull(member.getUserName());
         memberIds.add(new Long(System.getProperty("member.1.id")));
         memberIds.add(new Long(System.getProperty("member.2.id")));
         List<Member> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, Member.class);
+            = requestManager.getEntitiesFromApi(memberIds, Member.class, Boolean.FALSE, Boolean.FALSE);
             
         Member member1 = entitiesFromApi.get(0);
         Member member2 = entitiesFromApi.get(1);

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerPlayerHistoryTest.java

     }
     
     @Test
-    public void testGetPlayerHistoryByIdNotNull() throws BlackoutException
+    public void testGetNationalPlayerHistoryByIdNotNull() throws BlackoutException
+    {
+        Long playerId = new Long(System.getProperty("player.national.id"));
+        List<PlayerHistory> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(playerId, PlayerHistory.class, Boolean.TRUE, Boolean.TRUE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetUnderTwentyPlayerHistoryByIdNotNull() throws BlackoutException
+    {
+        Long playerId = new Long(System.getProperty("player.undertwenty.id"));
+        List<PlayerHistory> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(playerId, PlayerHistory.class, Boolean.TRUE, Boolean.FALSE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetClubPlayerHistoryByIdNotNull() throws BlackoutException
     {
         Long playerId = new Long(System.getProperty("player.1.id"));
         List<PlayerHistory> entitiesFromApi 
-            = requestManager.getListOfEntityByIdFromApi(playerId, PlayerHistory.class);
+            = requestManager.getListOfEntityByIdFromApi(playerId, PlayerHistory.class, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entitiesFromApi);
     }
     {
         Long playerId = new Long(System.getProperty("player.1.id"));
         List<PlayerHistory> entitiesFromApi 
-            = requestManager.getListOfEntityByIdFromApi(playerId, PlayerHistory.class);
+            = requestManager.getListOfEntityByIdFromApi(playerId, PlayerHistory.class, Boolean.FALSE, Boolean.FALSE);
             
         assertTrue(entitiesFromApi.size() > 0);
         PlayerHistory get = entitiesFromApi.get(0);

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerPlayerStatisiticsTest.java

     }
     
     @Test
-    public void testGetPlayerStatisticsByIdNotNull() throws BlackoutException
+    public void testGetNationalPlayerStatisticsByIdNotNull() throws BlackoutException
     {
-        PlayerStatistics playerStats 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), PlayerStatistics.class);
+        PlayerStatistics player 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.national.id")), PlayerStatistics.class, Boolean.TRUE, Boolean.FALSE);
+        
+        assertNotNull(player);
+    }
+    
+    @Test
+    public void testGetUnderTwentyPlayerStatisticsByIdNotNull() throws BlackoutException
+    {
+        PlayerStatistics player 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.undertwenty.id")), PlayerStatistics.class, Boolean.TRUE, Boolean.TRUE);
+        
+        assertNotNull(player);
+    }
+    
+    @Test
+    public void testGetClubPlayerStatisticsByIdNotNull() throws BlackoutException
+    {
+        PlayerStatistics player 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), PlayerStatistics.class, Boolean.FALSE, Boolean.FALSE);
         
-        assertNotNull(playerStats);
+        assertNotNull(player);
     }
     
     @Test
         memberIds.add(new Long(System.getProperty("player.1.id")));
         memberIds.add(new Long(System.getProperty("player.2.id")));
         List<PlayerStatistics> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, PlayerStatistics.class);
+            = requestManager.getEntitiesFromApi(memberIds, PlayerStatistics.class, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entitiesFromApi);
     }
     public void testGetCorrectPlayerStatisticsById() throws BlackoutException
     {
         PlayerStatistics playerStats 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), PlayerStatistics.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), PlayerStatistics.class, Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(playerStats.getPlayerId().equals(new Long(System.getProperty("player.1.id"))));
         assertNotNull(playerStats.getAverageKickingMetres());
         memberIds.add(new Long(System.getProperty("player.1.id")));
         memberIds.add(new Long(System.getProperty("player.2.id")));
         List<PlayerStatistics> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, PlayerStatistics.class);
+            = requestManager.getEntitiesFromApi(memberIds, PlayerStatistics.class, Boolean.FALSE, Boolean.FALSE);
             
         PlayerStatistics playerStats1 = entitiesFromApi.get(0);
         PlayerStatistics playerStats2 = entitiesFromApi.get(1);

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerPlayerTest.java

     }
     
     @Test
-    public void testGetPlayerByIdNotNull() throws BlackoutException
+    public void testGetNationalPlayerByIdNotNull() throws BlackoutException
     {
         Player player 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), Player.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.national.id")), Player.class, Boolean.TRUE, Boolean.FALSE);
+        
+        assertNotNull(player);
+    }
+    
+    @Test
+    public void testGetUnderTwentyPlayerByIdNotNull() throws BlackoutException
+    {
+        Player player 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.undertwenty.id")), Player.class, Boolean.TRUE, Boolean.TRUE);
+        
+        assertNotNull(player);
+    }
+    
+    @Test
+    public void testGetClubPlayerByIdNotNull() throws BlackoutException
+    {
+        Player player 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), Player.class, Boolean.FALSE, Boolean.FALSE);
+        
+        assertNotNull(player);
+    }
+    
+    @Test
+    public void testGetYouthPlayerByIdNotNull() throws BlackoutException
+    {
+        Player player 
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.youth.id")), Player.class, Boolean.FALSE, Boolean.TRUE);
         
         assertNotNull(player);
     }
         memberIds.add(new Long(System.getProperty("player.1.id")));
         memberIds.add(new Long(System.getProperty("player.2.id")));
         List<Player> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, Player.class);
+            = requestManager.getEntitiesFromApi(memberIds, Player.class, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entitiesFromApi);
     }
     public void testGetPlayerByIdCorrectPlayer() throws BlackoutException
     {
         Player player 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), Player.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("player.1.id")), Player.class, Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(player.getPlayerId().equals(new Long(System.getProperty("player.1.id"))));
         assertNotNull(player.getTeamId());
         memberIds.add(new Long(System.getProperty("player.1.id")));
         memberIds.add(new Long(System.getProperty("player.2.id")));
         List<Player> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, Player.class);
+            = requestManager.getEntitiesFromApi(memberIds, Player.class, Boolean.FALSE, Boolean.FALSE);
             
         Player player1 = entitiesFromApi.get(0);
         Player player2 = entitiesFromApi.get(1);
     
     @Test
     public void testGetPlayersByTeamIdNotNull() throws BlackoutException {
-        List<Player> teamPlayers = requestManager.getPlayersByTeamId(new Long(System.getProperty("member.team.id")));
+        List<Player> teamPlayers = requestManager.getPlayersByTeamId(new Long(System.getProperty("member.team.id")), Boolean.FALSE, Boolean.FALSE);
         
         assertNotNull(teamPlayers);
     }
     
     @Test 
     public void testGetPlayersByTeamIdOverMinSize() throws BlackoutException {
-        List<Player> teamPlayers = requestManager.getPlayersByTeamId(new Long(System.getProperty("member.team.id")));
+        List<Player> teamPlayers = requestManager.getPlayersByTeamId(new Long(System.getProperty("member.team.id")), Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(teamPlayers.size() >= 22);
     }

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerStandingTest.java

     public void tearDown()
     {
         requestManager = null;
+    }    
+    
+    @Test
+    public void testGetNationalStandingByLeagueIdNotNull() throws BlackoutException
+    {
+        Long leagueId = new Long(System.getProperty("standing.id"));
+        List<Standing> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class, Boolean.TRUE, Boolean.FALSE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetUnderTwentyStandingByLeagueIdNotNull() throws BlackoutException
+    {
+        Long leagueId = new Long(System.getProperty("standing.id"));
+        List<Standing> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class, Boolean.TRUE, Boolean.TRUE);
+            
+        assertNotNull(entitiesFromApi);
+    }
+    
+    @Test
+    public void testGetClubStandingByLeagueIdNotNull() throws BlackoutException
+    {
+        Long leagueId = new Long(System.getProperty("standing.id"));
+        List<Standing> entitiesFromApi 
+            = requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class, Boolean.FALSE, Boolean.FALSE);
+            
+        assertNotNull(entitiesFromApi);
     }
     
     @Test
-    public void testGetStandingByLeagueIdNotNull() throws BlackoutException
+    public void testGetYouthStandingByLeagueIdNotNull() throws BlackoutException
     {
         Long leagueId = new Long(System.getProperty("standing.id"));
         List<Standing> entitiesFromApi 
-            = requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class);
+            = requestManager.getListOfEntityByIdFromApi(leagueId, Standing.class, Boolean.FALSE, Boolean.TRUE);
             
         assertNotNull(entitiesFromApi);
     }
     {
         Long memberId = new Long(System.getProperty("standing.id"));
         List<Standing> entitiesFromApi 
-            = requestManager.getListOfEntityByIdFromApi(memberId, Standing.class);
+            = requestManager.getListOfEntityByIdFromApi(memberId, Standing.class, Boolean.FALSE, Boolean.FALSE);
             
         assertTrue(entitiesFromApi.size() == 8);
         Standing get = entitiesFromApi.get(0);

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerTeamStatisiticsTest.java

     }
     
     @Test
-    public void testGetDefaultTeamStatisicsByIdNotNull() throws BlackoutException
-    {
-        TeamStatistics teamStats 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), TeamStatistics.class);
-        
-        assertNotNull(teamStats);
-    }
-    
-    @Test
     public void testGetNationalTeamStatisicsByIdNotNull() throws BlackoutException
     {
         TeamStatistics teamStats 
     public void testGetTeamStatisticsById() throws BlackoutException
     {
         TeamStatistics playerStats 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), TeamStatistics.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), TeamStatistics.class, Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(playerStats.getTeamId().equals(new Long(System.getProperty("member.team.id"))));
         assertNotNull(playerStats.getAverageKickingMetres());

src/test/java/org/jmcdonnell/blackoutrugby/requests/RequestManagerTeamTest.java

     }
     
     @Test
-    public void testGetDefaultTeamByIdNotNull() throws BlackoutException
-    {
-        Team team 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Team.class);
-        
-        assertNotNull(team);
-    }
-    
-    @Test
     public void testGetNationalTeamByIdNotNull() throws BlackoutException
     {
         Team team 
         memberIds.add(new Long(System.getProperty("member.team.id")));
         memberIds.add(new Long(45341));
         List<Team> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, Team.class);
+            = requestManager.getEntitiesFromApi(memberIds, Team.class, Boolean.FALSE, Boolean.FALSE);
             
         assertNotNull(entitiesFromApi);
     }
     public void testGetTeamById() throws BlackoutException
     {
         Team team 
-            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Team.class);
+            = requestManager.getEntityFromApi(new Long(System.getProperty("member.team.id")), Team.class, Boolean.FALSE, Boolean.FALSE);
         
         assertTrue(team.getTeamId().equals(new Long(System.getProperty("member.team.id"))));
         assertNotNull(team.getTeamName());
         memberIds.add(new Long(System.getProperty("member.team.id")));
         memberIds.add(new Long(45341));
         List<Team> entitiesFromApi 
-            = requestManager.getEntitiesFromApi(memberIds, Team.class);
+            = requestManager.getEntitiesFromApi(memberIds, Team.class, Boolean.FALSE, Boolean.FALSE);
             
         Team team1 = entitiesFromApi.get(0);
         Team team2 = entitiesFromApi.get(1);