Package org.apache.ws.notification.topics.expression

Examples of org.apache.ws.notification.topics.expression.InvalidTopicExpressionException


        if ( topicPath.getLocalPart().indexOf( "//" ) != -1 ||
             topicPath.getLocalPart().indexOf( "*" ) != -1 ||
             topicPath.getLocalPart().indexOf( "|" ) != -1 ||
             topicPath.getLocalPart().indexOf( "." ) != -1 )
        {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath +
                    "' contains one or more illegal characters ('//', '*', '|' or '.')." );
        }
        StringTokenizer pathTokenizer = new StringTokenizer( topicPath.getLocalPart(), "/" );
        TopicSet topicSet = topicSpace;
        boolean resolvedPath = true;
View Full Code Here


      }

      Topic[] topics = evaluateTopicExpression( topicExpr );
      if ( topics.length == 0 )
      {
         throw new InvalidTopicExpressionException( "Given TopicExpression did not match any Topics supported by this NotificationProducer - the WS-BaseN spec mandates that it match at least one." );
      }

      // TODO: SubscriptionHome class is specific to WSN 2004/06 - should be replaced by a WSN-version-neutral SubscriptionHome interface
      SubscriptionHome subscriptionHome =
         (SubscriptionHome) SubscriptionManager.getInstance(  ).getSubscriptionManagerHome( m_producerResource );
View Full Code Here

      {
         topics = m_producerResource.getTopicSet(  ).evaluateTopicExpression( topicExpr );
      }
      catch ( TopicExpressionException tee )
      {
         throw new InvalidTopicExpressionException( tee.getLocalizedMessage(  ) );
      }

      if ( topics.length == 0 )
      {
         throw new TopicNotSupportedException( "Given TopicExpression '" + topicExpr
                                               + "' did not match any Topics supported by this NotificationProducer - the WS-BaseN spec mandates that it match exactly one." );
      }

      if ( topics.length > 1 )
      {
         throw new InvalidTopicExpressionException( "Given TopicExpression matched more than one Topic supported by this NotificationProducer - the WS-BaseN spec mandates that it match exactly one." );
      }

      return topics[0];
   }
View Full Code Here

         prefix       = "";
         localPart    = topicPath;
      }
      else if ( i == 0 )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' starts with a colon." );
      }
      else if ( i == ( topicPath.length(  ) - 1 ) )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' ends with a colon." );
      }
      else
      {
         prefix       = topicPath.substring( 0, i );
         localPart    = topicPath.substring( i + 1 );
         if ( localPart.indexOf( ':' ) != -1 )
         {
            throw new InvalidTopicExpressionException( "Local part of topic path '" + topicPath
                                                       + "' contains a colon." );
         }
      }

      String nsURI = nsContext.getNamespaceURI( prefix );
View Full Code Here

      if ( ( topicPath.getLocalPart(  ).indexOf( "/" ) != -1 )
           || ( topicPath.getLocalPart(  ).indexOf( "*" ) != -1 )
           || ( topicPath.getLocalPart(  ).indexOf( "|" ) != -1 )
           || ( topicPath.getLocalPart(  ).indexOf( "." ) != -1 ) )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath
                                                    + "' contains one or more illegal characters ('/', '*', '|' or '.')." );
      }

      String name  = topicPath.getLocalPart(  );
      Topic  topic = topicNs.getTopic( name );
View Full Code Here

      validateTopicPath( topicPath );
      List           matchedTopics = new ArrayList(  );
      TopicNamespace topicNs = getTopicNamespace( topicNsRegistry, topicPath );
      if ( topicPath.getLocalPart(  ).indexOf( "///" ) != -1 )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath
                                                    + "' contains an empty path component." );
      }

      PathTokenizer pathTokenizer     = new PathTokenizer( topicPath.getLocalPart(  ) );
      List          topicSetsToSearch = new ArrayList(  );
      topicSetsToSearch.add( topicNs );
      boolean atFirstToken = true;
      while ( pathTokenizer.hasMoreTokens(  ) )
      {
         String pathToken = pathTokenizer.nextToken(  );
         matchedTopics.clear(  );
         for ( int i = 0; i < topicSetsToSearch.size(  ); i++ )
         {
            TopicSiblingSet topicSiblingSetToSearch = (TopicSiblingSet) topicSetsToSearch.get( i );
            boolean         recurse = pathToken.startsWith( "/" );
            String          name    = recurse ? pathToken.substring( 1 ) : pathToken;
            matchedTopics.addAll( findTopics( topicSiblingSetToSearch, name, recurse ) );
         }

         if ( atFirstToken && matchedTopics.isEmpty(  ) )
         {
            throw new InvalidTopicExpressionException( "Topic path '" + topicPath
                                                       + "' refers to a root topic that is not defined in the referenced topic space." );
         }

         topicSetsToSearch.clear(  );
         topicSetsToSearch.addAll( matchedTopics );
View Full Code Here

               newPos += 2;
            }

            if ( m_path.charAt( newPos ) == '.' )
            {
               throw new InvalidTopicExpressionException( "'.' may not be used as the first component of a topic path." );
            }
         }
         else
         {
            if ( m_path.charAt( newPos ) == '/' )
View Full Code Here

   throws InvalidTopicExpressionException
   {
      String localPart = topicPath.getLocalPart(  );
      if ( StringUtils.isEmpty( localPart ) || !StringUtils.containsNone( localPart, " \t\n\r\f" ) )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' contains whitespace." );
      }

      if ( localPart.indexOf( ':' ) != -1 )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath + "' contains a colon." );
      }
   }
View Full Code Here

      if ( ( topicPath.getLocalPart(  ).indexOf( "//" ) != -1 )
           || ( topicPath.getLocalPart(  ).indexOf( "*" ) != -1 )
           || ( topicPath.getLocalPart(  ).indexOf( "|" ) != -1 )
           || ( topicPath.getLocalPart(  ).indexOf( "." ) != -1 ) )
      {
         throw new InvalidTopicExpressionException( "Topic path '" + topicPath
                                                    + "' contains one or more illegal characters ('//', '*', '|' or '.')." );
      }

      StringTokenizer pathTokenizer = new StringTokenizer( topicPath.getLocalPart(  ),
                                                           "/" );
View Full Code Here

TOP

Related Classes of org.apache.ws.notification.topics.expression.InvalidTopicExpressionException

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.