Examples of Publisher


Examples of org.apache.cocoon.portal.event.Publisher

  /* (non-Javadoc)
   * @see org.apache.cocoon.portal.event.aspect.EventAspect#process(org.apache.cocoon.portal.event.aspect.EventAspectContext, org.apache.cocoon.portal.PortalService)
   */
  public void process(EventAspectContext context, PortalService service) {
        if (this.labelManager != null) {
            final Publisher publisher = context.getEventPublisher();
            final Request request = ObjectModelHelper.getRequest(context.getObjectModel());
            final String parameterName = this.labelManager.getRequestParameterName();

            String label = request.getParameter(parameterName);
            // The pageLabel must be single valued
            if (label != null) {
                String previous = this.labelManager.getPreviousLabel();
                if (previous != null && previous.equals(label)) {
                    // Already on this page. Don't publish the pageLabel events
                } else {
                    Iterator iter = this.labelManager.getPageLabelEvents(label).iterator();
                    // Publish all the events for this page label.
                    while (iter.hasNext()) {
                        Event event = (Event) iter.next();
                        publisher.publish(event);
                    }
            //        return;
                }
            }
        }
View Full Code Here

Examples of org.apache.cxf.wsn.client.Publisher

        Consumer consumer = new Consumer(consumerCallback, "http://localhost:" + port2 + "/test/consumer");

        Subscription subscription = notificationBroker.subscribe(consumer, "myTopic");

        PublisherCallback publisherCallback = new PublisherCallback();
        Publisher publisher = new Publisher(publisherCallback, "http://localhost:" + port2
                                            + "/test/publisher");
        Registration registration = notificationBroker.registerPublisher(publisher, "myTopic");

        synchronized (consumerCallback.notifications) {
            notificationBroker.notify(publisher, "myTopic",
                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                      String.class, "bar"));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getWSAAddress(subscription.getEpr()),
                     WSNHelper.getWSAAddress(message.getSubscriptionReference()));
        assertEquals(WSNHelper.getWSAAddress(publisher.getEpr()),
                     WSNHelper.getWSAAddress(message.getProducerReference()));

        subscription.unsubscribe();
        registration.destroy();
        publisher.stop();
        consumer.stop();
    }
View Full Code Here

