Package dijjer.io.subscription

Examples of dijjer.io.subscription.SubscriptionManager$Subscription


                BusinessDetail saveBusiness1 = publicationSam.saveBusiness(sb);

                //ok Joe now needs to subscribe for Sam's business
                Holder<List<Subscription>> list = new Holder<List<Subscription>>();
                list.value = new ArrayList<Subscription>();
                Subscription s = new Subscription();
                s.setBindingKey(saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().get(0).getBindingTemplates().getBindingTemplate().get(0).getBindingKey());
                s.setSubscriptionFilter(new SubscriptionFilter());
                s.getSubscriptionFilter().setGetBusinessDetail(new GetBusinessDetail());
                s.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().add(saveBusiness1.getBusinessEntity().get(0).getBusinessKey());
                DatatypeFactory df = DatatypeFactory.newInstance();
                GregorianCalendar gcal = new GregorianCalendar();
                gcal.setTimeInMillis(System.currentTimeMillis());
                gcal.add(Calendar.HOUR, 1);
                s.setExpiresAfter(df.newXMLGregorianCalendar(gcal));

                s.setNotificationInterval(df.newDuration(5000));
                list.value.add(s);
                logger.info("subscribing joe's to updates for sam's business");
                subscriptionJoe.saveSubscription(authInfoJoe, list);

                //ok have sam change his business around.
View Full Code Here


                BindingTemplate start = SubscriptionCallbackListener.start(client, "default");

                //register for callbacks
                SubscriptionCallbackListener.registerCallback(this);

                Subscription sub = new Subscription();
                sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                sub.setBindingKey(start.getBindingKey());
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindBusiness(new FindBusiness());
                sub.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));

                Subscription subscriptionBiz = clerk.register(sub, clerk.getUDDINode().getApiNode());

                System.out.println("Registered FindBusiness subscription key: " + (subscriptionBiz.getSubscriptionKey()) + " bindingkey: " + subscriptionBiz.getBindingKey());

                sub = new Subscription();
                sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                sub.setBindingKey(start.getBindingKey());
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindService(new FindService());
                sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindService().getName().add(new Name(UDDIConstants.WILDCARD, null));

                Subscription subscriptionSvc = clerk.register(sub, clerk.getUDDINode().getApiNode());

                System.out.println("Registered FindService subscription key: " + (subscriptionSvc.getSubscriptionKey()) + " bindingkey: " + subscriptionSvc.getBindingKey());

                sub = new Subscription();
                sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                sub.setBindingKey(start.getBindingKey());
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindTModel(new FindTModel());
                sub.getSubscriptionFilter().getFindTModel().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindTModel().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindTModel().setName(new Name(UDDIConstants.WILDCARD, null));

                Subscription subscriptionTM = clerk.register(sub, clerk.getUDDINode().getApiNode());

                System.out.println("Registered FindTModel subscription key: " + (subscriptionTM.getSubscriptionKey()) + " bindingkey: " + subscriptionTM.getBindingKey());

                System.out.println("Waiting for callbacks. Now would be a good time to launch either another program or juddi-gui to make some changes. Press any key to stop!");
                //Thread hook = new Thread(this);
              //  Runtime.getRuntime().addShutdownHook(hook);
               
                        System.in.read();
               
                SubscriptionCallbackListener.stop(client, "default", start.getBindingKey());
                clerk.unRegisterSubscription(subscriptionBiz.getSubscriptionKey());
                clerk.unRegisterSubscription(subscriptionSvc.getSubscriptionKey());
                clerk.unRegisterSubscription(subscriptionTM.getSubscriptionKey());

                clerk.unRegisterTModel(createKeyGenator.getTModelKey());

                clerk.unRegisterBusiness("uddi:somebusiness:somebusinesskey");
