/** * Copyright 2010 The University of Nottingham * * This file is part of lobbyservice. * * lobbyservice is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * lobbyservice is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with lobbyservice. If not, see <http://www.gnu.org/licenses/>. * */ package uk.ac.horizon.ug.lobby.model; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import uk.ac.horizon.ug.lobby.protocol.ClientRequirement; import com.google.appengine.api.datastore.Key; /** * @author cmg * */ @Entity public class GameClientTemplate { /** key - autogenerated, child of GameTemplate */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key key; /** GameTemplate */ private String gameTemplateId; /** client template title */ private String title; /** client role (optional) */ private String role; /** client requirements (JSON-encoded array of objects) */ private String requirementsJson; /** cache for unpacked ClientRequirements */ private transient List<ClientRequirement> requirements; // the following have become ClientRequirement OSName and OSVersion /** OS type, e.g. "Android" */ //private String clientType; /** OS min major version */ //private int minMajorVersion; /** OS min minor version (or 0) */ //private int minMinorVersion; /** OS min update (or 0) */ //private int minUpdateVersion; /** TODO additional requirements? */ /** Url to use to launch the application. */ private String appLaunchUrl; // this is now handled by ClientRequirement AppID/AppVersion failureUrl /** Url to use to access market info about client */ //private String appMarketUrl; /** is this client-type location-specific? */ private boolean locationSpecific; /** * */ public GameClientTemplate() { super(); } /** * @return the key */ public Key getKey() { return key; } /** * @param key the key to set */ public void setKey(Key key) { this.key = key; } /** * @return the gameTemplateId */ public String getGameTemplateId() { return gameTemplateId; } /** * @param gameTemplateId the gameTemplateId to set */ public void setGameTemplateId(String gameTemplateId) { this.gameTemplateId = gameTemplateId; } /** * @return the title */ public String getTitle() { return title; } /** * @param title the title to set */ public void setTitle(String title) { this.title = title; } /** * @return the locationSpecific */ public boolean isLocationSpecific() { return locationSpecific; } /** * @param locationSpecific the locationSpecific to set */ public void setLocationSpecific(boolean locationSpecific) { this.locationSpecific = locationSpecific; } /** * @return the appLaunchUrl */ public String getAppLaunchUrl() { return appLaunchUrl; } /** * @param appLaunchUrl the appLaunchUrl to set */ public void setAppLaunchUrl(String appLaunchUrl) { this.appLaunchUrl = appLaunchUrl; } /** * @return the role */ public String getRole() { return role; } /** * @param role the role to set */ public void setRole(String role) { this.role = role; } /** * @return the requirementsJson */ public String getRequirementsJson() { return requirementsJson; } /** * @param requirementsJson the requirementsJson to set */ public void setRequirementsJson(String requirementsJson) { this.requirementsJson = requirementsJson; } /** * @return the requirements */ public List<ClientRequirement> getRequirements() { return requirements; } /** * @param requirements the requirements to set */ public void setRequirements(List<ClientRequirement> requirements) { this.requirements = requirements; } /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { return "GameClientTemplate [appLaunchUrl=" + appLaunchUrl + ", gameTemplateId=" + gameTemplateId + ", key=" + key + ", locationSpecific=" + locationSpecific + ", requirementsJson=" + requirementsJson + ", role=" + role + ", title=" + title + "]"; } }