Package org.apache.juddi.api_v3

Examples of org.apache.juddi.api_v3.GetPublisherDetail


 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidateClerk(publisher).validateSaveClerk(em, body);
     
      ClerkDetail result = new ClerkDetail();
 
      List<org.apache.juddi.api_v3.Clerk> apiClerkList = body.getClerk();;
      for (org.apache.juddi.api_v3.Clerk apiClerk : apiClerkList) {
       
        org.apache.juddi.model.Clerk modelClerk = new org.apache.juddi.model.Clerk();
       
        MappingApiToModel.mapClerk(apiClerk, modelClerk);
       
        Object existingUddiEntity = em.find(modelClerk.getClass(), modelClerk.getClerkName());
        if (existingUddiEntity != null) {
          em.merge(modelClerk);
        } else {
          em.persist(modelClerk);
        }
       
        result.getClerk().add(apiClerk);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here


 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidateClerk(publisher).validateSaveClerk(em, body);
     
      ClerkDetail result = new ClerkDetail();
 
      List<org.apache.juddi.api_v3.Clerk> apiClerkList = body.getClerk();;
      for (org.apache.juddi.api_v3.Clerk apiClerk : apiClerkList) {
       
        org.apache.juddi.model.Clerk modelClerk = new org.apache.juddi.model.Clerk();
       
        MappingApiToModel.mapClerk(apiClerk, modelClerk);
       
        Object existingUddiEntity = em.find(modelClerk.getClass(), modelClerk.getClerkName());
        if (existingUddiEntity != null) {
          em.merge(modelClerk);
        } else {
          em.persist(modelClerk);
        }
       
        result.getClerk().add(apiClerk);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

                        UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());

                        new ValidateClerk(publisher).validateSaveClerk(em, body);

                        ClerkDetail result = new ClerkDetail();

                        List<org.apache.juddi.api_v3.Clerk> apiClerkList = body.getClerk();;
                        for (org.apache.juddi.api_v3.Clerk apiClerk : apiClerkList) {

                                org.apache.juddi.model.Clerk modelClerk = new org.apache.juddi.model.Clerk();

                                MappingApiToModel.mapClerk(apiClerk, modelClerk);

                                Object existingUddiEntity = em.find(modelClerk.getClass(), modelClerk.getClerkName());
                                if (existingUddiEntity != null) {
                                        em.merge(modelClerk);
                                } else {
                                        em.persist(modelClerk);
                                }

                                result.getClerk().add(apiClerk);
                        }

                        tx.commit();
                        return result;
                } finally {
View Full Code Here

    }
  }
 
  @Test
  public void addClientSubscriptionInfo() {
    ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
   
    Node node = new Node();
    node.setSecurityUrl("http://localhost:8080/services/securityUrl");
    node.setName("default");
   
    Clerk clerk = new Clerk();
    clerk.setName("default");
    clerk.setPublisher("root");
    clerk.setNode(node);
 
                Clerk toClerk = new Clerk();
                toClerk.setName("medroot");
                toClerk.setPublisher("root");
                toClerk.setNode(node);
 
    clientSubscriptionInfo.setFromClerk(clerk);
    clientSubscriptionInfo.setToClerk(toClerk);
   
    clientSubscriptionInfo.setSubscriptionKey("mykey");
   
    SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
    saveClientSubscriptionInfo.setAuthInfo(authInfo);
    saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
   
View Full Code Here

      juddiApiService.saveClerk(saveToClerk);
      logger.debug("Updating default UDDI server completed.");
     
      SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
      saveClientSubscriptionInfo.setAuthInfo(userAuthToken);
      ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
      clientSubscriptionInfo.setSubscriptionKey(modelSubscription.getSubscriptionKey());
      clientSubscriptionInfo.setFromClerk(clerk.getApiClerk());
      clientSubscriptionInfo.setToClerk(toClerk.getApiClerk());
     
      saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
      //save clientSubscription to the listening UDDI default server.
      juddiApiService.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
      logger.debug("Saved ClientSubscriptionInfo to the default UDDI server");
View Full Code Here

    Registry.stop();
  }
 
  @Test
  public void addClientSubscriptionInfo() {
    ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
   
    Node node = new Node();
    node.setSecurityUrl("http://localhost:8080/services/securityUrl");
    node.setCustodyTransferUrl("http://localhost:8080/services/securityUrl");
    node.setDescription("description");
    node.setInquiryUrl("http://localhost:8080/services/securityUrl");
    node.setPublishUrl("http://localhost:8080/services/securityUrl");
    node.setProxyTransport("class");
    node.setSubscriptionUrl("http://localhost:8080/services/securityUrl");
    node.setName("default");
    node.setManagerName("defaultManager");
    SaveNode saveNode = new SaveNode();
    saveNode.setAuthInfo(authInfoJoe);
    saveNode.getNode().add(node);
   
    Clerk clerk = new Clerk();
    clerk.setName("clerkName");
    clerk.setPublisher("root");
    clerk.setNode(node);
    SaveClerk saveClerk = new SaveClerk();
    saveClerk.setAuthInfo(authInfoJoe);
    saveClerk.getClerk().add(clerk);
   
    clientSubscriptionInfo.setFromClerk(clerk);
   
    Node node2 = new Node();
    node2.setSecurityUrl("http://localhost:8080/services/securityUrl2");
    node2.setCustodyTransferUrl("https://localhost:8080/services/securityUrl2");
    node2.setDescription("description2");
    node2.setInquiryUrl("http://localhost:8080/services/securityUrl2");
    node2.setPublishUrl("http://localhost:8080/services/securityUrl2");
    node2.setProxyTransport("class2");
    node2.setSubscriptionUrl("http://localhost:8080/services/securityUrl2");
    node2.setName("default2");
    node2.setManagerName("default2Manager");
    saveNode.getNode().add(node2);
   
    Clerk clerk2 = new Clerk();
    clerk2.setName("clerkName2");
    clerk2.setPublisher("root");
    clerk2.setNode(node2);
    saveClerk.getClerk().add(clerk2);
   
    clientSubscriptionInfo.setFromClerk(clerk);
   
    clientSubscriptionInfo.setSubscriptionKey("mykey");
   
    SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
    saveClientSubscriptionInfo.setAuthInfo(authInfoJoe);
    saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
   
    ClientSubscriptionInfo clientSubscriptionInfo2 = new ClientSubscriptionInfo();
    clientSubscriptionInfo2.setSubscriptionKey("mykey2");
    clientSubscriptionInfo2.setFromClerk(clerk2);
    saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo2);
   
    try {

      NodeDetail nodeDetail = publisher.saveNode(saveNode);
View Full Code Here

    SaveClientSubscriptionInfo saveClientSubscriptionInfo = new SaveClientSubscriptionInfo();
    saveClientSubscriptionInfo.setAuthInfo(authInfo);
    saveClientSubscriptionInfo.getClientSubscriptionInfo().add(clientSubscriptionInfo);
   
    try {
      ClientSubscriptionInfoDetail detail = publisher.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
   
      GetClientSubscriptionInfoDetail getDetail = new GetClientSubscriptionInfoDetail();
      getDetail.setAuthInfo(authInfo);
      getDetail.getClientSubscriptionKey().add("mykey");
     
      Assert.assertEquals("mykey", detail.getClientSubscriptionInfo().get(0).getSubscriptionKey());
     
      //ClientSubscriptionInfoDetail detail2 = publisher.getClientSubscriptionInfoDetail(getDetail);
      //Assert.assertEquals("mykey", detail2.getClientSubscriptionInfo().get(0).getSubscriptionKey());
 
      DeleteClientSubscriptionInfo deleteInfo = new DeleteClientSubscriptionInfo();
View Full Code Here

      NodeDetail nodeDetail = publisher.saveNode(saveNode);
      ClerkDetail clerkDetail = publisher.saveClerk(saveClerk);
      Assert.assertEquals(2,nodeDetail.getNode().size());
      Assert.assertEquals(2,clerkDetail.getClerk().size());
     
      ClientSubscriptionInfoDetail detail = publisher.saveClientSubscriptionInfo(saveClientSubscriptionInfo);
      Assert.assertEquals("mykey", detail.getClientSubscriptionInfo().get(0).getSubscriptionKey());
     
      GetClientSubscriptionInfoDetail getDetail = new GetClientSubscriptionInfoDetail();
      getDetail.setAuthInfo(authInfoJoe);
      getDetail.getClientSubscriptionKey().add("mykey");
     
      ClientSubscriptionInfoDetail detail2 = publisher.getClientSubscriptionInfoDetail(getDetail);
      Assert.assertEquals("mykey", detail2.getClientSubscriptionInfo().get(0).getSubscriptionKey());
 
      DeleteClientSubscriptionInfo deleteInfo = new DeleteClientSubscriptionInfo();
      deleteInfo.setAuthInfo(authInfoJoe);
      deleteInfo.getSubscriptionKey().add("mykey");
      publisher.deleteClientSubscriptionInfo(deleteInfo);
     
      try {
        @SuppressWarnings("unused")
        ClientSubscriptionInfoDetail detail3 = publisher.getClientSubscriptionInfoDetail(getDetail);
        Assert.fail("We're expecting an InvalidKeyPassedException");
      } catch (Exception e) {
        Assert.assertEquals(InvalidKeyPassedException.class, e.getClass());
      }
View Full Code Here

 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidateClientSubscriptionInfo(publisher).validateSaveClientSubscriptionInfo(em, body);
     
      ClientSubscriptionInfoDetail result = new ClientSubscriptionInfoDetail();
 
      List<org.apache.juddi.api_v3.ClientSubscriptionInfo> apiClientSubscriptionInfoList = body.getClientSubscriptionInfo();
      for (org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo : apiClientSubscriptionInfoList) {
       
        org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo = new org.apache.juddi.model.ClientSubscriptionInfo();
       
        MappingApiToModel.mapClientSubscriptionInfo(apiClientSubscriptionInfo, modelClientSubscriptionInfo);
       
        Object existingUddiEntity = em.find(modelClientSubscriptionInfo.getClass(), modelClientSubscriptionInfo.getSubscriptionKey());
        if (existingUddiEntity != null)
          em.remove(existingUddiEntity);
       
        em.persist(modelClientSubscriptionInfo);
       
        result.getClientSubscriptionInfo().add(apiClientSubscriptionInfo);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

    try {
      tx.begin();
 
      this.getEntityPublisher(em, body.getAuthInfo());
     
      ClientSubscriptionInfoDetail result = new ClientSubscriptionInfoDetail();
     
      Query query = em.createQuery("SELECT cs from ClientSubscriptionInfo as cs");
      List<org.apache.juddi.model.ClientSubscriptionInfo> modelClientSubscriptionInfoList = query.getResultList();
     
      for (ClientSubscriptionInfo modelClientSubscriptionInfo : modelClientSubscriptionInfoList) {
       
        org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo = new org.apache.juddi.api_v3.ClientSubscriptionInfo();
       
        MappingModelToApi.mapClientSubscriptionInfo(modelClientSubscriptionInfo, apiClientSubscriptionInfo);
       
        result.getClientSubscriptionInfo().add(apiClientSubscriptionInfo);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

TOP

Related Classes of org.apache.juddi.api_v3.GetPublisherDetail

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.