Package org.apache.muse.ws.notification.remote

Examples of org.apache.muse.ws.notification.remote.NotificationProducerClient


            EndpointReference consumer = new EndpointReference(address);
           
            //
            // null filter == send all messages to consumer
            //
            NotificationProducerClient producer = new NotificationProducerClient(epr);
            producer.setTrace(true);
            producer.subscribe(consumer, null, null);
        }
       
        catch (Throwable error)
        {
            error.printStackTrace();
View Full Code Here


    URI consumerURI = URI.create("http://"+host+":"+port+"/qman/services/consumer");
   
    EndpointReference producerEPR = new EndpointReference(producerURI);   
    EndpointReference consumerEPR = new EndpointReference(consumerURI);
 
    NotificationProducerClient producerClient = new NotificationProducerClient(producerEPR);
        producerClient.setTrace(true);

        // 1) Creates a subscription and gets the corresponding reference.
        SubscriptionClient subscriptionClient = producerClient.subscribe(
            consumerEPR,  // Consumer Endpoint reference
            null,      // Filter, if null that means "all messages"
            null);      // Termination Time : if null the subscription will never expire.
        subscriptionClient.setTrace(true);
       
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void subscribeAllMessagesWithoutTerminationTime(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            null,      // Filter, if null that means "all messages"
            null);      // Termination Time : if null the subscription will never expire.
  }
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void subscribeAllMessagesWithTerminationTime(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            null,      // Filter, if null that means "all messages"
            new Date(System.currentTimeMillis() + 10000))// Termination Time
  }
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void topicSubscriptionWithoutTerminationTime(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

    TopicFilter filter = new TopicFilter(Names.EVENTS_LIFECYLE_TOPIC_NAME);

        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            filter,      // Topic Filter
            null);      // Termination Time : if null the subscription will never expire.
  }
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void topicSubscriptionWithTerminationTime(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

    TopicFilter filter = new TopicFilter(Names.EVENTS_LIFECYLE_TOPIC_NAME);

        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            filter,      // Topic Filter
            new Date(System.currentTimeMillis() + 10000))// Termination Time
  }
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void allMessagesWithMessageFilterWithoutTerminationTime(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

        // Applying this filter will result in a subscription that wll be notified only when a "connection"
        // object is created or removed
        MessagePatternFilter filter= new MessagePatternFilter(
            "/wsnt:NotificationMessage/wsnt:Message/qman:LifeCycleEvent/qman:Resource/qman:Name/text()='connection'", // expression (XPath)
            XPathUtils.NAMESPACE_URI); // Dialect : the only supported dialect is XPath 1.0
       
        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            filter,      // Message Filter
            null);      // Termination Time : if null the subscription will never expire.
  }
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void allMessagesWithMessageFilterAndTerminationTime(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

        // Applying this filter will result in a subscription that wll be notified only when a "connection"
        // object is created or removed
        MessagePatternFilter filter= new MessagePatternFilter(
            "/wsnt:NotificationMessage/wsnt:Message/qman:LifeCycleEvent/qman:Resource/qman:Name/text()='connection'", // expression (XPath)
            XPathUtils.NAMESPACE_URI); // Dialect : the only supported dialect is XPath 1.0
       
        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            filter,      // Message Filter
            new Date(System.currentTimeMillis() + 10000))// Termination Time
  }
View Full Code Here

   * @param consumer the consumer endpoint reference .
   * @throws SoapFault when the subscription cannot be made.
   */
  private void complexSubscription(EndpointReference producer, EndpointReference consumer) throws SoapFault
  {
    NotificationProducerClient producerClient = new NotificationProducerClient(producer);
        producerClient.setTrace(true);

        FilterCollection filter = new FilterCollection();
       
    TopicFilter topicFilter = new TopicFilter(Names.EVENTS_LIFECYLE_TOPIC_NAME);
        MessagePatternFilter messageFilter= new MessagePatternFilter(
            "/wsnt:NotificationMessage/wsnt:Message/qman:LifeCycleEvent/qman:Resource/qman:Name/text()='connection'", // expression (XPath)
            XPathUtils.NAMESPACE_URI); // Dialect : the only supported dialect is XPath 1.0

        ProducerPropertiesFilter producerFilter = new ProducerPropertiesFilter(
            "boolean(/*/MgtPubInterval > 100 and /*/MsgTotalEnqueues > 56272)",
            XPathUtils.NAMESPACE_URI);
       
        filter.addFilter(topicFilter);
        filter.addFilter(messageFilter);
        filter.addFilter(producerFilter);
   
        producerClient.subscribe(
            consumer,  // Consumer Endpoint reference
            filter,      // Topic Filter
            new Date(System.currentTimeMillis() + 10000))// Termination Time
  }
View Full Code Here

TOP

Related Classes of org.apache.muse.ws.notification.remote.NotificationProducerClient

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.