Package org.apache.ws.eventing

Examples of org.apache.ws.eventing.Subscription


         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){
         //                Collection collection = evaluateTopicExpression((TopicFilter)filter);
         //                SimpleSubscriptionTopicListener simpleSubscriptionTopicListener = new SimpleSubscriptionTopicListener(subscription);
         //add listeners
         //                for (Iterator iterator = collection.iterator(); iterator.hasNext();) {
         //                    Topic topic = (Topic) iterator.next();
         //                    topic.addTopicListener(simpleSubscriptionTopicListener);
         //                }
         //            }
         //build response
         SubscribeResponseDocument                   responseDom =
            SubscribeResponseDocument.Factory.newInstance(  );
         SubscribeResponseDocument.SubscribeResponse response = responseDom.addNewSubscribeResponse(  );

         response.setSubscriptionManager( (EndpointReferenceType) ( (XmlObjectWrapper) subscription
                                                                    .getEndpointReference(  ) ).getXmlObject(  ) );

         //TODO why not ExpirationType???
         response.setExpires( new org.apache.xmlbeans.XmlCalendar( subscription.getTerminationTime(  ).getTime(  ) ) );

         return responseDom;
      }
      catch ( Exception e )
      {
View Full Code Here


    * @throws RemoteException DOCUMENT_ME
    */
   public GetStatusResponseDocument getStatus( GetStatusDocument body )
   throws RemoteException
   {
      Subscription subscription = (Subscription) getResource(  );

      //build response
      GetStatusResponseDocument                   responseDom = GetStatusResponseDocument.Factory.newInstance(  );
      GetStatusResponseDocument.GetStatusResponse response = responseDom.addNewGetStatusResponse(  );

      //TODO check calendar
      response.setExpires( subscription.getTerminationTime(  ) );
      return ( responseDom );
   }
View Full Code Here

    * @throws RemoteException DOCUMENT_ME
    */
   public RenewResponseDocument renew( RenewDocument body )
   throws RemoteException
   {
      Subscription subscription = (Subscription) getResource(  );

      //TODO why no ExpirationType
      org.apache.xmlbeans.XmlCalendar et = (org.apache.xmlbeans.XmlCalendar) body.getRenew(  ).getExpires(  );
      subscription.setTerminationTime( et );
      RenewResponseDocument               responseDom = RenewResponseDocument.Factory.newInstance(  );
      RenewResponseDocument.RenewResponse response = responseDom.addNewRenewResponse(  );

      //TODO response with new expirationType
      response.setExpires( subscription.getTerminationTime(  ) );

      return ( responseDom );
   }
View Full Code Here

    * @throws RemoteException DOCUMENT_ME
    */
   public void unsubscribe( UnsubscribeDocument body )
   throws RemoteException
   {
      Subscription subscription = (Subscription) getResource(  );
      subscription.unsubscribe(  );
   }
View Full Code Here

           
            //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){
//                Collection collection = evaluateTopicExpression((TopicFilter)filter);
//                SimpleSubscriptionTopicListener simpleSubscriptionTopicListener = new SimpleSubscriptionTopicListener(subscription);
                //add listeners
//                for (Iterator iterator = collection.iterator(); iterator.hasNext();) {
//                    Topic topic = (Topic) iterator.next();
//                    topic.addTopicListener(simpleSubscriptionTopicListener);
//                }
//            }
           
            //build response
            SubscribeResponseDocument responseDom= SubscribeResponseDocument.Factory.newInstance();
            SubscribeResponseDocument.SubscribeResponse response = responseDom.addNewSubscribeResponse();
           
            response.setSubscriptionManager((EndpointReferenceType) ((XmlObjectWrapper)subscription.getEndpointReference()).getXmlObject());
            //TODO why not ExpirationType???
            response.setExpires(new org.apache.xmlbeans.XmlCalendar(subscription.getTerminationTime().getTime()));
           
            return responseDom;
        }catch(Exception e){
            //TODO error
            e.printStackTrace();
View Full Code Here

    {       
        super( resourceContext );
    }   
   
    public RenewResponseDocument renew(RenewDocument body) throws RemoteException {
       Subscription subscription = (Subscription) getResource();
       //TODO why no ExpirationType
       org.apache.xmlbeans.XmlCalendar et = (org.apache.xmlbeans.XmlCalendar)body.getRenew().getExpires();
       subscription.setTerminationTime(et);
       RenewResponseDocument responseDom = RenewResponseDocument.Factory.newInstance();
       RenewResponseDocument.RenewResponse response = responseDom.addNewRenewResponse();
       //TODO response with new expirationType
       response.setExpires(subscription.getTerminationTime());
       
        return(responseDom);
    }
View Full Code Here

       
        return(responseDom);
    }
   
    public GetStatusResponseDocument getStatus(GetStatusDocument body) throws RemoteException {
  Subscription subscription = (Subscription) getResource();
           
        //build response
        GetStatusResponseDocument responseDom = GetStatusResponseDocument.Factory.newInstance();
        GetStatusResponseDocument.GetStatusResponse response = responseDom.addNewGetStatusResponse();
        //TODO check calendar
        response.setExpires(subscription.getTerminationTime());
        return(responseDom);
    }
View Full Code Here

        response.setExpires(subscription.getTerminationTime());
        return(responseDom);
    }
   
    public void unsubscribe(UnsubscribeDocument body) throws RemoteException {
        Subscription subscription = (Subscription) getResource();
        subscription.unsubscribe();
    }
View Full Code Here

         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){
         //                Collection collection = evaluateTopicExpression((TopicFilter)filter);
         //                SimpleSubscriptionTopicListener simpleSubscriptionTopicListener = new SimpleSubscriptionTopicListener(subscription);
         //add listeners
         //                for (Iterator iterator = collection.iterator(); iterator.hasNext();) {
         //                    Topic topic = (Topic) iterator.next();
         //                    topic.addTopicListener(simpleSubscriptionTopicListener);
         //                }
         //            }
         //build response
         SubscribeResponseDocument                   responseDom =
            SubscribeResponseDocument.Factory.newInstance(  );
         SubscribeResponseDocument.SubscribeResponse response = responseDom.addNewSubscribeResponse(  );

         response.setSubscriptionManager( (EndpointReferenceType) ( (XmlObjectWrapper) subscription
                                                                    .getEndpointReference(  ) ).getXmlObject(  ) );

         //TODO why not ExpirationType???
         response.setExpires( new org.apache.xmlbeans.XmlCalendar( subscription.getTerminationTime(  ).getTime(  ) ) );

         return responseDom;
      }
      catch ( Exception e )
      {
View Full Code Here

    * @throws RemoteException DOCUMENT_ME
    */
   public GetStatusResponseDocument getStatus( GetStatusDocument body )
   throws RemoteException
   {
      Subscription subscription = (Subscription) getResource(  );

      //build response
      GetStatusResponseDocument                   responseDom = GetStatusResponseDocument.Factory.newInstance(  );
      GetStatusResponseDocument.GetStatusResponse response = responseDom.addNewGetStatusResponse(  );

      //TODO check calendar
      response.setExpires( subscription.getTerminationTime(  ) );
      return ( responseDom );
   }
View Full Code Here

TOP

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

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.