001
014
015 package com.liferay.portal.xmlrpc;
016
017 import com.liferay.portal.kernel.util.StringBundler;
018 import com.liferay.portal.kernel.xmlrpc.Success;
019 import com.liferay.portal.kernel.xmlrpc.XmlRpcException;
020
021
025 public class SuccessImpl implements Success {
026
027 public SuccessImpl(String description) {
028 _description = description;
029 }
030
031 @Override
032 public String getDescription() {
033 return _description;
034 }
035
036 @Override
037 public String toString() {
038 return "XML-RPC success " + _description;
039 }
040
041 @Override
042 public String toXml() throws XmlRpcException {
043 StringBundler sb = new StringBundler(8);
044
045 sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
046
047 sb.append("<methodResponse>");
048 sb.append("<params>");
049 sb.append("<param>");
050 sb.append(XmlRpcParser.wrapValue(_description));
051 sb.append("</param>");
052 sb.append("</params>");
053 sb.append("</methodResponse>");
054
055 return sb.toString();
056 }
057
058 private String _description;
059
060 }