Package org.uddi.sub_v3

Examples of org.uddi.sub_v3.DeleteSubscription


     
      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


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

    Duration duration = TypeConvertor.convertStringToDuration(subscription.getNotificationInterval());
    Date nextDesiredNotificationDate = new Date(startPoint.getTime());
    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

            !isTemporarilyDisabled(subscription.getSubscriptionKey())) {
          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

    }
  }
  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

     
      Collection<Subscription> subscriptions = getAllAsyncSubscriptions();
      for (Subscription subscription : subscriptions) {
        if (subscription.getExpiresAfter()==null || subscription.getExpiresAfter().getTime() > startTime) {
          try {
            GetSubscriptionResults getSubscriptionResults = buildGetSubscriptionResults(subscription, new Date(scheduledExecutionTime()));
            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.info("We have a change and need to notify..");
View Full Code Here

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

    Duration duration = TypeConvertor.convertStringToDuration(subscription.getNotificationInterval());
    Date nextDesiredNotificationDate = new Date(startPoint.getTime());
    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

    deleteSubscription(authInfoJoe, JOE_SUBSCRIPTION_KEY);
  }
 
  public void getJoePublisherSubscriptionResults(String authInfoJoe) {   
    try {
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(JOE_SUBSCRIPTIONRESULTS_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoJoe);
     
      SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
      if (result == null)
        Assert.fail("Null result from getSubscriptionResults operation");
                        ServiceInfos sInfos=null;
View Full Code Here

    deleteSubscription(authInfoSam, SAM_SUBSCRIPTION3_KEY);
  }
 
  public void getSamSyndicatorSubscriptionResults(String authInfoSam) {   
    try {
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoSam);
     
      SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
      if (result == null)
        Assert.fail("Null result from getSubscriptionResults operation");
View Full Code Here

  }
 
  public void getSamSyndicatorSubscriptionResultsWithChunkingOnFind(String authInfoSam) {   
    try {
                       
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS2_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoSam);
                        FindTModel ftm = new FindTModel();
                        ftm.setAuthInfo(authInfoSam);
                        ftm.setCategoryBag(new CategoryBag());
                        ftm.getCategoryBag().getKeyedReference().add(new KeyedReference("uddi:uddi.org:categorization:types", "uddi-org:types:findQualifier", "findQualifier"));
                        TModelList findTModel = inquiry.findTModel(ftm);
     
                        FINDQUALIFIER_TMODEL_TOTAL = findTModel.getListDescription().getActualCount();
                       
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(SAM_SUBSCRIPTION2_XML, "org.uddi.sub_v3");
     
      int expectedIterations = FINDQUALIFIER_TMODEL_TOTAL / subIn.getMaxEntities();
      if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() >0)
        expectedIterations++;
     
                       
                        logger.info("getSamSyndicatorSubscriptionResultsWithChunkingOnFind loading from " + SAM_SUBSCRIPTION2_XML + " expecting " + FINDQUALIFIER_TMODEL_TOTAL + " find qualifier tmodels. Fetching "
                        + subIn.getMaxEntities() + " at a time, expected iterations " + expectedIterations);
     
      String chunkToken = "";
      int iterations = 0;
                        //JUDDI-655
      while (chunkToken != null && !chunkToken.equalsIgnoreCase("0")) {
        iterations++;
                               
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
        Assert.assertNotNull("Chunk token should either be not null or '0'",result.getChunkToken());
        TModelList tmodelList = result.getTModelList();
View Full Code Here

   
  }
 
  public void getSamSyndicatorSubscriptionResultsWithChunkingOnGet(String authInfoSam) {
    try {
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS3_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoSam);
         
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(SAM_SUBSCRIPTION3_XML, "org.uddi.sub_v3");
     
                        FINDQUALIFIER_TMODEL_TOTAL = 22;
                       
      int expectedIterations = FINDQUALIFIER_TMODEL_TOTAL / subIn.getMaxEntities();
      if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() >0)
        expectedIterations++;
     
      String chunkToken = "";
      int iterations = 0;
      while (chunkToken != null && !chunkToken.equalsIgnoreCase("0")) {
        iterations++;
       
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
        Assert.assertNotNull("Chunk token should either be not null or '0'",result.getChunkToken());
        TModelDetail tmodelDetail = result.getTModelDetail();
View Full Code Here

TOP

Related Classes of org.uddi.sub_v3.DeleteSubscription

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.