Package org.apache.juddi.api_v3

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


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

        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

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

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

        private String getAllPublisherDetail(HttpServletRequest parameters) {
                StringBuilder ret = new StringBuilder();
                GetAllPublisherDetail sb = new GetAllPublisherDetail();
                sb.setAuthInfo(GetToken());
                PublisherDetail d = null;
                try {
                        d = juddi.getAllPublisherDetail(sb);
                } catch (Exception ex) {
                        if (isExceptionExpiration(ex)) {
                                token = null;
                                sb.setAuthInfo(GetToken());
                                try {
                                        d = juddi.getAllPublisherDetail(sb);
                                } catch (Exception ex1) {
                                        return HandleException(ex);
                                }

                        } else {
                                return HandleException(ex);
                        }
                }
                if (d != null) {
                        ret.append("<table class=\"table table-hover\"><tr><th>Name</th><th>Info</th></tr>");
                        for (int i = 0; i < d.getPublisher().size(); i++) {
                                ret.append("<tr><td>").append(StringEscapeUtils.escapeHtml(d.getPublisher().get(i).getPublisherName()))
                                        .append("</td><td>");
                                ret.append(PrintPublisherDetail(d.getPublisher().get(i)))
                                        .append("</td></tr>");
                        }
                        ret.append("</table>");
                } else {
                        ret.append("No data returned");
View Full Code Here

        private String get_publisherDetail(HttpServletRequest parameters) {
                StringBuilder ret = new StringBuilder();
                GetPublisherDetail sb = new GetPublisherDetail();
                sb.getPublisherId().add(parameters.getParameter("get_publisherDetailKEY"));
                sb.setAuthInfo(GetToken());
                PublisherDetail d = null;
                try {
                        d = juddi.getPublisherDetail(sb);
                } catch (Exception ex) {
                        if (isExceptionExpiration(ex)) {
                                token = null;
                                sb.setAuthInfo(GetToken());
                                try {
                                        d = juddi.getPublisherDetail(sb);
                                } catch (Exception ex1) {
                                        return HandleException(ex);
                                }

                        } else {
                                return HandleException(ex);
                        }
                }
                if (d != null) {
                        ret.append("<table class=\"table table-hover\"><tr><th>Name</th><th>Info</th></tr>");
                        for (int i = 0; i < d.getPublisher().size(); i++) {
                                ret.append("<tr><td>").append(StringEscapeUtils.escapeHtml(d.getPublisher().get(i).getPublisherName()))
                                        .append("</td><td>");
                                ret.append(PrintPublisherDetail(d.getPublisher().get(i)))
                                        .append("</td></tr>");
                        }
                        ret.append("</table>");
                } else {
                        ret.append("No data returned");
View Full Code Here

                try {
                        p.setIsEnabled(Boolean.parseBoolean(parameters.getParameter("savePublisherIsEnabled")));
                } catch (Exception ex) {
                }
             
                PublisherDetail d = null;
                sb.setAuthInfo(GetToken());
                try {
                        if (parameters.getParameter("savePublisherMaxBindings") != null) {
                                p.setMaxBindingsPerService(Integer.parseInt(parameters.getParameter("savePublisherMaxBindings")));
                        }
View Full Code Here

 
      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

    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 = em.find(org.apache.juddi.model.Publisher.class, publisherId);
        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

TOP

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

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.