1 4 5 9 10 package org.openlaszlo.servlets.responders; 11 12 import java.io.*; 13 import java.util.*; 14 import java.net.*; 15 import javax.servlet.*; 16 import javax.servlet.http.*; 17 import org.openlaszlo.compiler.*; 18 import org.openlaszlo.connection.*; 19 import org.openlaszlo.utils.*; 20 import org.apache.log4j.*; 21 22 23 public class ResponderAGENTLIST extends ResponderConnectionAgent 24 { 25 private static boolean mIsInitialized = false; 26 private static Logger mLogger = Logger.getLogger(ResponderAGENTLIST.class); 27 28 protected void respondAgent(HttpServletRequest req, HttpServletResponse res, 29 ConnectionGroup group) throws IOException 30 { 31 String users = req.getParameter("users"); 32 if ( users == null || users.equals("") ) { 33 replyWithXMLStatus(res, "missing 'users' parameter", SC_MISSING_PARAMETER); 34 return; 35 } 36 37 StringBuffer buf = new StringBuffer ("<list>"); 38 Set set = group.list(users); 39 Iterator iter = set.iterator(); 40 while (iter.hasNext()) { 41 buf.append("<user name=\"") 42 .append((String )iter.next()) 43 .append("\" />"); 44 } 45 buf.append("</list>"); 46 47 mLogger.debug(buf.toString()); 48 49 replyWithXML(res, "ok", buf.toString()); 50 } 51 } 52 | Popular Tags |