Package reactor.event

Examples of reactor.event.CachingRegistryTests$Subscription


                        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();
        if (tmodelList == null || tmodelList.getTModelInfos()==null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelList.getTModelInfos().getTModelInfo().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
            assertEquals(resultSize, FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities());
          else
            assertEquals(resultSize, subIn.getMaxEntities().intValue());
        }
       
        chunkToken = result.getChunkToken();
       
      }
View Full Code Here


    subFil.setGetBusinessDetail(getBusinessDetail);
   
    //Duration duration = new Duration();
    //duration.
   
    Subscription sub = new Subscription();
    sub.setSubscriptionFilter(subFil);
    sub.setBindingKey("bindingKeyOfTheClientsNotifySubscriptionListenerService");
    //sub.setNotificationInterval(duration);
   
   
    //SaveSubscription saveSub = new SaveSubscription();
    //saveSub.getSubscription().add(sub);
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();
        if (tmodelDetail == null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelDetail.getTModel().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
            assertEquals(resultSize, FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities());
          else
            assertEquals(resultSize, subIn.getMaxEntities().intValue());
        }
       
        chunkToken = result.getChunkToken();
       
      }
View Full Code Here

   
  }
 
  public void saveSubscription(String authInfo, String subscriptionXML, String subscriptionKey, String bindingkey) {
    try {
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(subscriptionXML, "org.uddi.sub_v3");
      List<Subscription> subscriptionList = new ArrayList<Subscription>();
                        subIn.setSubscriptionKey(subscriptionKey);
                       // if (subIn.getBindingKey()!=null && subIn.getBindingKey().length()==0){
                         //       subIn.setBindingKey(null);
                        //}
                        subIn.setBindingKey(bindingkey);
      subscriptionList.add(subIn);
      Holder<List<Subscription>> subscriptionHolder = new Holder<List<Subscription>>();
      subscriptionHolder.value = subscriptionList;
     
      subscription.saveSubscription(authInfo, subscriptionHolder);
     
      Subscription subDirectOut = subscriptionHolder.value.get(0);
      assertEquals(subIn.getSubscriptionKey(), subDirectOut.getSubscriptionKey());
     
      List<Subscription> outSubscriptionList = subscription.getSubscriptions(authInfo);
      Assert.assertNotNull(outSubscriptionList);
      Subscription subOut = outSubscriptionList.get(0);
     
      assertEquals(subIn.getSubscriptionKey(), subOut.getSubscriptionKey());
      assertEquals(subDirectOut.getExpiresAfter().getMonth(), subOut.getExpiresAfter().getMonth());
      assertEquals(subDirectOut.getExpiresAfter().getDay(), subOut.getExpiresAfter().getDay());
      assertEquals(subDirectOut.getExpiresAfter().getYear(), subOut.getExpiresAfter().getYear());
     
      //assertEquals(subIn.getSubscriptionFilter().getFindService().getName().get(0).getValue(),
      //       subOut.getSubscriptionFilter().getFindService().getName().get(0).getValue());
     
    } catch (Exception e) {
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

         * @param outmsg
         * @param session
         * @return subscription
         */
        public static Subscription BuildClientSubscription(Map map, AtomicReference<String> outmsg, HttpSession session) {
                Subscription sub = new Subscription();
                if (outmsg == null) {
                        outmsg = new AtomicReference<String>();
                }

                try {
                        String alertType = ((String[]) map.get("alertType"))[0];
                        if (alertType == null) {
                                outmsg.set("alertType not defined");
                                return null;
                        }
                        if (alertType.equalsIgnoreCase("specificItem")) {
                                sub = BuildClientSubscriptionSpecificItem(map, outmsg, (String) session.getAttribute("locale"));
                        } else if (alertType.equalsIgnoreCase("searchResults")) {
                                sub = BuildClientSubscriptionSearchResults(map, outmsg);
                        } else {
                                outmsg.set("alertType invalid");
                                return null;
                        }
                        if (sub == null) {
                                return null;
                        }

                        String alertTransport = ((String[]) map.get("alertTransport"))[0];
                        if (alertTransport == null) {
                        } else {
                                if (alertTransport.equalsIgnoreCase("bindingTemplate")) {
                                        sub.setBindingKey(((String[]) map.get("bindingKey"))[0]);
                                } else {
                                        sub.setBindingKey(null);
                                }
                        }
                        if (map.get("subkey") != null) {
                                String subkey = ((String[]) map.get("subkey"))[0];
                                if (subkey != null && !subkey.equalsIgnoreCase(ResourceLoader.GetResource(session, "items.clicktoedit"))) {
                                        sub.setSubscriptionKey(subkey);
                                }
                        }
                        //options
                        sub = BuildSubscriptionOptions(map, sub);
                        return sub;
View Full Code Here

        }

        private static Subscription BuildClientSubscriptionSpecificItem(Map map, AtomicReference<String> outmsg, String locale) {
                try {
                        Subscription sub = new Subscription();
                        String alertCritera = ((String[]) map.get("alertCriteraSingleItem"))[0];

                        List<String> keys = new ArrayList<String>();
                        String ItemKey = ((String[]) map.get("itemKey"))[0];
                        if (ItemKey == null) {
                                outmsg.set("no item defined");
                                return null;
                        }
                        //TODO this is an issue. Unknown if commas can be included within UDDI keys
                        if (ItemKey.contains(",")) {
                                String[] k2 = ItemKey.split(",");
                                for (int i = 0; i < k2.length; i++) {
                                        if (k2[i] == null) {
                                                continue;
                                        }
                                        if (k2[i].trim().isEmpty()) {
                                                continue;
                                        }
                                        keys.add(k2[i].trim());
                                }
                        } else {
                                keys.add(ItemKey);
                        }

                        sub.setSubscriptionFilter(new SubscriptionFilter());

                        if (alertCritera != null) {

                                if (alertCritera.equalsIgnoreCase("binding")) {
                                        sub.getSubscriptionFilter().setGetBindingDetail(new GetBindingDetail());
                                        sub.getSubscriptionFilter().getGetBindingDetail().getBindingKey().addAll(keys);
                                } else if (alertCritera.equalsIgnoreCase("service")) {
                                        sub.getSubscriptionFilter().setGetServiceDetail(new GetServiceDetail());
                                        sub.getSubscriptionFilter().getGetServiceDetail().getServiceKey().addAll(keys);
                                } else if (alertCritera.equalsIgnoreCase("business")) {
                                        sub.getSubscriptionFilter().setGetBusinessDetail(new GetBusinessDetail());
                                        sub.getSubscriptionFilter().getGetBusinessDetail().getBusinessKey().addAll(keys);
                                } else if (alertCritera.equalsIgnoreCase("publisherAssertion")) {
                                        //unknow if this will work
                                        sub.getSubscriptionFilter().setGetAssertionStatusReport(new GetAssertionStatusReport());
                                        sub.getSubscriptionFilter().getGetAssertionStatusReport().setCompletionStatus(CompletionStatus.valueOf(((String[]) map.get("assertionStatus"))[0]));
                                } else if (alertCritera.equalsIgnoreCase("relatedBusiness")) {
                                        outmsg.set("relatedBusiness is not supported for single item subscriptions");
                                        return null;
                                } else if (alertCritera.equalsIgnoreCase("tmodel")) {
                                        sub.getSubscriptionFilter().setGetTModelDetail(new GetTModelDetail());
                                        sub.getSubscriptionFilter().getGetTModelDetail().getTModelKey().addAll(keys);
                                } else {
                                        outmsg.set("alert critera invalid");
                                        return null;
                                }
                        } else {
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

  public void getSamSyndicatorSubscriptionResultsWithChunkingOnFind(String authInfoSam) {   
    try {
      GetSubscriptionResults getSubResultsIn = (GetSubscriptionResults)EntityCreator.buildFromDoc(SAM_SUBSCRIPTIONRESULTS2_XML, "org.uddi.sub_v3");
      getSubResultsIn.setAuthInfo(authInfoSam);
     
      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++;
     
      String chunkToken = "";
      int iterations = 0;
      while (chunkToken != null) {
        iterations++;
       
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
       
        TModelList tmodelList = result.getTModelList();
        if (tmodelList == null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelList.getTModelInfos().getTModelInfo().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
            assertEquals(resultSize, FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities());
          else
            assertEquals(resultSize, subIn.getMaxEntities().intValue());
        }
       
        chunkToken = result.getChunkToken();
       
      }
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");
     
      int expectedIterations = FINDQUALIFIER_TMODEL_TOTAL / subIn.getMaxEntities();
      if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() >0)
        expectedIterations++;
     
      String chunkToken = "";
      int iterations = 0;
      while (chunkToken != null) {
        iterations++;
       
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
       
        TModelDetail tmodelDetail = result.getTModelDetail();
        if (tmodelDetail == null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelDetail.getTModel().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
            assertEquals(resultSize, FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities());
          else
            assertEquals(resultSize, subIn.getMaxEntities().intValue());
        }
       
        chunkToken = result.getChunkToken();
       
      }
View Full Code Here

TOP

Related Classes of reactor.event.CachingRegistryTests$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.