Package org.apache.ws.eventing

Examples of org.apache.ws.eventing.SubscriptionHome


      {
         //create Subscription
         Context initialContext = new InitialContext(  );

         //System.out.println("get RemoteResourceSubscriptionHome " + RemoteSubscriptionHome.HOME_LOCATION);
         SubscriptionHome sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );

         //create NotifyTO EPR
         EndpointReference notifyto = null;
         if ( body.getSubscribe(  ).getDelivery(  ).getNotifyTo(  ) != null )
         {
            notifyto = new XmlBeansEndpointReference( body.getSubscribe(  ).getDelivery(  ).getNotifyTo(  ) );
         }

         //create EndTO EPR
         EndpointReference endto = null;
         if ( body.getSubscribe(  ).getEndTo(  ) != null )
         {
            endto = new XmlBeansEndpointReference( body.getSubscribe(  ).getEndTo(  ) );
         }

         Filter   filter  = FilterFactory.createFilter( body.getSubscribe(  ).getFilter(  ) );
         Calendar expires = (Calendar) body.getSubscribe(  ).getExpires(  );

         //getDeliveryMode
         java.net.URI delivery = null;
         if ( body.getSubscribe(  ).getDelivery(  ).getMode(  ) != null )
         {
            delivery = new java.net.URI( body.getSubscribe(  ).getDelivery(  ).getMode(  ) );
         }

         Subscription subscription = sH.create( filter, expires, delivery );
         subscription.setNotificationConsumer( new ForwardConsumer( notifyto ) );
         subscription.setSubscriptionEndConsumer( new ForwardEndConsumer( endto ) );

         //check if topic expression
         //            if(filter instanceof TopicFilter == true){
View Full Code Here


        LOG.info("subscribe");
        try{
            //create Subscription
            Context initialContext = new InitialContext(  );
            //System.out.println("get RemoteResourceSubscriptionHome " + RemoteSubscriptionHome.HOME_LOCATION);
            SubscriptionHome sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );
            
            //create NotifyTO EPR
            EndpointReference notifyto=null;
            if(body.getSubscribe().getDelivery().getNotifyTo()!=null)
                notifyto= new XmlBeansEndpointReference(body.getSubscribe().getDelivery().getNotifyTo());
           
            //create EndTO EPR
            EndpointReference endto=null;     
            if(body.getSubscribe().getEndTo()!=null)
                endto= new XmlBeansEndpointReference(body.getSubscribe().getEndTo());
           
            Filter filter = FilterFactory.createFilter(body.getSubscribe().getFilter());
            Calendar expires = (Calendar) body.getSubscribe().getExpires();
           
            //getDeliveryMode
            java.net.URI delivery = null;
            if(body.getSubscribe().getDelivery().getMode()!=null)
                delivery = new java.net.URI(body.getSubscribe().getDelivery().getMode());
            Subscription subscription = sH.create(filter,expires,delivery);
            subscription.setNotificationConsumer(new ForwardConsumer(notifyto));
            subscription.setSubscriptionEndConsumer(new ForwardEndConsumer(endto));

           
            //check if topic expression
View Full Code Here

    //TODO use WSRF Provider with Message styler
    public void filter(SOAPEnvelope req, SOAPEnvelope resp){
        try{
            LOG.info("filtering ");
            Context initialContext = new InitialContext(  );
            SubscriptionHome sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );
            sH.notify(req);
        }catch(Exception e){
            //TODO
            e.printStackTrace();
        }
    }  
View Full Code Here

      LOG.info( "subscribe" );
      try
      {
         //create Subscription
         //System.out.println("get RemoteResourceSubscriptionHome " + RemoteSubscriptionHome.HOME_LOCATION);
         SubscriptionHome sH = (SubscriptionHome) new InitialContext(  ).lookup( SubscriptionHome.HOME_LOCATION );

         //create NotifyTO EPR
         EndpointReference notifyto = null;
         if ( body.getSubscribe(  ).getDelivery(  ).getNotifyTo(  ) != null )
         {
            notifyto = new XmlBeansEndpointReference( body.getSubscribe(  ).getDelivery(  ).getNotifyTo(  ) );
         }

         //create EndTO EPR
         EndpointReference endto = null;
         if ( body.getSubscribe(  ).getEndTo(  ) != null )
         {
            endto = new XmlBeansEndpointReference( body.getSubscribe(  ).getEndTo(  ) );
         }

         Filter   filter  = FilterFactory.createFilter( body.getSubscribe(  ).getFilter(  ) );
         Calendar expires = (Calendar) body.getSubscribe(  ).getExpires(  );

         //getDeliveryMode
         java.net.URI delivery = null;
         if ( body.getSubscribe(  ).getDelivery(  ).getMode(  ) != null )
         {
            delivery = new java.net.URI( body.getSubscribe(  ).getDelivery(  ).getMode(  ) );
         }

         Subscription subscription = sH.create( filter, expires, delivery );
         subscription.setNotificationConsumer( new ForwardConsumer( notifyto ) );
         subscription.setSubscriptionEndConsumer( new ForwardEndConsumer( endto ) );

         //check if topic expression
         //            if(filter instanceof TopicFilter == true){
View Full Code Here

   {
      try
      {
         LOG.info( "filtering " );
         Context          initialContext = new InitialContext(  );
         SubscriptionHome sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );
         sH.notify( req );
      }
      catch ( Exception e )
      {
         //TODO
         e.printStackTrace(  );
View Full Code Here

TOP

Related Classes of org.apache.ws.eventing.SubscriptionHome

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.