Package org.uddi.sub_v3

Examples of org.uddi.sub_v3.ObjectFactory


        public static void removeAllExistingSubscriptions(String authinfo, UDDISubscriptionPortType sub) {
                List<Subscription> subscriptions;
                try {
                        subscriptions = sub.getSubscriptions(authinfo);

                        DeleteSubscription ds = new DeleteSubscription();
                        ds.setAuthInfo(authinfo);
                        for (int i = 0; i < subscriptions.size(); i++) {
                                ds.getSubscriptionKey().add(subscriptions.get(i).getSubscriptionKey());
                        }
                        if (!subscriptions.isEmpty()) {
                                logger.info("Purging " + subscriptions.size() + " old subscriptions");
                                sub.deleteSubscription(ds);
                        }
View Full Code Here


  }
 
  public void deleteSubscription(String authInfo, String subscriptionKey) {
    try {
      // Delete the entity and make sure it is removed
      DeleteSubscription ds = new DeleteSubscription();
      ds.setAuthInfo(authInfo);
     
      ds.getSubscriptionKey().add(subscriptionKey);
      subscription.deleteSubscription(ds);
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown.");
View Full Code Here

    }

    public static String getSubscription(String method) {
        StringWriter sw = new StringWriter();
        if (method.equalsIgnoreCase("deleteSubscription")) {
            JAXB.marshal(new DeleteSubscription(), sw);
        }
        if (method.equalsIgnoreCase("getSubscriptionResults")) {
            JAXB.marshal(new GetSubscriptionResults(), sw);
        }
        if (method.equalsIgnoreCase("getSubscriptions")) {
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");
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);
     
      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();
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();
View Full Code Here

    HttpSession session = request.getSession();
    SubscriptionResponse response = new SubscriptionResponse();
 
    try {
      //Send a request to the listener serverNode
      GetSubscriptionResults getSubscriptionResults = new GetSubscriptionResults();
      getSubscriptionResults.setAuthInfo(userAuthToken);
      getSubscriptionResults.setSubscriptionKey(modelSubscription.getSubscriptionKey());
     
      XMLGregorianCalendar calendarStart = DatatypeFactory.newInstance().newXMLGregorianCalendar(modelSubscription.getCoverageStart());
      XMLGregorianCalendar calendarEnd = DatatypeFactory.newInstance().newXMLGregorianCalendar(modelSubscription.getCoverageEnd());
      CoveragePeriod coverage = new CoveragePeriod();
      coverage.setStartPoint(calendarStart);
      coverage.setEndPoint(calendarEnd);
      getSubscriptionResults.setCoveragePeriod(coverage);
     
      String authToken = (String) session.getAttribute("token-" + modelSubscription.getFromClerkName());
      getSubscriptionResults.setAuthInfo(authToken);
            SyncSubscription syncSubscription = new SyncSubscription();
            syncSubscription.getGetSubscriptionResultsList().add(getSubscriptionResults);
     
          Transport transport = WebHelper.getTransport(session.getServletContext());
             JUDDIApiPortType apiService = transport.getJUDDIApiService();
View Full Code Here

    SubscriptionNotifier notifier = new SubscriptionNotifier();
    notifier.cancel();
    Collection<Subscription> subscriptions = notifier.getAllAsyncSubscriptions();
    Assert.assertEquals(1, subscriptions.size());
    Subscription subscription = subscriptions.iterator().next();
    GetSubscriptionResults getSubscriptionResults = notifier.buildGetSubscriptionResults(subscription, new Date());
    getSubscriptionResults.setSubscriptionKey(subscription.getSubscriptionKey());
    UddiEntityPublisher publisher = new UddiEntityPublisher();
    publisher.setAuthorizedName(subscription.getAuthorizedName());
    SubscriptionResultsList resultList = notifier.getSubscriptionImpl().getSubscriptionResults(getSubscriptionResults, publisher);
    //We're expecting a changed service (since it was added in the
    Assert.assertNotNull(resultList.getServiceList());
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()));
            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

Related Classes of org.uddi.sub_v3.ObjectFactory

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.