1 18 package org.apache.activemq.web.controller; 19 20 import org.apache.activemq.web.BrokerFacade; 21 import org.apache.activemq.web.DurableSubscriberFacade; 22 import org.springframework.web.servlet.ModelAndView; 23 import org.springframework.web.servlet.mvc.Controller; 24 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 28 32 public class CreateSubscriber extends DurableSubscriberFacade implements Controller { 33 private String selector; 34 35 public CreateSubscriber(BrokerFacade brokerFacade) { 36 super(brokerFacade); 37 } 38 39 public String getSelector() { 40 return selector; 41 } 42 43 public void setSelector(String selector) { 44 this.selector = selector; 45 } 46 47 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { 48 if (selector != null && selector.length() == 0) { 49 selector = null; 50 } 51 getBrokerAdmin().createDurableSubscriber(getClientId(), getSubscriberName(), getValidDestination(), selector); 52 return new ModelAndView("redirect:subscribers.jsp"); 53 } 54 55 } 56 | Popular Tags |