Strabon
changeset 101:6238e91405a3
forgot to "hg add" ResponseMessages class
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Thu Apr 05 20:30:01 2012 +0300 (2012-04-05) |
parents | 298c806608c2 |
children | 05b72446dc14 |
files | endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ResponseMessages.java |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ResponseMessages.java Thu Apr 05 20:30:01 2012 +0300 1.3 @@ -0,0 +1,47 @@ 1.4 +/** 1.5 + * 1.6 + */ 1.7 +package eu.earthobservatory.org.StrabonEndpoint; 1.8 + 1.9 +/** 1.10 + * This class holds the methods constructing the various 1.11 + * responses to a client issuing a query, update, or store 1.12 + * request. 1.13 + * 1.14 + * @author charnik 1.15 + * 1.16 + */ 1.17 +public class ResponseMessages { 1.18 + 1.19 + /** 1.20 + * Used as the template answer for UPDATE queries. 1.21 + * @return 1.22 + */ 1.23 + public static String getXMLHeader() { 1.24 + return "<?xml version='1.0' encoding='UTF-8'?>\n" + 1.25 + "<response>\n" + 1.26 + "\t"; 1.27 + } 1.28 + 1.29 + /** 1.30 + * Used as the template answer for UPDATE queries. 1.31 + * Actually, it encloses msg around an <exception> 1.32 + * XML element tag. 1.33 + * @param msg 1.34 + * @return 1.35 + */ 1.36 + public static String getXMLException(String msg) { 1.37 + return "<exception>\n"+msg+"\n\t</exception>"; 1.38 + } 1.39 + 1.40 + /** 1.41 + * Used as the template answer for UPDATE queries. 1.42 + * @return 1.43 + */ 1.44 + public static String getXMLFooter() { 1.45 + return "\n</response>\n"; 1.46 + } 1.47 + 1.48 + 1.49 + 1.50 +}