Package org.hornetq.rest.queue.push.xml

Examples of org.hornetq.rest.queue.push.xml.PushRegistration


      {
         HornetQRestLogger.LOGGER.loadingRestStore(dir.getAbsolutePath());
         for (File file : this.dir.listFiles())
         {
            if (!file.isFile()) continue;
            PushRegistration reg = null;
            try
            {
               reg = (PushRegistration) ctx.createUnmarshaller().unmarshal(file);
               reg.setLoadedFrom(file);
               HornetQRestLogger.LOGGER.addingPushRegistration(reg.getId());
               map.put(reg.getId(), reg);
            }
            catch (Exception e)
            {
               HornetQRestLogger.LOGGER.errorLoadingStore(e, file.getName());
            }
View Full Code Here


      {
         HornetQRestLogger.LOGGER.loadingRestStore(dir.getAbsolutePath());
         for (File file : this.dir.listFiles())
         {
            if (!file.isFile()) continue;
            PushRegistration reg = null;
            try
            {
               reg = (PushRegistration)ctx.createUnmarshaller().unmarshal(file);
               reg.setLoadedFrom(file);
               HornetQRestLogger.LOGGER.addingPushRegistration(reg.getId());
               map.put(reg.getId(), reg);
            }
            catch (Exception e)
            {
               HornetQRestLogger.LOGGER.errorLoadingStore(e, file.getName());
            }
View Full Code Here

      Assert.assertEquals(200, response.getStatus());
      Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers");
      response = consumers.request().formParameter("autoAck", "true").post();
      Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next");

      PushRegistration reg = new PushRegistration();
      reg.setDurable(false);
      XmlLink target = new XmlLink();
      target.setHref(generateURL("/queues/forwardQueue"));
      target.setRelationship("destination");
      reg.setTarget(target);
      response = pushSubscriptions.request().body("application/xml", reg).post();
      Assert.assertEquals(201, response.getStatus());
      Link pushSubscription = response.getLocation();

      ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post();
View Full Code Here

      Assert.assertEquals(200, response.getStatus());
      Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers");
      response = consumers.request().formParameter("autoAck", "true").post();
      Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next");

      PushRegistration reg = new PushRegistration();
      reg.setDurable(false);
      XmlLink target = new XmlLink();
      target.setHref(generateURL("/queues/forwardQueue"));
      target.setClassName(HornetQPushStrategy.class.getName());
      reg.setTarget(target);
      response = pushSubscriptions.request().body("application/xml", reg).post();
      Assert.assertEquals(201, response.getStatus());
      Link pushSubscription = response.getLocation();

      ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post();
View Full Code Here

      Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers");
      Link createWithId = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create-with-id");
      response = consumers.request().formParameter("autoAck", "true").post();
      Link consumeNext = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "consume-next");

      PushRegistration reg = new PushRegistration();
      reg.setDurable(false);
      XmlLink target = new XmlLink();
      target.setRelationship("template");
      target.setHref(createWithId.getHref());
      reg.setTarget(target);
      response = pushSubscriptions.request().body("application/xml", reg).post();
      Assert.assertEquals(201, response.getStatus());
      Link pushSubscription = response.getLocation();

      ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post();
View Full Code Here

      Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create");
      System.out.println("create: " + sender);
      Link pushSubscriptions = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "push-consumers");
      System.out.println("push subscriptions: " + pushSubscriptions);

      PushRegistration reg = new PushRegistration();
      reg.setDurable(false);
      XmlLink target = new XmlLink();
      target.setMethod("put");
      target.setHref(generateURL("/my"));
      reg.setTarget(target);
      response = pushSubscriptions.request().body("application/xml", reg).post();
      Assert.assertEquals(201, response.getStatus());
      Link pushSubscription = response.getLocation();

      ClientResponse res = sender.request().body("text/plain", Integer.toString(1)).post();
View Full Code Here

              "   </authentication>\n" +
              "   <header name=\"foo\">bar</header>" +
              "</push-registration>";

      JAXBContext ctx = JAXBContext.newInstance(PushRegistration.class);
      PushRegistration reg = (PushRegistration) ctx.createUnmarshaller().unmarshal(new StringReader(xml));

      System.out.println(reg);
   }
View Full Code Here

      ClientResponse res = request.head();
      Link pushConsumers = res.getHeaderAsLink("msg-push-consumers");

      // next create the XML document that represents the registration
      // Really, just create a link with the shipping URL and the type you want posted
      PushRegistration reg = new PushRegistration();
      BasicAuth authType = new BasicAuth();
      authType.setUsername("guest");
      authType.setPassword("guest");
      Authentication auth = new Authentication();
      auth.setType(authType);
      reg.setAuthenticationMechanism(auth);
      XmlLink target = new XmlLink();
      target.setHref("http://localhost:9095/queues/jms.queue.shipping");
      target.setType("application/xml");
      target.setRelationship("destination");
      reg.setTarget(target);

      res = pushConsumers.request().body("application/xml", reg).post();
      System.out.println("Create push registration.  Resource URL: " + res.getLocation().getHref());
   }
View Full Code Here

      {
         log.info("Loading REST push store from: " + this.dir.getAbsolutePath());
         for (File file : this.dir.listFiles())
         {
            if (!file.isFile()) continue;
            PushRegistration reg = null;
            try
            {
               reg = (PushRegistration) ctx.createUnmarshaller().unmarshal(file);
               reg.setLoadedFrom(file);
               log.info("adding REST push registration: " + reg.getId());
               map.put(reg.getId(), reg);
            }
            catch (Exception e)
            {
               log.error("Failed to load push store" + file.getName() + " , it is probably corrupted", e);
            }
View Full Code Here

      {
         log.info("Loading REST push store from: " + this.dir.getAbsolutePath());
         for (File file : this.dir.listFiles())
         {
            if (!file.isFile()) continue;
            PushRegistration reg = null;
            try
            {
               reg = (PushRegistration) ctx.createUnmarshaller().unmarshal(file);
               reg.setLoadedFrom(file);
               log.info("adding REST push registration: " + reg.getId());
               map.put(reg.getId(), reg);
            }
            catch (Exception e)
            {
               log.error("Failed to load push store" + file.getName() + " , it is probably corrupted", e);
            }
View Full Code Here

TOP

Related Classes of org.hornetq.rest.queue.push.xml.PushRegistration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.