Examples of org.apache.hedwig.client.api.Publisher

                return false;
            }

        });
        Subscriber mySubscriber = myClient.getSubscriber();
        Publisher myPublisher = myClient.getPublisher();
        ByteString myTopic = getTopic(0);
        // Subscribe to a topic and start delivery on it
        mySubscriber.asyncSubscribe(myTopic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH,
                                    new TestCallback(queue), null);
        assertTrue(queue.take());
        startDelivery(mySubscriber, myTopic, localSubscriberId, new TestMessageHandler(consumeQueue));
        // Publish some messages
        int batchSize = 10;
        for (int i = 0; i < batchSize; i++) {
            myPublisher.asyncPublish(myTopic, getMsg(i), new TestCallback(queue), null);
            assertTrue(queue.take());
            assertTrue(consumeQueue.take());
        }
        // Now manually send a consume message for each message received
        for (int i = 0; i < batchSize; i++) {
View Full Code Here

Examples of org.apache.jmeter.protocol.jms.client.Publisher

     * @throws JMSException
     * @throws NamingException
     *
     */
    private void initClient() throws JMSException, NamingException {
        publisher = new Publisher(getUseJNDIPropertiesAsBoolean(), getJNDIInitialContextFactory(),
                getProviderUrl(), getConnectionFactory(), getDestination(), isUseAuth(), getUsername(),
                getPassword(), isDestinationStatic());
        ClientPool.addClient(publisher);
        log.debug("PublisherSampler.initClient called");
    }
View Full Code Here

Examples of org.apache.juddi.api_v3.Publisher

      String rootPublisherStr = AppConfig.getConfiguration().getString(Property.JUDDI_ROOT_PUBLISHER);
      authInfo = TckSecurity.getAuthToken(security, rootPublisherStr, "");
      logger.debug("Saving new publisher: " + publisherXML);
      SavePublisher sp = new SavePublisher();
      sp.setAuthInfo(authInfo);
      Publisher pubIn = (Publisher)EntityCreator.buildFromDoc(publisherXML, "org.apache.juddi.api_v3");
      sp.getPublisher().add(pubIn);
      publisher.savePublisher(sp);
 
      // 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.getIsAdmin(), pubOut.getIsAdmin());
      assertEquals(pubIn.getIsEnabled(), pubOut.getIsEnabled());
      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;
View Full Code Here

Examples of org.apache.juddi.api_v3.Publisher

      String rootPublisherStr = AppConfig.getConfiguration().getString(Property.JUDDI_ROOT_PUBLISHER);
      authInfo = TckSecurity.getAuthToken(security, rootPublisherStr, "");
      logger.debug("Saving new publisher: " + publisherXML);
      SavePublisher sp = new SavePublisher();
      sp.setAuthInfo(authInfo);
      Publisher pubIn = (Publisher)EntityCreator.buildFromDoc(publisherXML, "org.apache.juddi.api_v3");
      sp.getPublisher().add(pubIn);
      publisher.savePublisher(sp);
 
      // 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.getIsAdmin(), pubOut.getIsAdmin());
      assertEquals(pubIn.getIsEnabled(), pubOut.getIsEnabled());
      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;
View Full Code Here

Examples of org.apache.juddi.datatype.publisher.Publisher

   * @throws SQLException
   */
  public static Publisher selectPublisher(String authToken,Connection connection)
    throws SQLException
  {
    Publisher publisher = null;
    PreparedStatement statement = null;
    ResultSet resultSet = null;

    try
    {
      statement = connection.prepareStatement(selectPublisherSQL);
      statement.setString(1,authToken);

      if (log.isDebugEnabled()){
          log.debug("select from " + tablePrefix + "AUTH_TOKEN table:\n\n\t" + selectPublisherSQL +
            "\n\t AUTH_TOKEN=" + authToken + "\n");
      }

      resultSet = statement.executeQuery();
      if (resultSet.next())
      {
        publisher = new Publisher();
        publisher.setPublisherID(resultSet.getString(1));//("PUBLISHER_ID"));
        publisher.setName(resultSet.getString(2));//("PUBLISHER_NAME"));
      }

      return publisher;
    }
    catch(SQLException sqlex)
View Full Code Here

Examples of org.apache.juddi.datatype.publisher.Publisher

  {
    // return 'null' if a null publisherID is specified.
    if (publisherID == null)
      return null;

    Publisher publisher = null;
    PreparedStatement statement = null;
    ResultSet resultSet = null;

    try
    {
      statement = connection.prepareStatement(selectSQL);
      statement.setString(1,publisherID);

      if (log.isDebugEnabled()) {
          log.debug("select from " + tablePrefix + "PUBLISHER table:\n\n\t" + selectSQL +
            "\n\t PUBLISHER_ID=" + publisherID + "\n");
      }

      resultSet = statement.executeQuery();
      if (resultSet.next())
      {
        publisher = new Publisher();
        publisher.setPublisherID(publisherID);
        publisher.setName(resultSet.getString(1));//("PUBLISHER_NAME"));
        publisher.setEmailAddress(resultSet.getString(2));//("EMAIL_ADDRESS"));
        publisher.setAdminValue(resultSet.getString(3));//("IS_ADMIN"));
        publisher.setEnabledValue(resultSet.getString(4));//("IS_ENABLED"));
        publisher.setMaxBusinesses(resultSet.getInt(5));//("MAX_BUSINESSES"));
        publisher.setMaxServicesPerBusiness(resultSet.getInt(6));//("MAX_SERVICES_PER_BUSINESS"));
        publisher.setMaxBindingsPerService(resultSet.getInt(7));//("MAX_BINDINGS_PER_SERVICE"));
        publisher.setMaxTModels(resultSet.getInt(8));//("MAX_TMODELS"));     
      }

      return publisher;
    }
    catch(SQLException sqlex)
View Full Code Here

Examples of org.apache.juddi.model.Publisher

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
      Publisher publisher = em.find(Publisher.class, authorizedName);
      if (publisher == null)
        throw new UnknownUserException(new ErrorMessage("errors.auth.NoPublisher", authorizedName));
     
      return publisher;
    } finally {
View Full Code Here

Examples of org.apache.juddi.portlets.client.model.Publisher

         getAllPublisherDetail.setAuthInfo(authToken);
         logger.debug("GetAllPublisherDetail " + getAllPublisherDetail + " sending get AllPublisherDetail request..");
         publisherDetail = apiService.getAllPublisherDetail(getAllPublisherDetail);
           }
           for (org.apache.juddi.api_v3.Publisher apiPublisher : publisherDetail.getPublisher()) {
        Publisher publisher = new Publisher();
        BeanUtils.copyProperties(publisher, apiPublisher);
        publishers.add(publisher);
       }
           response.setSuccess(true);
           response.setPublishers(publishers);
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.