Package org.apache.ws.notification.subscription

Examples of org.apache.ws.notification.subscription.Subscription


      {
         throw new ResourceUnknownFaultException( MSG.getMessage( Keys.TOPIC_NOT_AVAILABLE_FOR_SUBSCRIPTION,
                                                                  subscriptionRequest.getTopic(  ).toString(  ) ) );
      }

      Subscription subscription = m_subscriptionTable.addSubscription( subscriptionRequest );

      try
      {
         return buildSubscriptionEPR( subscription );
      }
View Full Code Here


      SOAPElement messageWithNotify    = null;
      SOAPElement messageWithoutNotify = null;

      for ( int i = 0; i < subscriptions.length; i++ )
      {
         Subscription curSubscription = subscriptions[i];

         // ignore this subscription if it is paused
         if ( curSubscription.isPaused(  ) )
         {
            continue;
         }

         // get the values of all resource properties for the current subscription
         SubscriptionManagerRP rpDoc = curSubscription.getResourceProps(  );

         // get the full notification body - wrapped in Notify element if subscriber wants it
         SOAPElement fullMsgBodyElem;

         if ( rpDoc.getUseNotify(  ) )
View Full Code Here

         if ( topicSubscriptions != null )
         { // get all the subscriptions in the return array
            for ( Iterator iter = topicSubscriptions.values(  ).iterator(  ); iter.hasNext(  ); )
            {
               Subscription curSub = (Subscription) iter.next(  );

               if ( !ignorePaused || !curSub.isPaused(  ) )
               {
                  retSubscriptions.add( curSub );
               }
            }
         }
View Full Code Here

   /**
    * @see SubscriptionTable#getSubscription(String)
    */
   public Subscription getSubscription( String subId )
   {
      Subscription ret_sub = null;

      // synchronize on the table to prevent any reaper threads from trying to modify it
      synchronized ( m_subscriptions )
      {
         // immediately remove any expired subscriptions
View Full Code Here

   /**
    * @see SubscriptionTable#addSubscription(SubscriptionRequest)
    */
   public Subscription addSubscription( SubscriptionRequest subRequest )
   {
      Subscription newSub = new Subscription( createSubscriptionId( getTableId(  ) ),
                                              subRequest );

      return addSubscription( newSub );
   }
View Full Code Here

            // now loop through all subscriptions to the current topic
            Iterator subsMapIter = curTopicMap.values(  ).iterator(  );

            while ( subsMapIter.hasNext(  ) )
            {
               Subscription curSub = (Subscription) subsMapIter.next(  );
               destroySubscriptionWSResource( curSub );
            }

            curTopicMap.clear(  );
         }
View Full Code Here

            Iterator  j = topicSubscriptions.values(  ).iterator(  );

            while ( j.hasNext(  ) )
            { // loop through each subscription in the topic subscriptions map
               Subscription subscription = (Subscription) j.next(  );

               if ( subscription.getResourceProps(  ).getTerminationTime(  ).getTime(  ).before( now ) )
               {
                  doomedSubcriptions.add( subscription );
               }
            }

            // now remove the expired subscriptions
            // we do this in a separate while loop to avoid modifying the topicSubscriptions map during iteration
            Iterator subsIter = doomedSubcriptions.iterator(  );

            while ( subsIter.hasNext(  ) )
            {
               Subscription doomedSub = (Subscription) subsIter.next(  );
               topicSubscriptions.remove( doomedSub.getSubscriptionId(  ) );
               destroySubscriptionWSResource( doomedSub );
            }

            // if we've removed all subscriptions in the current topic map, designated it to be removed from m_subscriptions
            if ( topicSubscriptions.isEmpty(  ) )
View Full Code Here

         {
            Map.Entry entry    = (Map.Entry) i.next(  );
            Map       topicMap = (Map) entry.getValue(  );

            // remove the subscription from the topic map if it exists
            Subscription doomedSub = (Subscription) topicMap.remove( doomedSubId );

            // if the subscription existed and was removed, destroy its associated SubMgr WSResource
            if ( doomedSub != null )
            {
               destroySubscriptionWSResource( doomedSub );
View Full Code Here

      mgr.initialize(  );

      SubscriptionTable table = mgr.createSubscriptionTable(  );

      Subscription      sub1  = createSubscription( 1 );
      Subscription      sub2  = createSubscription( 2 );
      Subscription      sub3  = createSubscription( 3 );
      Subscription      xsub4 = createExpiredSubscription( 4 );
      Subscription      xsub5 = createExpiredSubscription( 5 );

      table.addSubscription( sub1 );
      table.addSubscription( sub2 );
      table.addSubscription( sub3 );
      table.addSubscription( xsub4 );
View Full Code Here

    *
    * @return new sub
    */
   protected Subscription createExpiredSubscription( int num )
   {
      Subscription sub = createSubscription( num );

      // expired already
      Calendar termination = Calendar.getInstance(  );
      termination.set( 1999, Calendar.JANUARY, 1 );
      sub.getResourceProps(  ).setTerminationTime( termination );

      return sub;
   }
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.subscription.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.