Package org.uddi.subr_v3

Examples of org.uddi.subr_v3.NotifySubscriptionListener


          && endPoint.after(modelSubscription.getLastNotified())) {
         log.info("We already send out a notification within this coverage period, no need to send another one.");
         return;
      }
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
      if (resultList.getServiceList().getServiceInfos()!=null &&
          resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
        resultList.getServiceList().setServiceInfos(null);
      }
      body.setSubscriptionResultsList(resultList);
      String authorizedName = modelSubscription.getAuthorizedName();
      UDDISecurityImpl security = new UDDISecurityImpl();
      try {
        //obtain a token for this publisher
        org.uddi.api_v3.AuthToken token = security.getAuthToken(authorizedName);
        body.setAuthInfo(token.getAuthInfo());
      } catch (DispositionReportFaultMessage e) {
        body.setAuthInfo("Failed to generate token, please contact UDDI admin");
        log.error(e.getMessage(),e);
      }
     
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          QName qName = new QName(SUBR_V3_NAMESPACE, SUBSCRIPTION_LISTENER);
          try {
            Service service = Service.create(new URL(bindingTemplate.getAccessPointUrl()), qName);
            UDDISubscriptionListenerPortType subscriptionListenerPort = (UDDISubscriptionListenerPortType) service.getPort(UDDISubscriptionListenerPortType.class);
            log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
            subscriptionListenerPort.notifySubscriptionListener(body);
            //there maybe more chunks we have to send
            String chunkToken=body.getSubscriptionResultsList().getChunkToken();
            while(chunkToken!=null) {
              UddiEntityPublisher publisher = new UddiEntityPublisher();
              publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
              log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
              getSubscriptionResults.setChunkToken(chunkToken);
              resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
              body.setSubscriptionResultsList(resultList);
              subscriptionListenerPort.notifySubscriptionListener(body);
              chunkToken=body.getSubscriptionResultsList().getChunkToken();
            }
            //now log to the db that we completed sending the notification.
            Date notificationDate = new Date();
            modelSubscription.setLastNotified(notificationDate);
            em.persist(modelSubscription);
View Full Code Here


      modelSubscription.setLastNotified(notificationDate);
      em.persist(modelSubscription);
      tx.commit();
     
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
//      if (resultList.getServiceList()!=null && resultList.getServiceList().getServiceInfos()!=null &&
//          resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
//        resultList.getServiceList().setServiceInfos(null);
//      }
      body.setSubscriptionResultsList(resultList);
      String authorizedName = modelSubscription.getAuthorizedName();
      UDDISecurityImpl security = new UDDISecurityImpl();
     
      if (authorizedName != null) { // add a security token if needed
        try {
          //obtain a token for this publisher
          org.uddi.api_v3.AuthToken token = security.getAuthToken(authorizedName);
          body.setAuthInfo(token.getAuthInfo());
        } catch (DispositionReportFaultMessage e) {
          body.setAuthInfo("Failed to generate token, please contact UDDI admin");
          log.error(e.getMessage(),e);
        }
      }
     
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType()) ||
            AccessPointType.WSDL_DEPLOYMENT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          try {
            Notifier notifier = new NotifierFactory().getNotifier(bindingTemplate);
            log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
            notifier.notifySubscriptionListener(body);
            //there maybe more chunks we have to send
            String chunkToken=body.getSubscriptionResultsList().getChunkToken();
            while(chunkToken!=null) {
              UddiEntityPublisher publisher = new UddiEntityPublisher();
              publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
              log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
              getSubscriptionResults.setChunkToken(chunkToken);
              resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
              body.setSubscriptionResultsList(resultList);
              notifier.notifySubscriptionListener(body);
              chunkToken=body.getSubscriptionResultsList().getChunkToken();
            }
            //successful notification so remove from the badNotificationList
            if (badNotifications.containsKey(resultList.getSubscription().getSubscriptionKey()))
              badNotifications.remove(resultList.getSubscription().getSubscriptionKey());
          } catch (WebServiceException e) {
View Full Code Here

          && endPoint.after(modelSubscription.getLastNotified())) {
         log.info("We already send out a notification within this coverage period, no need to send another one.");
         return;
      }
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
      if (resultList.getServiceList()!=null && resultList.getServiceList().getServiceInfos()!=null &&
          resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
        resultList.getServiceList().setServiceInfos(null);
      }
      body.setSubscriptionResultsList(resultList);
      String authorizedName = modelSubscription.getAuthorizedName();
      UDDISecurityImpl security = new UDDISecurityImpl();
      try {
        //obtain a token for this publisher
        org.uddi.api_v3.AuthToken token = security.getAuthToken(authorizedName);
        body.setAuthInfo(token.getAuthInfo());
      } catch (DispositionReportFaultMessage e) {
        body.setAuthInfo("Failed to generate token, please contact UDDI admin");
        log.error(e.getMessage(),e);
      }
     
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          QName qName = new QName(SUBR_V3_NAMESPACE, SUBSCRIPTION_LISTENER);
          try {
            Service service = Service.create(new URL(bindingTemplate.getAccessPointUrl()), qName);
            UDDISubscriptionListenerPortType subscriptionListenerPort = (UDDISubscriptionListenerPortType) service.getPort(UDDISubscriptionListenerPortType.class);
            log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
            subscriptionListenerPort.notifySubscriptionListener(body);
            //there maybe more chunks we have to send
            String chunkToken=body.getSubscriptionResultsList().getChunkToken();
            while(chunkToken!=null) {
              UddiEntityPublisher publisher = new UddiEntityPublisher();
              publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
              log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
              getSubscriptionResults.setChunkToken(chunkToken);
              resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
              body.setSubscriptionResultsList(resultList);
              subscriptionListenerPort.notifySubscriptionListener(body);
              chunkToken=body.getSubscriptionResultsList().getChunkToken();
            }
            //now log to the db that we completed sending the notification.
            Date notificationDate = new Date();
            modelSubscription.setLastNotified(notificationDate);
            em.persist(modelSubscription);
View Full Code Here

      modelSubscription.setLastNotified(notificationDate);
      em.persist(modelSubscription);
      tx.commit();
     
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
//      if (resultList.getServiceList()!=null && resultList.getServiceList().getServiceInfos()!=null &&
//          resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
//        resultList.getServiceList().setServiceInfos(null);
//      }
      body.setSubscriptionResultsList(resultList);
                       
                         //TODO if the endpoint requires an auth token, look up the security endpoint of the remote registry
                        //via ClientSubscriptionInfo
                       
                        if (sendToken)
                        {
                            String authorizedName = modelSubscription.getAuthorizedName();
                            UDDISecurityImpl security = new UDDISecurityImpl();

                            if (authorizedName != null) { // add a security token if needed
                                    try {
                                            //obtain a token for this publisher
                                            org.uddi.api_v3.AuthToken token = security.getAuthToken(authorizedName);
                                            body.setAuthInfo(token.getAuthInfo());
                                    } catch (DispositionReportFaultMessage e) {
                                            body.setAuthInfo("Failed to generate token, please contact UDDI admin");
                                            log.error(e.getMessage(),e);
                                    }
                            }
                        }
     
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType()) ||
            AccessPointType.WSDL_DEPLOYMENT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          try {
            Notifier notifier = new NotifierFactory().getNotifier(bindingTemplate);
            if (notifier!=null) {
              log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
              notifier.notifySubscriptionListener(body);
              //there maybe more chunks we have to send
              String chunkToken=body.getSubscriptionResultsList().getChunkToken();
              while(chunkToken!=null) {
                UddiEntityPublisher publisher = new UddiEntityPublisher();
                publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
                log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
                getSubscriptionResults.setChunkToken(chunkToken);
                resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
                body.setSubscriptionResultsList(resultList);
                notifier.notifySubscriptionListener(body);
                chunkToken=body.getSubscriptionResultsList().getChunkToken();
              }
              //successful notification so remove from the badNotificationList
              if (badNotifications.containsKey(resultList.getSubscription().getSubscriptionKey()))
                badNotifications.remove(resultList.getSubscription().getSubscriptionKey());
            }
View Full Code Here

      modelSubscription.setLastNotified(notificationDate);
      em.persist(modelSubscription);
      tx.commit();
     
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
//      if (resultList.getServiceList()!=null && resultList.getServiceList().getServiceInfos()!=null &&
//          resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
//        resultList.getServiceList().setServiceInfos(null);
//      }
      body.setSubscriptionResultsList(resultList);
      String authorizedName = modelSubscription.getAuthorizedName();
      UDDISecurityImpl security = new UDDISecurityImpl();
     
      if (authorizedName != null) { // add a security token if needed
        try {
          //obtain a token for this publisher
          org.uddi.api_v3.AuthToken token = security.getAuthToken(authorizedName);
          body.setAuthInfo(token.getAuthInfo());
        } catch (DispositionReportFaultMessage e) {
          body.setAuthInfo("Failed to generate token, please contact UDDI admin");
          log.error(e.getMessage(),e);
        }
      }
     
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType()) ||
            AccessPointType.WSDL_DEPLOYMENT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          try {
            Notifier notifier = new NotifierFactory().getNotifier(bindingTemplate);
            if (notifier!=null) {
              log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
              notifier.notifySubscriptionListener(body);
              //there maybe more chunks we have to send
              String chunkToken=body.getSubscriptionResultsList().getChunkToken();
              while(chunkToken!=null) {
                UddiEntityPublisher publisher = new UddiEntityPublisher();
                publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
                log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
                getSubscriptionResults.setChunkToken(chunkToken);
                resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
                body.setSubscriptionResultsList(resultList);
                notifier.notifySubscriptionListener(body);
                chunkToken=body.getSubscriptionResultsList().getChunkToken();
              }
              //successful notification so remove from the badNotificationList
              if (badNotifications.containsKey(resultList.getSubscription().getSubscriptionKey()))
                badNotifications.remove(resultList.getSubscription().getSubscriptionKey());
            }
View Full Code Here

        BindingTemplate start = SubscriptionCallbackListener.start(c, "default");
        Assert.assertNotNull(start);
        //Assert.assertNotNull(start.getBindingKey());
        SubscriptionCallbackListener.registerCallback(this);
        Assert.assertNotNull(SubscriptionCallbackListener.getInstance());
        SubscriptionCallbackListener.getInstance().notifySubscriptionListener(new NotifySubscriptionListener());

        SubscriptionCallbackListener.stop(c, "default", start.getBindingKey());
        c.stop();
        Assert.assertTrue(Test2_NoAutoRegisterAndShortCircuitReceive_);
    }