View Full Code Here

                        MessageConsumer consumer = session.createConsumer(destination);

                        consumer.setMessageListener(this);
                        System.out.println("Connected and listening...");

                        Subscription sub = new Subscription();
                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                        sub.setBindingKey(base + "binding");
                        sub.setSubscriptionKey(base + "sub-fb");
                        sub.setSubscriptionFilter(new SubscriptionFilter());
                        sub.getSubscriptionFilter().setFindBusiness(new FindBusiness());
                        sub.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());
                        sub.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        sub.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));

                        Subscription subscriptionBiz = clerk.register(sub, clerk.getUDDINode().getApiNode());

                        System.out.println("Registered FindBusiness subscription key: " + (subscriptionBiz.getSubscriptionKey()) + " bindingkey: " + subscriptionBiz.getBindingKey());

                        sub = new Subscription();
                        sub.setSubscriptionKey(base + "sub-fs");
                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                        sub.setBindingKey(base + "binding");
                        sub.setSubscriptionFilter(new SubscriptionFilter());
                        sub.getSubscriptionFilter().setFindService(new FindService());
                        sub.getSubscriptionFilter().getFindService().setFindQualifiers(new FindQualifiers());
                        sub.getSubscriptionFilter().getFindService().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        sub.getSubscriptionFilter().getFindService().getName().add(new Name(UDDIConstants.WILDCARD, null));

                        Subscription subscriptionSvc = clerk.register(sub, clerk.getUDDINode().getApiNode());

                        System.out.println("Registered FindService subscription key: " + (subscriptionSvc.getSubscriptionKey()) + " bindingkey: " + subscriptionSvc.getBindingKey());

                        sub = new Subscription();
                        sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                        sub.setBindingKey(base + "binding");
                        sub.setSubscriptionKey(base + "sub-ft");
                        sub.setSubscriptionFilter(new SubscriptionFilter());
                        sub.getSubscriptionFilter().setFindTModel(new FindTModel());
                        sub.getSubscriptionFilter().getFindTModel().setFindQualifiers(new FindQualifiers());
                        sub.getSubscriptionFilter().getFindTModel().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        sub.getSubscriptionFilter().getFindTModel().setName(new Name(UDDIConstants.WILDCARD, null));

                        Subscription subscriptionTM = clerk.register(sub, clerk.getUDDINode().getApiNode());

                        System.out.println("Registered FindTModel subscription key: " + (subscriptionTM.getSubscriptionKey()) + " bindingkey: " + subscriptionTM.getBindingKey());

                        System.out.println("Waiting for callbacks. Now would be a good time to launch either another program or juddi-gui to make some changes. Press any key to stop!");

                        System.out.println("Listening, press any key to quit");
                        System.in.read();
View Full Code Here

     
      List<org.apache.juddi.model.Subscription> modelSubscriptionList = (List<org.apache.juddi.model.Subscription>)FindSubscriptionByPublisherQuery.select(em, publisher.getAuthorizedName());
      if (modelSubscriptionList != null && modelSubscriptionList.size() > 0) {
        for (org.apache.juddi.model.Subscription modelSubscription : modelSubscriptionList) {
         
          Subscription apiSubscription = new Subscription();
         
          MappingModelToApi.mapSubscription(modelSubscription, apiSubscription);
         
          result.add(apiSubscription);
        }
View Full Code Here

     
      List<org.apache.juddi.model.Subscription> modelSubscriptionList = (List<org.apache.juddi.model.Subscription>)FindSubscriptionByPublisherQuery.select(em, publisher.getAuthorizedName());
      if (modelSubscriptionList != null && modelSubscriptionList.size() > 0) {
        for (org.apache.juddi.model.Subscription modelSubscription : modelSubscriptionList) {
         
          Subscription apiSubscription = new Subscription();
         
          MappingModelToApi.mapSubscription(modelSubscription, apiSubscription);
         
          result.add(apiSubscription);
        }
View Full Code Here

TOP

Related Classes of dijjer.io.subscription.SubscriptionManager$Subscription

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.