Author: ips Date: Mon Jan 24 17:01:44 2005 New Revision: 126331 URL: http://svn.apache.org/viewcvs?view=rev&rev=126331 Log: ... Added: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java Removed: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicListAccessor.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java
Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java?view=diff&rev=126331&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java&r1=126330&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java&r2=126331 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/base/NotificationProducerResource.java Mon Jan 24 17:01:44 2005 @@ -15,27 +15,18 @@ *=============================================================================*/ package org.apache.ws.notification.base; -import org.apache.ws.notification.topics.TopicExpression; -import org.apache.ws.notification.topics.TopicListener; -import org.apache.ws.notification.topics.TopicSpace; +import org.apache.ws.notification.topics.TopicSpaceSet; import org.apache.ws.resource.Resource; /** - * TODO + * A resource that implements the WS-BaseNotification NotificationProducer portType. + * Provides access to the set of TopicSpaces supported by the resource. * * @author Ian Springer (ian DOT springer AT hp DOT com) */ -public interface NotificationProducerResource extends Resource, TopicListener +public interface NotificationProducerResource extends Resource { - void addTopicSpace( TopicSpace topicSpace ); - - void removeTopicSpace(); - - TopicSpace getTopicSpace( String namespaceURI ); - - TopicSpace[] getTopicSpaces(); - - Object getCurrentMessage( TopicExpression topicExpr ); + TopicSpaceSet getTopicSpaceSet(); } Deleted: /incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicListAccessor.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicListAccessor.java?view=auto&rev=126330 ============================================================================== Deleted: /incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java?view=auto&rev=126330 ============================================================================== Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java?view=diff&rev=126331&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java&r1=126330&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java&r2=126331 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpace.java Mon Jan 24 17:01:44 2005 @@ -20,7 +20,8 @@ import java.util.List; /** - * Interface for managing and performing queries on a set of root topics. + * A topic space (i.e. a set of topics within a particular namespace). + * Provides methods for managing the topics and performing queries on them. */ public interface TopicSpace extends TopicListenerList { Added: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java?view=auto&rev=126331 ============================================================================== --- (empty file) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java Mon Jan 24 17:01:44 2005 @@ -0,0 +1,34 @@ +/*=============================================================================* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *=============================================================================*/ +package org.apache.ws.notification.topics; + +/** + * The set of topic spaces that a particular NotificationProducer supports. + * + * @author Ian Springer (ian DOT springer AT hp DOT com) + */ +public interface TopicSpaceSet +{ + + void addTopicSpace( TopicSpace topicSpace ); + + void removeTopicSpace( String namespaceURI ); + + TopicSpace getTopicSpace( String namespaceURI ); + + TopicSpace[] getTopicSpaces(); + +} Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java?view=diff&rev=126331&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java&r1=126330&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java&r2=126331 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicExpressionEngineImpl.java Mon Jan 24 17:01:44 2005 @@ -42,7 +42,7 @@ * Resolves topic expressions over topic lists. The engine looks for topic expression evaluators under * "java:comp/env/topic/eval" context. * - * @see TopicList + * @see org.apache.ws.notification.topics.TopicSpaceSet */ public class TopicExpressionEngineImpl implements TopicExpressionEngine { Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java Url: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java?view=diff&rev=126331&p1=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java&r1=126330&p2=incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java&r2=126331 ============================================================================== --- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java (original) +++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java Mon Jan 24 17:01:44 2005 @@ -15,14 +15,15 @@ *=============================================================================*/ package org.apache.ws.notification.topics.impl; -import org.apache.ws.notification.topics.TopicSpace; import org.apache.ws.notification.topics.Topic; import org.apache.ws.notification.topics.TopicExpression; +import org.apache.ws.notification.topics.TopicSpace; import org.apache.ws.notification.topics.TopicListener; import java.util.Collection; -import java.util.List; +import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; /** @@ -31,7 +32,7 @@ public class TopicSpaceImpl implements TopicSpace { private String m_namespaceURI; - private Map m_rootTopicMap; + private Map m_rootTopicMap = new HashMap(); public TopicSpaceImpl( String namespaceURI ) { @@ -61,7 +62,26 @@ public Topic getTopic( List topicPath ) { - return null; // TODO + Topic topic = null; + Iterator pathItemIter = topicPath.iterator(); + if ( pathItemIter.hasNext() ) + { + String rootTopicName = (String) pathItemIter.next(); + topic = (Topic) m_rootTopicMap.get( rootTopicName ); + } + if ( topic != null ) + { + while ( pathItemIter.hasNext() ) + { + String topicName = (String) pathItemIter.next(); + topic = topic.getTopic( topicName ); + if ( topic == null ) + { + break; + } + } + } + return topic; } public Iterator topicIterator() --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
