Examples of PublisherDetail


Examples of org.apache.juddi.api_v3.PublisherDetail

        private void ExportPublishers() throws Exception {
                FileOutputStream fos = new FileOutputStream(publishersfile);

                GetAllPublisherDetail r = new GetAllPublisherDetail();
                r.setAuthInfo(token);
                PublisherDetail allPublisherDetail = juddi.getAllPublisherDetail(r);
                if (stripSig) {
                        for (int i = 0; i < allPublisherDetail.getPublisher().size(); i++) {
                                allPublisherDetail.getPublisher().get(i).getSignature().clear();
                        }
                }
                SavePublisher saver = new SavePublisher();
                saver.getPublisher().addAll(allPublisherDetail.getPublisher());
                System.out.println("Storing to disk ");
                JAXB.marshal(saver, fos);
                fos.close();
                System.out.println("Done with Publishers");
        }
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

        private boolean PublisherExists(String authorizedName, String token) {
                GetPublisherDetail r = new GetPublisherDetail();
                r.setAuthInfo(token);
                r.getPublisherId().add(authorizedName);
                try {
                        PublisherDetail publisherDetail = juddi.getPublisherDetail(r);
                        if (publisherDetail != null && !publisherDetail.getPublisher().isEmpty()) {
                                return true;
                        }
                } catch (Exception ex) {
                }
                return false;
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidatePublish(publisher).validateSavePublisher(em, body);
     
      PublisherDetail result = new PublisherDetail();
 
      List<org.apache.juddi.api_v3.Publisher> apiPublisherList = body.getPublisher();
      for (org.apache.juddi.api_v3.Publisher apiPublisher : apiPublisherList) {
       
        org.apache.juddi.model.Publisher modelPublisher = new org.apache.juddi.model.Publisher();
       
        MappingApiToModel.mapPublisher(apiPublisher, modelPublisher);
       
        Object existingUddiEntity = em.find(modelPublisher.getClass(), modelPublisher.getAuthorizedName());
        if (existingUddiEntity != null)
          em.remove(existingUddiEntity);
       
        em.persist(modelPublisher);
       
        result.getPublisher().add(apiPublisher);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

    try {
      tx.begin();
 
      this.getEntityPublisher(em, body.getAuthInfo());
     
      PublisherDetail result = new PublisherDetail();
     
      List<String> publisherIdList = body.getPublisherId();
      for (String publisherId : publisherIdList) {
        org.apache.juddi.model.Publisher modelPublisher = null;
        try {
          modelPublisher = em.find(org.apache.juddi.model.Publisher.class, publisherId);
        } catch (ClassCastException e) {}
          if (modelPublisher == null) {
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.PublisherNotFound", publisherId));
        }
       
        org.apache.juddi.api_v3.Publisher apiPublisher = new org.apache.juddi.api_v3.Publisher();
       
        MappingModelToApi.mapPublisher(modelPublisher, apiPublisher);
       
        result.getPublisher().add(apiPublisher);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

    try {
      tx.begin();
 
      this.getEntityPublisher(em, body.getAuthInfo());
     
      PublisherDetail result = new PublisherDetail();
     
      Query query = em.createQuery("SELECT p from Publisher as p");
      List<Publisher> modelPublisherList = query.getResultList();
     
      for (Publisher modelPublisher : modelPublisherList) {
       
        org.apache.juddi.api_v3.Publisher apiPublisher = new org.apache.juddi.api_v3.Publisher();
       
        MappingModelToApi.mapPublisher(modelPublisher, apiPublisher);
       
        result.getPublisher().add(apiPublisher);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

                        // Now get the entity and check the values
                        GetPublisherDetail gp = new GetPublisherDetail();
                        gp.getPublisherId().add(publisherId);
                        gp.setAuthInfo(authInfo);
                        PublisherDetail pd = publisher.getPublisherDetail(gp);
                        List<Publisher> pubOutList = pd.getPublisher();
                        Publisher pubOut = pubOutList.get(0);

                        assertEquals(pubIn.getAuthorizedName(), pubOut.getAuthorizedName());
                        assertEquals(pubIn.getPublisherName(), pubOut.getPublisherName());
                        assertEquals(pubIn.getEmailAddress(), pubOut.getEmailAddress());
                        assertEquals(pubIn.isIsAdmin(), pubOut.isIsAdmin());
                        assertEquals(pubIn.isIsEnabled(), pubOut.isIsEnabled());
                        assertEquals(pubIn.getMaxBindingsPerService(), pubOut.getMaxBindingsPerService());
                        assertEquals(pubIn.getMaxBusinesses(), pubOut.getMaxBusinesses());
                        assertEquals(pubIn.getMaxServicePerBusiness(), pubOut.getMaxServicePerBusiness());
                        assertEquals(pubIn.getMaxTModels(), pubOut.getMaxTModels());

                        logger.debug("Querying for publisher: " + publisherXML);
                        //Querying for this publisher to make sure it's really gone
                        //We're expecting a invalid Key exception at this point.
                        PublisherDetail pdBeforeDelete = null;
                        try {
                                pdBeforeDelete = publisher.getPublisherDetail(gp);
                                Assert.assertNotNull(pdBeforeDelete);
                        } catch (InvalidKeyPassedException e) {
                                Assert.fail("We expected to find publisher " + publisherXML);
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

                        //Querying for this publisher to make sure it's really gone
                        //We're expecting a invalid Key exception at this point.
                        GetPublisherDetail gp = new GetPublisherDetail();
                        gp.getPublisherId().add(publisherId);
                        gp.setAuthInfo(authInfo);
                        PublisherDetail pdAfterDelete = null;
                        try {
                                pdAfterDelete = publisher.getPublisherDetail(gp);
                                Assert.fail("We did not expect to find this publisher anymore.");
                        } catch (InvalidKeyPassedException e) {
                                Assert.assertNull(pdAfterDelete);
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

        public void testGetAllPublishers() {
                Assume.assumeTrue(TckPublisher.isJUDDI());
                GetAllPublisherDetail gp = new GetAllPublisherDetail();
                gp.setAuthInfo(authInfo);
                try {
                        PublisherDetail publisherDetail = publisher.getAllPublisherDetail(gp);
                        Assert.assertTrue(publisherDetail.getPublisher().size() > 1);
                } catch (Exception e) {
                        logger.error(e);
                        Assert.fail();
                }
        }
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

                        // Now get the entity and check the values
                        GetPublisherDetail gp = new GetPublisherDetail();
                        gp.getPublisherId().add(publisherId);
                        gp.setAuthInfo(authInfo);
                        PublisherDetail pd = publisher.getPublisherDetail(gp);
                        List<Publisher> pubOutList = pd.getPublisher();
                        Publisher pubOut = pubOutList.get(0);

                        Assert.assertEquals(pubIn.getAuthorizedName(), pubOut.getAuthorizedName());
                        Assert.assertEquals(pubIn.getPublisherName(), pubOut.getPublisherName());
                        Assert.assertEquals(pubIn.getEmailAddress(), pubOut.getEmailAddress());
                        Assert.assertEquals(pubIn.isIsAdmin(), pubOut.isIsAdmin());
                        Assert.assertEquals(pubIn.isIsEnabled(), pubOut.isIsEnabled());
                        Assert.assertEquals(pubIn.getMaxBindingsPerService(), pubOut.getMaxBindingsPerService());
                        Assert.assertEquals(pubIn.getMaxBusinesses(), pubOut.getMaxBusinesses());
                        Assert.assertEquals(pubIn.getMaxServicePerBusiness(), pubOut.getMaxServicePerBusiness());
                        Assert.assertEquals(pubIn.getMaxTModels(), pubOut.getMaxTModels());

                        logger.debug("Querying for publisher: " + publisherXML);
                        //Querying for this publisher to make sure it's really gone
                        //We're expecting a invalid Key exception at this point.
                        PublisherDetail pdBeforeDelete = null;
                        try {
                                pdBeforeDelete = publisher.getPublisherDetail(gp);
                                Assert.assertNotNull(pdBeforeDelete);
                        } catch (Exception e) {
                                logger.error(e);
View Full Code Here

Examples of org.apache.juddi.api_v3.PublisherDetail

                        //Querying for this publisher to make sure it's really gone
                        //We're expecting a invalid Key exception at this point.
                        GetPublisherDetail gp = new GetPublisherDetail();
                        gp.getPublisherId().add(publisherId);
                        gp.setAuthInfo(authInfo);
                        PublisherDetail pdAfterDelete = null;
                        try {
                                pdAfterDelete = publisher.getPublisherDetail(gp);
                                Assert.fail("We did not expect to find this publisher anymore.");
                                //don't think we really want a SOAPFaulException be thrown here.
                        } catch (SOAPFaultException e) {
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.