Commits

John McDonnell committed f474387

Added an initial Bank Manager class. This class is use to perform the transactions as required. I have included Mockito to be used to mock the BankRepository and I have added tests for each Transaction Type.

Comments (0)

Files changed (51)

+/dev.properties
+/nbactions.xml
+/target/
+README
+ver1.0
+
+The purpose of this project is to create a Java API adapter for the Blackout Rugby API.  This is the first step towards creating a possible Mobile Application for Blackout Rugby
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.jmcdonnell</groupId>
+    <artifactId>blackoutRugbyJavaApi</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+    <name>Blackout Rugby Java API</name>
+    
+    <properties>
+        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
+    </properties>
+    
+    <dependencies>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.2.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>1.7.5</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>        
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.9.5</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.3.2</version>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                    <compilerArguments>
+                        <endorseddirs>${endorsed.dir}</endorseddirs>
+                    </compilerArguments>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>properties-maven-plugin</artifactId>
+                <version>1.0-alpha-2</version>
+                <executions>
+                    <execution>
+                        <phase>initialize</phase>
+                        <goals>
+                            <goal>read-project-properties</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <files>
+                        <file>dev.properties</file>
+                    </files>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.6.2.201302030002</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>report</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

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

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby;
+
+import org.jmcdonnell.blackoutrugby.beans.BlackoutLoginDetails;
+import org.jmcdonnell.blackoutrugby.beans.Member;
+import org.jmcdonnell.blackoutrugby.exceptions.BlackoutException;
+import org.jmcdonnell.blackoutrugby.exceptions.BlackoutLoginException;
+import org.jmcdonnell.blackoutrugby.requests.RequestManager;
+
+/**
+ * Public API for Blackout Rugby.
+ */
+public class BlackoutApi {
+
+    private RequestManager requestManager;
+    private static BlackoutApi instance;
+    protected BlackoutLoginDetails loggedInMemberDetails;
+    
+    private BlackoutApi()
+    {
+        // replace with some form of dependency injection
+        requestManager = new RequestManager();
+    }
+    
+    /**
+     * Initialises an instance of the API when the user provides correct log in credentials.
+     * @param username the username of the user.
+     * @param password the password of the user.
+     * @return an instance of the API for the given user.
+     * @throws BlackoutLoginException if an error occurs while logging in.
+     */
+    public static BlackoutApi init(String username, String password) throws BlackoutException
+    {
+        instance =  new BlackoutApi();
+        
+        instance.login(username, password);
+        
+        return instance;
+    }
+
+    private void login(String username, String password) throws BlackoutLoginException, BlackoutException {
+        setLoginInMemberDetails(requestManager.login(username, password));
+    }
+
+    public Long getMemberId() {
+        return loggedInMemberDetails.getMemberId();
+    }
+
+    public Long getTeamId() {
+        return loggedInMemberDetails.getTeamId();
+    }
+
+    public String getMemberApiKey() {
+        return loggedInMemberDetails.getKey();
+    }
+
+    protected void setLoginInMemberDetails(BlackoutLoginDetails login) {
+        loggedInMemberDetails = login;
+    }
+    
+    public Member getMember() throws BlackoutException {
+        
+        if (loggedInMemberDetails == null || getMemberId() == null)
+        {
+            throw new BlackoutLoginException("User is not logged in.");
+        }
+        return getMember(loggedInMemberDetails.getMemberId());
+    }
+    
+    
+    public Member getMember(Long memberId) throws BlackoutException {
+        return requestManager.getEntityFromApi(memberId, Member.class);
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/AbstractBlackoutEntity.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+/**
+ *
+ * @author john
+ */
+public abstract class AbstractBlackoutEntity {
+    
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/BlackoutApiResponse.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author john
+ */
+@XmlRootElement(name = "blackoutrugby_api_response")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class BlackoutApiResponse {
+
+    private String status;
+    private String key;
+    @XmlElement(name = "memberid")
+    private Long memberId;
+    @XmlElement(name = "teamid")
+    private Long teamId;
+    private String reason;
+    @XmlElements({
+        @XmlElement(name = "member", type = Member.class),
+        @XmlElement(name = "team", type = Team.class),
+        @XmlElement(name = "player", type = Player.class),
+        @XmlElement(name = "fixture", type = Fixture.class),
+        @XmlElement(name = "livescoring", type = MatchScore.class),
+        @XmlElement(name = "player_statistics", type = PlayerStatistics.class),
+        @XmlElement(name = "entry", type = PlayerHistory.class),
+        @XmlElement(name = "event", type = MatchEvent.class),
+        @XmlElement(name = "lineup", type = Lineup.class),
+        @XmlElement(name = "standing", type = Standing.class),
+        @XmlElement(name = "team_statistics", type = TeamStatistics.class)
+    })
+    private List<AbstractBlackoutEntity> entities;
+
+    public final String getStatus() {
+        return status;
+    }
+
+    public final String getKey() {
+        return key;
+    }
+
+    public final Long getMemberId() {
+        return memberId;
+    }
+
+    public final Long getTeamId() {
+        return teamId;
+    }
+
+    public final String getReason() {
+        return reason;
+    }
+
+    public List<AbstractBlackoutEntity> getEntities() {
+        return entities;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/BlackoutLoginDetails.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+/**
+ *
+ * @author john
+ */
+public class BlackoutLoginDetails {
+    private String status;
+    private String key;
+    private Long memberId;
+    private Long teamId;
+    private String reason;
+
+    public final String getStatus() {
+        return status;
+    }
+
+    public final void setStatus(String status) {
+        this.status = status;
+    }
+
+    public final String getKey() {
+        return key;
+    }
+
+    public final void setKey(String key) {
+        this.key = key;
+    }
+
+    public final Long getMemberId() {
+        return memberId;
+    }
+
+    public final void setMemberId(Long memberId) {
+        this.memberId = memberId;
+    }
+
+    public final Long getTeamId() {
+        return teamId;
+    }
+
+    public final void setTeamId(Long teamId) {
+        this.teamId = teamId;
+    }
+
+    public final String getReason() {
+        return reason;
+    }
+
+    public final void setReason(String reason) {
+        this.reason = reason;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/Fixture.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author john
+ */
+@XmlRootElement(name = "fixture")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Fixture extends AbstractBlackoutEntity {
+    
+    @XmlElement(name = "id")
+    private Long fixtureId;
+    @XmlElement(name = "season")
+    private Integer season;
+    @XmlElement(name = "country_iso")
+    private String countryIso;
+    @XmlElement(name = "leagueid")
+    private Long leagueId;
+    @XmlElement(name = "round")
+    private Integer round;
+    @XmlElement(name = "hometeamid")
+    private Long homeTeamId;
+    @XmlElement(name = "guestteamid")
+    private Long guestTeamId;
+    @XmlElement(name = "competition")
+    private String competition;
+    @XmlElement(name = "botmatch")
+    private Integer botMatch;
+    @XmlElement(name = "matchstart")
+    private Long matchStart;
+    
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getGuestTeamId() {
+        return guestTeamId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getBotMatch() {
+        return botMatch;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCompetition() {
+        return competition;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCountryIso() {
+        return countryIso;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getFixtureId() {
+        return fixtureId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getHomeTeamId() {
+        return homeTeamId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getLeagueId() {
+        return leagueId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getMatchStart() {
+        return matchStart;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getRound() {
+        return round;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getSeason() {
+        return season;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/IndividualPlayerTraingSkill.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+/**
+ *
+ * @author john
+ */
+class IndividualPlayerTraingSkill {
+//    <skill label="technique">
+//          <skill>technique</skill>
+//          <sessions>3</sessions>
+//          <pops>
+//          	<skill>technique</skill>
+//          </pops>
+//          <trainer_name>Levi+Hordern</trainer_name>
+//          <trainer_level>1</trainer_level>
+//          <trainer_type>defense</trainer_type>
+//      	</skill>
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/IndividualPlayerTraining.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+
+/**
+ *
+ * @author john
+ */
+public class IndividualPlayerTraining {
+    
+    private Long id;
+    @XmlElementWrapper(name = "skills")
+    @XmlElement(name = "skill")
+    private List<IndividualPlayerTraingSkill> skills;
+    
+//      <csr>
+//        <old>21312</old>
+//        <new>21314</new>
+//      </csr>
+//      <energy>
+//        <old>9</old>
+//        <new>8</new>
+//      </energy>
+//    </player>
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/Lineup.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "lineup")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Lineup extends AbstractBlackoutEntity {
+    private Long id;
+    @XmlElement(name = "teamid")
+    private Long teamId;
+    @XmlElement(name = "fixtureid")
+    private Long fixtureId;
+    private Long p1;
+    private Long p2;
+    private Long p3;
+    private Long p4;
+    private Long p5;
+    private Long p6;
+    private Long p7;
+    private Long p8;
+    private Long p9;
+    private Long p10;
+    private Long p11;
+    private Long p12;
+    private Long p13;
+    private Long p14;
+    private Long p15;
+    
+    private Long b1;
+    private Long b2;
+    private Long b3;
+    private Long b4;
+    private Long b5;
+    private Long b6;
+    private Long b7;
+    
+    private Long captain;
+    private Long kicker;
+    private Long deadline;
+    
+    private Long r1p1;
+    private Long r1p2;
+    private Long r1p3;
+    private Long r1p4;
+    private Long r1p5;
+    private Long r1p6;
+    private Long r1p7;
+    private Long r1p8;
+    private Long r1p9;
+    private Long r1p10;
+    private Long r1p11;
+    private Long r1p12;
+    private Long r1p13;
+    private Long r1p14;
+    private Long r1p15;
+    
+    private Long r2p1;
+    private Long r2p2;
+    private Long r2p3;
+    private Long r2p4;
+    private Long r2p5;
+    private Long r2p6;
+    private Long r2p7;
+    private Long r2p8;
+    private Long r2p9;
+    private Long r2p10;
+    private Long r2p11;
+    private Long r2p12;
+    private Long r2p13;
+    private Long r2p14;
+    private Long r2p15;
+
+    private Long kicker1;
+    private Long kicker2;
+    private Long captain1;
+    private Long captain2;
+    
+    @XmlElement(name = "pickandgo")
+    private Integer pickAndGo;
+    private Integer driving;
+    private Integer expansive;
+    private Integer creative;
+    private String defense;
+    private Integer kicking;
+    @XmlElement(name = "kickfortouch")
+    private Integer kickForTouch;
+    @XmlElement(name = "upandunder")
+    private Integer upAndUnder;
+    @XmlElement(name = "dropgoals")
+    private Integer dropGoals;
+    private Integer intensity;
+    private Integer discipline;
+    
+    public Long getId() {
+        return id;
+    }
+
+    public Long getTeamId() {
+        return teamId;
+    }
+
+    public Long getFixtureId() {
+        return fixtureId;
+    }
+
+    public Long getP1() {
+        return p1;
+    }
+
+    public Long getP2() {
+        return p2;
+    }
+
+    public Long getP3() {
+        return p3;
+    }
+
+    public Long getP4() {
+        return p4;
+    }
+
+    public Long getP5() {
+        return p5;
+    }
+
+    public Long getP6() {
+        return p6;
+    }
+
+    public Long getP7() {
+        return p7;
+    }
+
+    public Long getP8() {
+        return p8;
+    }
+
+    public Long getP9() {
+        return p9;
+    }
+
+    public Long getP10() {
+        return p10;
+    }
+
+    public Long getP11() {
+        return p11;
+    }
+
+    public Long getP12() {
+        return p12;
+    }
+
+    public Long getP13() {
+        return p13;
+    }
+
+    public Long getP14() {
+        return p14;
+    }
+
+    public Long getP15() {
+        return p15;
+    }
+
+    public Long getB1() {
+        return b1;
+    }
+
+    public Long getB2() {
+        return b2;
+    }
+
+    public Long getB3() {
+        return b3;
+    }
+
+    public Long getB4() {
+        return b4;
+    }
+
+    public Long getB5() {
+        return b5;
+    }
+
+    public Long getB6() {
+        return b6;
+    }
+
+    public Long getB7() {
+        return b7;
+    }
+
+    public Long getCaptain() {
+        return captain;
+    }
+
+    public Long getKicker() {
+        return kicker;
+    }
+
+    public Long getDeadline() {
+        return deadline;
+    }
+
+    public Long getR1p1() {
+        return r1p1;
+    }
+
+    public Long getR1p2() {
+        return r1p2;
+    }
+
+    public Long getR1p3() {
+        return r1p3;
+    }
+
+    public Long getR1p4() {
+        return r1p4;
+    }
+
+    public Long getR1p5() {
+        return r1p5;
+    }
+
+    public Long getR1p6() {
+        return r1p6;
+    }
+
+    public Long getR1p7() {
+        return r1p7;
+    }
+
+    public Long getR1p8() {
+        return r1p8;
+    }
+
+    public Long getR1p9() {
+        return r1p9;
+    }
+
+    public Long getR1p10() {
+        return r1p10;
+    }
+
+    public Long getR1p11() {
+        return r1p11;
+    }
+
+    public Long getR1p12() {
+        return r1p12;
+    }
+
+    public Long getR1p13() {
+        return r1p13;
+    }
+
+    public Long getR1p14() {
+        return r1p14;
+    }
+
+    public Long getR1p15() {
+        return r1p15;
+    }
+
+    public Long getR2p1() {
+        return r2p1;
+    }
+
+    public Long getR2p2() {
+        return r2p2;
+    }
+
+    public Long getR2p3() {
+        return r2p3;
+    }
+
+    public Long getR2p4() {
+        return r2p4;
+    }
+
+    public Long getR2p5() {
+        return r2p5;
+    }
+
+    public Long getR2p6() {
+        return r2p6;
+    }
+
+    public Long getR2p7() {
+        return r2p7;
+    }
+
+    public Long getR2p8() {
+        return r2p8;
+    }
+
+    public Long getR2p9() {
+        return r2p9;
+    }
+
+    public Long getR2p10() {
+        return r2p10;
+    }
+
+    public Long getR2p11() {
+        return r2p11;
+    }
+
+    public Long getR2p12() {
+        return r2p12;
+    }
+
+    public Long getR2p13() {
+        return r2p13;
+    }
+
+    public Long getR2p14() {
+        return r2p14;
+    }
+
+    public Long getR2p15() {
+        return r2p15;
+    }
+
+    public Long getKicker1() {
+        return kicker1;
+    }
+
+    public Long getKicker2() {
+        return kicker2;
+    }
+
+    public Long getCaptain1() {
+        return captain1;
+    }
+
+    public Long getCaptain2() {
+        return captain2;
+    }
+
+    public Integer getPickAndGo() {
+        return pickAndGo;
+    }
+
+    public Integer getDriving() {
+        return driving;
+    }
+
+    public Integer getExpansive() {
+        return expansive;
+    }
+
+    public Integer getCreative() {
+        return creative;
+    }
+
+    public String getDefense() {
+        return defense;
+    }
+
+    public Integer getKicking() {
+        return kicking;
+    }
+
+    public Integer getKickForTouch() {
+        return kickForTouch;
+    }
+
+    public Integer getUpAndUnder() {
+        return upAndUnder;
+    }
+
+    public Integer getDropGoals() {
+        return dropGoals;
+    }
+
+    public Integer getIntensity() {
+        return intensity;
+    }
+
+    public Integer getDiscipline() {
+        return discipline;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/MatchEvent.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "event")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class MatchEvent extends AbstractBlackoutEntity {
+
+    private Long id;
+    @XmlElement(name = "fixtureid")
+    private Long fixtureId;
+    private String commentary;
+    private Integer possession;
+    @XmlElement(name = "actualtime")
+    private Integer actualTime;
+    @XmlElement(name = "losttime")
+    private Integer lostTime;
+    @XmlElement(name = "gametime")
+    private Integer gameTime;
+    @XmlElement(name = "homescore")
+    private Integer homeScore;
+    @XmlElement(name = "guestscore")
+    private Integer guestScore;
+    private Integer index;
+    private Integer half;
+
+    public Long getId() {
+        return id;
+    }
+
+    public Long getFixtureId() {
+        return fixtureId;
+    }
+
+    public String getCommentary() {
+        return commentary;
+    }
+
+    public Integer getPossession() {
+        return possession;
+    }
+
+    public Integer getActualTime() {
+        return actualTime;
+    }
+
+    public Integer getLostTime() {
+        return lostTime;
+    }
+
+    public Integer getGameTime() {
+        return gameTime;
+    }
+
+    public Integer getHomeScore() {
+        return homeScore;
+    }
+
+    public Integer getGuestScore() {
+        return guestScore;
+    }
+
+    public Integer getIndex() {
+        return index;
+    }
+
+    public Integer getHalf() {
+        return half;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/MatchScore.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.jmcdonnell.blackoutrugby.beans.jaxbadapters.BooleanAdapter;
+
+@XmlRootElement(name = "livescoring")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class MatchScore extends AbstractBlackoutEntity {
+    
+    @XmlJavaTypeAdapter(BooleanAdapter.class)
+    @XmlElement(name = "match_has_started")
+    private Boolean isMatchStarted;
+    @XmlJavaTypeAdapter(BooleanAdapter.class)
+    @XmlElement(name = "match_has_finished")
+    private Boolean isMatchFinished;
+    
+    @XmlElement(name = "homescore")
+    private Integer homeScore;
+    @XmlElement(name = "guestscore")
+    private Integer guestScore;
+    @XmlElement(name = "gametime")
+    private Integer gameTimeInSecs;
+
+    public Integer getHomeScore() {
+        return homeScore;
+    }
+
+    public Integer getGuestScore() {
+        return guestScore;
+    }
+
+    public Integer getGameTimeInSecs() {
+        return gameTimeInSecs;
+    }
+
+    public Boolean isMatchStarted() {
+        return isMatchStarted;
+    }
+
+    public Boolean isMatchFinished() {
+        return isMatchFinished;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/Member.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+/**
+ *
+ * @author john
+ */
+@XmlRootElement(name = "member")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Member extends AbstractBlackoutEntity {
+
+    @XmlElement(name = "id")
+    private Long memberId;
+    @XmlElement(name = "username")
+    private String userName;
+    @XmlElement(name = "realname")
+    private String realName;
+    @XmlElement(name = "email")
+    private String email;
+    @XmlElement(name = "memberlevel")
+    private Integer memberLevel;
+    @XmlElement(name = "teamid")
+    private Long teamId;
+    @XmlElement(name = "cash")
+    private Double cash;
+    @XmlElement(name = "active")
+    private Integer active;
+    @XmlElement(name = "renames")
+    private Integer renames;
+    @XmlElement(name = "moves")
+    private Integer moves;
+    @XmlElement(name = "surveyed")
+    private Integer surveyed;
+    @XmlElement(name = "regmethod")
+    private Integer regMethod;
+    @XmlElement(name = "team_country_iso")
+    private String teamCountryIso;
+    @XmlElement(name = "main_teamid")
+    private Long mainTeamId;
+    @XmlElement(name = "lastclick")
+    private Long lastClick;
+    @XmlElement(name = "dateregistered")
+    private Long dateRegistered;
+    @XmlElementWrapper(name="teams")
+    @XmlElement(name = "teamid")
+    private List<Long> teams;
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getActive() {
+        return active;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Double getCash() {
+        return cash;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getDateRegistered() {
+        return dateRegistered;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getEmail() {
+        return email;
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Long getLastClick() {
+        return lastClick;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getMemberId() {
+        return memberId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getMemberLevel() {
+        return memberLevel;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getRealName() {
+        return realName;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getTeamId() {
+        return teamId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getUserName() {
+        return userName;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getMoves() {
+        return moves;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getRenames() {
+        return renames;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getSurveyed() {
+        return surveyed;
+    }
+
+    public Integer getRegMethod() {
+        return regMethod;
+    }
+
+    public String getTeamCountryIso() {
+        return teamCountryIso;
+    }
+
+    public Long getMainTeamId() {
+        return mainTeamId;
+    }
+
+    public List<Long> getTeams() {
+        return teams;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/Player.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.jmcdonnell.blackoutrugby.beans.enums.AggressionEnum;
+import org.jmcdonnell.blackoutrugby.beans.enums.DisciplineEnum;
+import org.jmcdonnell.blackoutrugby.beans.enums.FormLeadershipAndExperienceEnum;
+import org.jmcdonnell.blackoutrugby.beans.enums.PlayerSkillsEnum;
+import org.jmcdonnell.blackoutrugby.beans.jaxbadapters.AggressionAdapter;
+import org.jmcdonnell.blackoutrugby.beans.jaxbadapters.DisciplineAdapter;
+import org.jmcdonnell.blackoutrugby.beans.jaxbadapters.FormLeadershipAndExperienceAdapter;
+import org.jmcdonnell.blackoutrugby.beans.jaxbadapters.PlayerSkillsAdapter;
+
+/**
+ *
+ * @author john
+ */
+@XmlRootElement(name = "player")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class Player extends AbstractBlackoutEntity {
+    @XmlElement(name = "id")
+    private Long playerId;
+    @XmlElement(name = "teamid")
+    private Long teamId;
+    @XmlElement(name = "fname")
+    private String fName;
+    @XmlElement(name = "lname")
+    private String lName;
+    @XmlElement(name = "birthday")
+    private String birthday;
+    @XmlElement(name = "age")
+    private Integer age;
+    @XmlElement(name = "hand")
+    private String hand;
+    @XmlElement(name = "foot")
+    private String foot;
+    @XmlElement(name = "nationality")
+    private String nationality;
+    @XmlElement(name = "csr")
+    private Long csr;
+    private Long prevCsr;
+    @XmlElement(name = "salary")
+    private Long salary;
+    @XmlElement(name = "form")
+    @XmlJavaTypeAdapter(FormLeadershipAndExperienceAdapter.class)
+    private FormLeadershipAndExperienceEnum form;
+    @XmlElement(name = "aggression")
+    @XmlJavaTypeAdapter(AggressionAdapter.class)
+    private AggressionEnum aggression;
+    @XmlElement(name = "discipline")
+    @XmlJavaTypeAdapter(DisciplineAdapter.class)
+    private DisciplineEnum discipline;
+    @XmlElement(name = "energy")
+    private Integer energy;
+    @XmlElement(name = "leadership")
+    @XmlJavaTypeAdapter(FormLeadershipAndExperienceAdapter.class)
+    private FormLeadershipAndExperienceEnum leadership;
+    @XmlElement(name = "experience")
+    @XmlJavaTypeAdapter(FormLeadershipAndExperienceAdapter.class)
+    private FormLeadershipAndExperienceEnum experience;
+    @XmlElement(name = "weight")
+    private Integer weight;
+    @XmlElement(name = "height")
+    private Integer height;
+    @XmlElement(name = "injured")
+    private Long injured;
+    @XmlElement(name = "youthid")
+    private Long youthId;
+    @XmlElement(name = "jersey")
+    private Integer jersey;
+    @XmlElement(name = "joined")
+    private Long joined;
+    @XmlElement(name = "rawsalary")
+    private Long rawSalary;
+    @XmlElement(name = "stamina")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum stamina;
+    @XmlElement(name = "contract")
+    private Long contract;
+    @XmlElement(name = "name")
+    private String name;
+    @XmlElement(name = "dualnationality")
+    private String dualNationality;
+    @XmlElement(name = "kicking")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum kicking;
+    @XmlElement(name = "agility")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum agility;
+    @XmlElement(name = "speed")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum speed;
+    @XmlElement(name = "jumping")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum jumping;
+    @XmlElement(name = "strength")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum strength;
+    @XmlElement(name = "technique")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum technique;
+    @XmlElement(name = "defense")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum defense;
+    @XmlElement(name = "attack")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum attack;
+    @XmlElement(name = "handling")
+    @XmlJavaTypeAdapter(PlayerSkillsAdapter.class)
+    private PlayerSkillsEnum handling;
+    @XmlElementWrapper(name = "pops")
+    @XmlElement(name = "skill")
+    private List<String>pops;
+
+    /**
+     *
+     * {@inheritDoc}
+     */
+    public Integer getAge() {
+        return age;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public AggressionEnum getAggression() {
+        return aggression;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBirthday() {
+        return birthday;
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Long getCsr() {
+        return csr;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getPrevCsr() {
+        return prevCsr;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public DisciplineEnum getDiscipline() {
+        return discipline;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getEnergy() {
+        return energy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public FormLeadershipAndExperienceEnum getExperience() {
+        return experience;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getfName() {
+        return fName;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public FormLeadershipAndExperienceEnum getForm() {
+        return form;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getHand() {
+        return hand;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getHeight() {
+        return height;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getInjured() {
+        return injured;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getJersey() {
+        return jersey;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getJoined() {
+        return joined;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getlName() {
+        return lName;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public FormLeadershipAndExperienceEnum getLeadership() {
+        return leadership;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getFoot() {
+        return foot;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getNationality() {
+        return nationality;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getPlayerId() {
+        return playerId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getSalary() {
+        return salary;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getTeamId() {
+        return teamId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Integer getWeight() {
+        return weight;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getYouthId() {
+        return youthId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Long getRawSalary() {
+        return rawSalary;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getStamina() {
+        return stamina;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getHandling() {
+        return handling;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getAttack() {
+        return attack;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getDefense() {
+        return defense;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getTechnique() {
+        return technique;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getStrength() {
+        return strength;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getJumping() {
+        return jumping;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getSpeed() {
+        return speed;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getAgility() {
+        return agility;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public PlayerSkillsEnum getKicking() {
+        return kicking;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getDualNationality() {
+        return dualNationality;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return name;
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Long getContract() {
+        return contract;
+    }
+
+    public List<String> getPops() {
+        return pops;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/PlayerHistory.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "entry")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class PlayerHistory extends AbstractBlackoutEntity {
+    
+    @XmlElement(name = "playerid")
+    private Long playerId;
+    private String event;
+    private Long date;
+    
+    public Long getPlayerId() {
+        return playerId;
+    }
+
+    public String getEvent() {
+        return event;
+    }
+
+    public Long getDate() {
+        return date;
+    }
+}

src/main/java/org/jmcdonnell/blackoutrugby/beans/PlayerStatistics.java

+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jmcdonnell.blackoutrugby.beans;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "player_statistics")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class PlayerStatistics extends AbstractBlackoutEntity {
+    
+    @XmlElement(name = "playerid")
+    private Long playerId;
+    private Integer tackles;
+    @XmlElement(name = "metresgained")
+    private Integer metresGained;
+    private Integer tries;
+    private Integer conversions;
+    @XmlElement(name = "dropgoals") 
+    private Integer dropGoals;
+    private Integer penalties;
+    @XmlElement(name = "totalpoints")
+    private Integer totalPoints;
+    @XmlElement(name = "yellowcards")
+    private Integer yellowCards;
+    @XmlElement(name = "redcards") 
+    private Integer redCards;
+    @XmlElement(name = "linebreaks")
+    private Integer lineBreaks;
+    private Integer intercepts;
+    private Integer kicks;
+    @XmlElement(name = "knockons")
+    private Integer knockOns;
+    @XmlElement(name = "forwardpasses")
+    private Integer forwardPasses;
+    @XmlElement(name = "tryassists")
+    private Integer tryAssists;
+    @XmlElement(name = "beatendefenders")
+    private Integer beatenDefenders;
+    private Integer injuries;
+    @XmlElement(name = "handlingerrors")
+    private Integer handlingErrors;
+    @XmlElement(name = "missedtackles")
+    private Integer missedTackles;
+    private Integer fights;
+    @XmlElement(name = "kickingmetres")
+    private Integer kickingMetres;
+    @XmlElement(name = "leaguecaps")
+    private Integer leagueCaps;
+    @XmlElement(name = "friendlycaps")
+    private Integer friendlyCaps;
+    @XmlElement(name = "cupcaps")
+    private Integer cupCaps;
+    @XmlElement(name = "undertwentycaps")
+    private Integer under20Caps;
+    @XmlElement(name = "nationalcaps")
+    private Integer nationalCaps;
+    @XmlElement(name = "othercaps") 
+    private Integer otherCaps;
+    @XmlElement(name = "avkickingmetres")
+    private Double averageKickingMetres;
+    @XmlElement(name = "penaltiesconceded")
+    private Integer penaltiesConceded;
+    @XmlElement(name= "kicksoutonthefull")
+    private Integer kicksOutOnTheFull;
+    @XmlElement(name = "balltime")
+    private Integer ballTime;
+    @XmlElement(name = "penaltytime")
+    private Integer penaltyTime;
+    @XmlElement(name = "missedconversions")
+    private Integer missedConversions;
+    @XmlElement(name = "misseddropgoals")
+    private Integer missedDropGoals;
+    @XmlElement(name = "missedpenalties")
+    private Integer missedPenalties;
+    @XmlElement(name = "goodupandunders")
+    private Integer goodUpAndUnders;
+    @XmlElement(name = "badupandunders")
+    private Integer badUpAndUnders;
+    @XmlElement(name = "upandunders")
+    private Integer upAndUnders;
+    @XmlElement(name = "goodkicks")
+    private Integer goodKicks;
+    @XmlElement(name = "badkicks")
+    private Integer badKicks;
+    @XmlElement(name = "turnoverswon")
+    private Integer turnOversWon;
+    @XmlElement(name = "lineoutssecured")
+    private Integer lineoutsSecured;
+    @XmlElement(name = "lineoutsconceded")
+    private Integer lineoutsConceeded;
+    @XmlElement(name = "lineoutsstolen")
+    private Integer lineoutsStolen;
+    @XmlElement(name = "successfullineoutthrows")
+    private Integer successfulLineoutThrows;
+    @XmlElement(name = "unsuccessfullineoutthrows")
+    private Integer unsuccessfulLineoutThrows;
+    @XmlElement(name = "worldcupcaps")
+    private Integer worldCupCaps;
+    @XmlElement(name = "undertwentyworldcupcaps")
+    private Integer under20WorldCupCaps;
+
+    public Long getPlayerId() {
+        return playerId;
+    }
+
+    public Integer getTackles() {
+        return tackles;
+    }
+
+    public Integer getMetresGained() {
+        return metresGained;
+    }
+
+    public Integer getTries() {
+        return tries;
+    }
+
+    public Integer getConversions() {
+        return conversions;
+    }
+
+    public Integer getDropGoals() {
+        return dropGoals;
+    }
+
+    public Integer getPenalties() {
+        return penalties;
+    }
+
+    public Integer getTotalPoints() {
+        return totalPoints;
+    }
+
+    public Integer getYellowCards() {
+        return yellowCards;
+    }
+
+    public Integer getRedCards() {
+        return redCards;
+    }
+
+    public Integer getLineBreaks() {
+        return lineBreaks;
+    }
+
+    public Integer getIntercepts() {
+        return intercepts;
+    }
+
+    public Integer getKicks() {
+        return kicks;
+    }
+
+    public Integer getKnockOns() {
+        return knockOns;
+    }
+
+    public Integer getForwardPasses() {
+        return forwardPasses;
+    }
+
+    public Integer getTryAssists() {
+        return tryAssists;
+    }
+
+    public Integer getBeatenDefenders() {
+        return beatenDefenders;
+    }
+
+    public Integer getInjuries() {
+        return injuries;
+    }
+
+    public Integer getHandlingErrors() {
+        return handlingErrors;
+    }
+
+    public Integer getMissedTackles() {
+        return missedTackles;
+    }
+
+    public Integer getFights() {
+        return fights;
+    }
+
+    public Integer getKickingMetres() {
+        return kickingMetres;
+    }
+
+    public Integer getLeagueCaps() {
+        return leagueCaps;
+    }
+
+    public Integer getFriendlyCaps() {
+        return friendlyCaps;
+    }
+
+    public Integer getCupCaps() {
+        return cupCaps;
+    }
+
+    public Integer getUnder20Caps() {
+        return under20Caps;
+    }
+
+    public Integer getNationalCaps() {