Examples of GetSubscriptionResults


Examples of org.uddi.sub_v3.GetSubscriptionResults

                        pa.getKeyedReference().setTModelKey("uddi:uddi.org:relationships");

                        r.getPublisherAssertion().add(pa);
                        publicationJoe.addPublisherAssertions(r);

                        GetSubscriptionResults gsr = new GetSubscriptionResults();
                        gsr.setAuthInfo(authInfoJoe);
                        gsr.setSubscriptionKey(data.value.get(0).getSubscriptionKey());
                        gsr.setCoveragePeriod(new CoveragePeriod());
                        GregorianCalendar gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        gcal.add(Calendar.HOUR, -1);
                        gsr.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
                        gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        gsr.getCoveragePeriod().setEndPoint(df.newXMLGregorianCalendar(gcal));
                        SubscriptionResultsList subscriptionResults = tckSubscriptionJoe.subscription.getSubscriptionResults(gsr);
                        Assert.assertNotNull(subscriptionResults);
                        Assert.assertNull(subscriptionResults.getBusinessList());
                        Assert.assertNotNull(subscriptionResults.getCoveragePeriod());
                        Assert.assertNull(subscriptionResults.getServiceList());
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

                        r.getPublisherAssertion().add(pa);
                        publicationJoe.addPublisherAssertions(r);



                        GetSubscriptionResults gsr = new GetSubscriptionResults();
                        gsr.setAuthInfo(authInfoJoe);
                        gsr.setSubscriptionKey(data.value.get(0).getSubscriptionKey());
                        gsr.setCoveragePeriod(new CoveragePeriod());
                        GregorianCalendar gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        gcal.add(Calendar.HOUR, -1);
                        gsr.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
                        gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        gsr.getCoveragePeriod().setEndPoint(df.newXMLGregorianCalendar(gcal));
                        SubscriptionResultsList subscriptionResults = tckSubscriptionJoe.subscription.getSubscriptionResults(gsr);
                        Assert.assertNotNull(subscriptionResults);
                        Assert.assertNull(subscriptionResults.getBusinessList());
                        Assert.assertNotNull(subscriptionResults.getCoveragePeriod());
                        Assert.assertNull(subscriptionResults.getServiceList());
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

                        dp.setAuthInfo(authInfoSam);
                        dp.getPublisherAssertion().add(pa);
                        //publicationSam.deletePublisherAssertions(dp);


                        GetSubscriptionResults gsr = new GetSubscriptionResults();
                        gsr.setAuthInfo(authInfoJoe);
                        gsr.setSubscriptionKey(data.value.get(0).getSubscriptionKey());
                        gsr.setCoveragePeriod(new CoveragePeriod());
                        GregorianCalendar gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        gcal.add(Calendar.HOUR, -1);
                        gsr.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
                        gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        gsr.getCoveragePeriod().setEndPoint(df.newXMLGregorianCalendar(gcal));
                        SubscriptionResultsList subscriptionResults = tckSubscriptionJoe.subscription.getSubscriptionResults(gsr);
                        Assert.assertNotNull(subscriptionResults);
                        Assert.assertNull(subscriptionResults.getBusinessList());
                        Assert.assertNotNull(subscriptionResults.getCoveragePeriod());
                        Assert.assertNull(subscriptionResults.getServiceList());
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

        Collection<Subscription> subscriptions = notifier.getAllAsyncSubscriptions();

        Assert.assertEquals(1, subscriptions.size());
        Subscription subscription = subscriptions.iterator().next();
        Assert.assertNotNull(subscription);
        GetSubscriptionResults getSubscriptionResults = notifier.buildGetSubscriptionResults(subscription, new Date(new Date().getTime() + 60000l));
        if (getSubscriptionResults!=null)
        {
            getSubscriptionResults.setSubscriptionKey(subscription.getSubscriptionKey());
            UddiEntityPublisher publisher = new UddiEntityPublisher();
            publisher.setAuthorizedName(subscription.getAuthorizedName());
            SubscriptionResultsList resultList = notifier.getSubscriptionImpl().getSubscriptionResults(getSubscriptionResults, publisher);
            logger.info("Expecting the resultList to be null: " + resultList.getServiceList());
            Assert.assertNull(resultList.getServiceList());
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

        if (subscription.getExpiresAfter()==null || subscription.getExpiresAfter().getTime() > startTime) {
          try {
            //build a query with a coverage period from the lastNotified time to
            //now (the scheduled Execution time)
            Date notificationDate = new Date(scheduledExecutionTime());
            GetSubscriptionResults getSubscriptionResults =
              buildGetSubscriptionResults(subscription, notificationDate);
            if (getSubscriptionResults!=null) {
              getSubscriptionResults.setSubscriptionKey(subscription.getSubscriptionKey());
              UddiEntityPublisher publisher = new UddiEntityPublisher();
              publisher.setAuthorizedName(subscription.getAuthorizedName());
              SubscriptionResultsList resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
              if (resultListContainsChanges(resultList)) {
                log.debug("We have a change and need to notify " + subscription.getSubscriptionKey());
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

    }
  }
  protected GetSubscriptionResults buildGetSubscriptionResults(Subscription subscription, Date endPoint)
    throws DispositionReportFaultMessage, DatatypeConfigurationException {
   
    GetSubscriptionResults getSubscriptionResults = null;
    Duration duration = TypeConvertor.convertStringToDuration(subscription.getNotificationInterval());
    Date startPoint = subscription.getLastNotified();
    Date nextDesiredNotificationDate = null;
    if (startPoint==null) startPoint = subscription.getCreateDate();
    nextDesiredNotificationDate = new Date(startPoint.getTime());
    duration.addTo(nextDesiredNotificationDate);
    //nextDesiredNotificationDate = lastTime + the Interval Duration, which should be:
    //AFTER the lastNotified time and BEFORE the endTime (current time). If it is
    //after the endTime, then the user does not want a notification yet, so we accumulate.
    if (subscription.getLastNotified()==null || nextDesiredNotificationDate.after(startPoint) && nextDesiredNotificationDate.before(endPoint)) {
      getSubscriptionResults = new GetSubscriptionResults();
      CoveragePeriod period = new CoveragePeriod();
      GregorianCalendar calendar = new GregorianCalendar();
      calendar.setTimeInMillis(startPoint.getTime());
      period.setStartPoint(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
      calendar.setTimeInMillis(endPoint.getTime());
      period.setEndPoint(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
      if (log.isDebugEnabled()) log.debug("Period " + period.getStartPoint() + " " + period.getEndPoint());
      getSubscriptionResults.setCoveragePeriod(period);
    } else {
      log.debug("Client does not yet want a notification. The next desidered notification Date " + nextDesiredNotificationDate + ". The current interval ["
        + startPoint + " , " + endPoint + "] therefore skipping this notification cycle.");
      if (desiredDate==null || nextDesiredNotificationDate.getTime() < desiredDate.getTime()) {
        desiredDate = nextDesiredNotificationDate;
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

                        GregorianCalendar gcal = new GregorianCalendar();
                        gcal.setTimeInMillis(System.currentTimeMillis());
                        XMLGregorianCalendar xcal = df.newXMLGregorianCalendar(gcal);

                        //
                        GetSubscriptionResults req = new GetSubscriptionResults();
                        req.setAuthInfo(authtoken);
                        //TODO insert your subscription key values here
                        req.setSubscriptionKey(key);
                        req.setCoveragePeriod(new CoveragePeriod());
                        req.getCoveragePeriod().setEndPoint(xcal);

                        gcal = new GregorianCalendar();
                        //Time range that we want change logs on
                        gcal.add(Calendar.MONTH, -1);
                        req.getCoveragePeriod().setStartPoint(df.newXMLGregorianCalendar(gcal));
                        SubscriptionResultsList subscriptionResults = uddiSubscriptionService.getSubscriptionResults(req);
                        System.out.println("items modified: " + subscriptionResults.getBusinessDetail().getBusinessEntity().size());

                } catch (Exception e) {
                        e.printStackTrace();
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

     
      Collection<Subscription> subscriptions = getAllSubscriptions();
      for (Subscription subscription : subscriptions) {
        if (subscription.getExpiresAfter()==null || subscription.getExpiresAfter().getTime() > startTime) {
          try {
            GetSubscriptionResults getSubscriptionResults = buildGetSubscriptionResults(subscription);
            getSubscriptionResults.setSubscriptionKey(subscription.getSubscriptionKey());
            UddiEntityPublisher publisher = new UddiEntityPublisher();
            publisher.setAuthorizedName(subscription.getAuthorizedName());
            SubscriptionResultsList resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
            if (resultListContainsChanges(resultList)) {
              log.info("We have a change and need to notify..");
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

    }
  }
  protected GetSubscriptionResults buildGetSubscriptionResults(Subscription subscription)
    throws DispositionReportFaultMessage, DatatypeConfigurationException {
   
    GetSubscriptionResults getSubscriptionResults = null;
    Date startPoint = subscription.getLastNotified();
    if (startPoint==null) startPoint = subscription.getCreateDate();
    Date endPoint   = new Date(scheduledExecutionTime());

    Duration duration = TypeConvertor.convertStringToDuration(subscription.getNotificationInterval());
    Date nextDesiredNotificationDate = startPoint;
    duration.addTo(nextDesiredNotificationDate);

    if (subscription.getLastNotified()==null || nextDesiredNotificationDate.after(startPoint) && nextDesiredNotificationDate.before(endPoint)) {
      getSubscriptionResults = new GetSubscriptionResults();
     
      CoveragePeriod period = new CoveragePeriod();
      GregorianCalendar calendar = new GregorianCalendar();
      calendar.setTimeInMillis(startPoint.getTime());
      period.setStartPoint(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
      calendar.setTimeInMillis(endPoint.getTime());
      period.setEndPoint(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
      getSubscriptionResults.setCoveragePeriod(period);
    }
    return getSubscriptionResults;
   
  }
View Full Code Here

Examples of org.uddi.sub_v3.GetSubscriptionResults

     
      Collection<Subscription> subscriptions = getAllAsyncSubscriptions();
      for (Subscription subscription : subscriptions) {
        if (subscription.getExpiresAfter()==null || subscription.getExpiresAfter().getTime() > startTime) {
          try {
            GetSubscriptionResults getSubscriptionResults = buildGetSubscriptionResults(subscription, new Date(scheduledExecutionTime()));
            getSubscriptionResults.setSubscriptionKey(subscription.getSubscriptionKey());
            UddiEntityPublisher publisher = new UddiEntityPublisher();
            publisher.setAuthorizedName(subscription.getAuthorizedName());
            SubscriptionResultsList resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
            if (resultListContainsChanges(resultList)) {
              log.info("We have a change and need to notify..");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.