View Full Code Here

            @Override
            public void NotifyEndpointStopped() {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }
        });
        SubscriptionCallbackListener.getInstance().notifySubscriptionListener(new NotifySubscriptionListener());
        SubscriptionCallbackListener.stop(c, "default", null);
        c.stop();
    }
View Full Code Here

            public void NotifyEndpointStopped() {
                log.info("bogus callback received");

            }
        });
        SubscriptionCallbackListener.getInstance().notifySubscriptionListener(new NotifySubscriptionListener());
        SubscriptionCallbackListener.stop(c, "default", null);
        c.stop();
    }
View Full Code Here

      modelSubscription.setLastNotified(notificationDate);
      em.persist(modelSubscription);
      tx.commit();
     
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
//      if (resultList.getServiceList()!=null && resultList.getServiceList().getServiceInfos()!=null &&
//          resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
//        resultList.getServiceList().setServiceInfos(null);
//      }
      body.setSubscriptionResultsList(resultList);
      String authorizedName = modelSubscription.getAuthorizedName();
      UDDISecurityImpl security = new UDDISecurityImpl();
     
      if (authorizedName != null) { // add a security token if needed
        try {
          //obtain a token for this publisher
          org.uddi.api_v3.AuthToken token = security.getAuthToken(authorizedName);
          body.setAuthInfo(token.getAuthInfo());
        } catch (DispositionReportFaultMessage e) {
          body.setAuthInfo("Failed to generate token, please contact UDDI admin");
          log.error(e.getMessage(),e);
        }
      }
     
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType()) ||
            AccessPointType.WSDL_DEPLOYMENT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          try {
            Notifier notifier = new NotifierFactory().getNotifier(bindingTemplate);
            log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
            notifier.notifySubscriptionListener(body);
            //there maybe more chunks we have to send
            String chunkToken=body.getSubscriptionResultsList().getChunkToken();
            while(chunkToken!=null) {
              UddiEntityPublisher publisher = new UddiEntityPublisher();
              publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
              log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
              getSubscriptionResults.setChunkToken(chunkToken);
              resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
              body.setSubscriptionResultsList(resultList);
              notifier.notifySubscriptionListener(body);
              chunkToken=body.getSubscriptionResultsList().getChunkToken();
            }
           
          } catch (Exception e) {
            log.error(e.getMessage(),e);
          }
View Full Code Here

          && endPoint.after(modelSubscription.getLastNotified())) {
         log.info("We already send out a notification within this coverage period, no need to send another one.");
         return;
      }
      org.apache.juddi.model.BindingTemplate bindingTemplate= em.find(org.apache.juddi.model.BindingTemplate.class, modelSubscription.getBindingKey());
      NotifySubscriptionListener body = new NotifySubscriptionListener();
      if (resultList.getServiceList().getServiceInfos().getServiceInfo().size() == 0) {
        resultList.getServiceList().setServiceInfos(null);
      }
      body.setSubscriptionResultsList(resultList);
      //body.setAuthInfo();  //where would I get the authInfo from?
      if (bindingTemplate!=null) {
        if (AccessPointType.END_POINT.toString().equalsIgnoreCase(bindingTemplate.getAccessPointType())) {
          QName qName = new QName(SUBR_V3_NAMESPACE, SUBSCRIPTION_LISTENER);
          try {
            Service service = Service.create(new URL(bindingTemplate.getAccessPointUrl()), qName);
            UDDISubscriptionListenerPortType subscriptionListenerPort = (UDDISubscriptionListenerPortType) service.getPort(UDDISubscriptionListenerPortType.class);
            log.info("Sending out notification to " + bindingTemplate.getAccessPointUrl());
            subscriptionListenerPort.notifySubscriptionListener(body);
            //there maybe more chunks we have to send
            String chunkToken=body.getSubscriptionResultsList().getChunkToken();
            while(chunkToken!=null) {
              UddiEntityPublisher publisher = new UddiEntityPublisher();
              publisher.setAuthorizedName(modelSubscription.getAuthorizedName());
              log.debug("Sending out next chunk: " + chunkToken + " to " + bindingTemplate.getAccessPointUrl());
              getSubscriptionResults.setChunkToken(chunkToken);
              resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
              body.setSubscriptionResultsList(resultList);
              subscriptionListenerPort.notifySubscriptionListener(body);
              chunkToken=body.getSubscriptionResultsList().getChunkToken();
            }
            //now log to the db that we completed sending the notification.
            Date notificationDate = new Date();
            modelSubscription.setLastNotified(notificationDate);
            em.persist(modelSubscription);
View Full Code Here

TOP

Related Classes of org.uddi.subr_v3.NotifySubscriptionListener

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.