/* * * Copyright (c) 2009 Boulder Community Foundation - iVolunteer * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ package saas.iplocationtools; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlElement; /** * * @author Dave Angulo <daveangulo@actionfeed.org> */ /** * Example XML Response from the REST API * * <?xml version="1.0" encoding="UTF-8"?> * <Response> * <Ip>74.125.45.100</Ip> * <Status>OK</Status> * <CountryCode>US</CountryCode> * <CountryName>United States</CountryName> * <RegionCode>06</RegionCode> * <RegionName>California</RegionName> * <City>Mountain View</City> * <Latitude>37.4192</Latitude> * <Longitude>-122.057</Longitude> * </Response> * */ @XmlRootElement(name = "Response") public class ResponseConverter { private String ip; private String status; private String countryCode; private String countryName; private String regionCode; private String regionName; private String city; private String latitude; private String longitude; public ResponseConverter() { } public ResponseConverter(String ip, String status, String countryCode, String countryName, String regionCode, String regionName, String city, String latitude, String longitude) { this.ip = ip; this.status = status; this.countryCode = countryCode; this.countryName = countryName; this.regionCode = regionCode; this.regionName = regionName; this.city = city; this.latitude = latitude; this.longitude = longitude; } @XmlElement(name = "City") public String getCity() { return city; } public void setCity(String city) { this.city = city; } @XmlElement(name = "CountryCode") public String getCountryCode() { return countryCode; } public void setCountryCode(String countryCode) { this.countryCode = countryCode; } @XmlElement(name = "CountryName") public String getCountryName() { return countryName; } public void setCountryName(String countryName) { this.countryName = countryName; } @XmlElement(name = "Ip") public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } @XmlElement(name = "Latitude") public String getLatitude() { return latitude; } public void setLatitude(String latitude) { this.latitude = latitude; } @XmlElement(name = "Longitude") public String getLongitude() { return longitude; } public void setLongitude(String longitude) { this.longitude = longitude; } @XmlElement(name = "RegionCode") public String getRegionCode() { return regionCode; } public void setRegionCode(String regionCode) { this.regionCode = regionCode; } @XmlElement(name = "RegionName") public String getRegionName() { return regionName; } public void setRegionName(String regionName) { this.regionName = regionName; } @XmlElement(name = "Status") public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } }