You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by sc...@apache.org on 2006/06/02 19:33:13 UTC
svn commit: r411218 [6/34] - in /webservices/muse: branches/1.0/
branches/1.0/src/examples/broker/ branches/1.0/src/examples/broker/WEB-INF/
branches/1.0/src/examples/consumer/ branches/1.0/src/examples/consumer/epr/
branches/1.0/src/examples/consumer/...
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/InvalidTopicExpressionFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/InvalidTopicExpressionFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/InvalidTopicExpressionFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/InvalidTopicExpressionFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN InvalidTopicExpressionFault (thrown by GetCurrentMessage operation).
+ */
+public class InvalidTopicExpressionFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link InvalidTopicExpressionFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public InvalidTopicExpressionFaultException( WsnNamespaceVersionHolder namespaceVersionHolder,
+ String faultString )
+ {
+ super( namespaceVersionHolder, faultString );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "InvalidTopicExpressionFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/NoCurrentMessageOnTopicFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/NoCurrentMessageOnTopicFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/NoCurrentMessageOnTopicFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/NoCurrentMessageOnTopicFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,54 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN NoCurrentMessageOnTopicFault (thrown by GetCurrentMessage operation).
+ */
+public class NoCurrentMessageOnTopicFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link NoCurrentMessageOnTopicFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ */
+ public NoCurrentMessageOnTopicFaultException( WsnNamespaceVersionHolder namespaceVersionHolder )
+ {
+ super( namespaceVersionHolder,
+ "The specified Topic is supported, but there is no notification message currently available on it." );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "NoCurrentMessageOnTopicFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN PauseFailedFault (thrown by Pause operation).
+ */
+public class PauseFailedFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link PauseFailedFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public PauseFailedFaultException( WsnNamespaceVersionHolder namespaceVersionHolder,
+ String faultString )
+ {
+ super( namespaceVersionHolder, faultString );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "PauseFailedFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN ResumeFailedFault (thrown by Resume operation).
+ */
+public class ResumeFailedFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link ResumeFailedFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public ResumeFailedFaultException( WsnNamespaceVersionHolder namespaceVersionHolder,
+ String faultString )
+ {
+ super( namespaceVersionHolder, faultString );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "ResumeFailedFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/SubscribeCreationFailedFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/SubscribeCreationFailedFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/SubscribeCreationFailedFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/SubscribeCreationFailedFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,53 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN SubscribeCreationFailedFault (thrown by Subscribe operation).
+ */
+public class SubscribeCreationFailedFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link SubscribeCreationFailedFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ */
+ public SubscribeCreationFailedFaultException( WsnNamespaceVersionHolder namespaceVersionHolder )
+ {
+ super( namespaceVersionHolder, "Unable to create subscription due to internal server error." );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "SubscribeCreationFailedFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicNotSupportedFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicNotSupportedFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicNotSupportedFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicNotSupportedFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN TopicNotSupportedFault (thrown by GetCurrentMessage operation).
+ */
+public class TopicNotSupportedFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link TopicNotSupportedFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public TopicNotSupportedFaultException( WsnNamespaceVersionHolder namespaceVersionHolder,
+ String faultString )
+ {
+ super( namespaceVersionHolder, faultString );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "TopicNotSupportedFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicPathDialectUnknownFaultException.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicPathDialectUnknownFaultException.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicPathDialectUnknownFaultException.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/faults/TopicPathDialectUnknownFaultException.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,55 @@
+/*=============================================================================*
+ * 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.base.faults;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseN TopicPathDialectUnknownFault (thrown by Subscribe operation).
+ */
+public class TopicPathDialectUnknownFaultException
+ extends AbstractBaseFaultException
+{
+ private QName m_name;
+
+ /**
+ * Creates a new {@link TopicPathDialectUnknownFaultException} object.
+ *
+ * @param namespaceVersionHolder DOCUMENT_ME
+ * @param faultString DOCUMENT_ME
+ */
+ public TopicPathDialectUnknownFaultException( WsnNamespaceVersionHolder namespaceVersionHolder,
+ String faultString )
+ {
+ super( namespaceVersionHolder, faultString );
+ m_name =
+ new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace( ),
+ "TopicPathDialectUnknownFault",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+ }
+
+ /**
+ * Returns the {@link QName} of this fault
+ * @return fault QName
+ */
+ public QName getBaseFaultName( )
+ {
+ return m_name;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/AbstractSubscription.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/AbstractSubscription.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/AbstractSubscription.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/AbstractSubscription.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,581 @@
+/*=============================================================================*
+ * 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.base.impl;
+
+import org.apache.commons.id.IdentifierUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.Soap1_1Constants;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.notification.base.NotificationProducerResource;
+import org.apache.ws.notification.base.Subscription;
+import org.apache.ws.notification.topics.Topic;
+import org.apache.ws.notification.topics.TopicListener;
+import org.apache.ws.notification.topics.TopicListenerList;
+import org.apache.ws.notification.topics.TopicSpaceSet;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.notification.topics.expression.TopicExpressionException;
+import org.apache.ws.notification.topics.impl.SubscriptionTopicListener;
+import org.apache.ws.pubsub.Filter;
+import org.apache.ws.pubsub.NotificationConsumer;
+import org.apache.ws.pubsub.NotificationProducer;
+import org.apache.ws.resource.PersistentResource;
+import org.apache.ws.resource.PropertiesResource;
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.ResourceHome;
+import org.apache.ws.resource.faults.FaultException;
+import org.apache.ws.resource.lifetime.ResourceTerminationEvent;
+import org.apache.ws.resource.lifetime.ResourceTerminationListener;
+import org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl;
+import org.apache.ws.resource.properties.ResourcePropertySet;
+import org.apache.ws.resource.properties.query.QueryExpression;
+import javax.naming.InitialContext;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * An Abstract Base class for Subscription Implementations.
+ */
+public abstract class AbstractSubscription
+ implements Subscription,
+ PropertiesResource
+{
+ private static final Log LOG = LogFactory.getLog( AbstractSubscription.class );
+
+ /** DOCUMENT_ME */
+ protected EndpointReference m_consumerReference;
+
+ /** DOCUMENT_ME */
+ protected EndpointReference m_producerReference;
+
+ /** DOCUMENT_ME */
+ protected Object m_policy;
+
+ /** DOCUMENT_ME */
+ protected QueryExpression m_precondition;
+
+ /** DOCUMENT_ME */
+ protected QueryExpression m_selector;
+
+ /** DOCUMENT_ME */
+ protected String m_producerHomeLocation;
+
+ /** DOCUMENT_ME */
+ protected TopicExpression m_topicExpression;
+
+ /** DOCUMENT_ME */
+ protected boolean m_isPaused;
+
+ /** DOCUMENT_ME */
+ protected boolean m_useNotify = true;
+
+ /** DOCUMENT_ME */
+ protected Calendar m_terminationTime;
+
+ /** DOCUMENT_ME */
+ protected Calendar m_creationTime;
+
+ /** DOCUMENT_ME */
+ protected String m_id;
+
+ /** DOCUMENT_ME */
+ protected EndpointReference m_epr;
+
+ /** DOCUMENT_ME */
+ protected transient ResourcePropertySet m_propSet;
+ private NotificationConsumer m_notificationConsumer;
+ private NotificationProducer m_notificationProducer;
+
+ /**
+ * A list of termination listeners to be notified when the resource is terminated.
+ */
+ private List m_terminationListeners = new ArrayList( );
+ private Object m_producerId;
+
+ /**
+ * Construct a new subscription resource.
+ *
+ * @param consumerReference The WS-Addressing endpoint reference of the consumer
+ * @param producerReference The WS-Addressing endpoint reference of the producer
+ * @param producerHomeLocation The JNDI location of the home of the producer resource
+ * @param topicExpression The topic expression for this subscription
+ */
+ public AbstractSubscription( EndpointReference consumerReference,
+ EndpointReference producerReference,
+ String producerHomeLocation,
+ Object producerId,
+ TopicExpression topicExpression )
+ {
+ m_id = IdentifierUtils.UUID_VERSION_FOUR_GENERATOR.nextIdentifier( ).toString( );
+ m_consumerReference = consumerReference;
+ m_producerReference = producerReference;
+ m_producerHomeLocation = producerHomeLocation;
+ m_producerId = producerId;
+ m_topicExpression = topicExpression;
+ m_creationTime = Calendar.getInstance( );
+ }
+
+ /**
+ * Creates a new {@link AbstractSubscription} object.
+ */
+ public AbstractSubscription( )
+ {
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getConsumerReference( )
+ {
+ return m_consumerReference;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Calendar getCreationTime( )
+ {
+ return m_creationTime;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Calendar getCurrentTime( )
+ {
+ return Calendar.getInstance( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public URI getDeliveryMode( )
+ {
+ // TODO. *SJC* This is provided for pubsub abstraction layer
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public void setEndpointReference( EndpointReference epr )
+ {
+ m_epr = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getEndpointReference( )
+ {
+ return m_epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Filter getFilters( )
+ {
+ // TODO. *SJC* This is provided for pubsub abstraction layer
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param id DOCUMENT_ME
+ */
+ public void setID( Object id )
+ {
+ m_id = (String) id;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getID( )
+ {
+ return m_id;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param notificationConsumer DOCUMENT_ME
+ */
+ public void setNotificationConsumer( NotificationConsumer notificationConsumer )
+ {
+ m_notificationConsumer = notificationConsumer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public NotificationConsumer getNotificationConsumer( )
+ {
+ return m_notificationConsumer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param notificationProducer DOCUMENT_ME
+ */
+ public void setNotificationProducer( NotificationProducer notificationProducer )
+ {
+ m_notificationProducer = notificationProducer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public NotificationProducer getNotificationProducer( )
+ {
+ return m_notificationProducer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean isPaused( )
+ {
+ return m_isPaused;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param policy DOCUMENT_ME
+ */
+ public void setPolicy( Object policy )
+ {
+ m_policy = policy;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getPolicy( )
+ {
+ return m_policy;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param precondition DOCUMENT_ME
+ */
+ public void setPrecondition( QueryExpression precondition )
+ {
+ m_precondition = precondition;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QueryExpression getPrecondition( )
+ {
+ return m_precondition;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getProducerReference( )
+ {
+ return m_producerReference;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public NotificationProducerResource getProducerResource( )
+ {
+ try
+ {
+ ResourceHome producerHome = (ResourceHome) new InitialContext( ).lookup( m_producerHomeLocation );
+ return (NotificationProducerResource) producerHome.find( m_producerId );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Failed to lookup NotificationProducer resource due to internal error: " + e,
+ e );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param resourcePropertySet DOCUMENT_ME
+ */
+ public void setResourcePropertySet( ResourcePropertySet resourcePropertySet )
+ {
+ m_propSet = resourcePropertySet;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResourcePropertySet getResourcePropertySet( )
+ {
+ return m_propSet;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param selector DOCUMENT_ME
+ */
+ public void setSelector( QueryExpression selector )
+ {
+ m_selector = selector;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QueryExpression getSelector( )
+ {
+ return m_selector;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param time DOCUMENT_ME
+ */
+ public void setTerminationTime( Calendar time )
+ {
+ m_terminationTime = time;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Calendar getTerminationTime( )
+ {
+ return m_terminationTime;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public TopicExpression getTopicExpression( )
+ {
+ return m_topicExpression;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param useNotify DOCUMENT_ME
+ */
+ public void setUseNotify( boolean useNotify )
+ {
+ m_useNotify = useNotify;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean getUseNotify( )
+ {
+ return m_useNotify;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param resourceTerminationListener DOCUMENT_ME
+ */
+ public void addTerminationListener( ResourceTerminationListener resourceTerminationListener )
+ {
+ m_terminationListeners.add( resourceTerminationListener );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void destroy( )
+ {
+ Resource producerResource = null;
+ try
+ {
+ producerResource = getProducerResource( );
+ }
+ catch ( Exception e )
+ {
+ ;
+ }
+
+ if ( !( producerResource instanceof NotificationProducerResource ) )
+ {
+ return;
+ }
+
+ Topic[] topics = null;
+ topics = evaluateTopicExpression( );
+
+ synchronized ( producerResource )
+ {
+ //removes listeners from the topics
+ boolean removed = removeListener( topics );
+
+ //persists the resource
+ if ( removed && producerResource instanceof PersistentResource )
+ {
+ try
+ {
+ ( (PersistentResource) producerResource ).store( );
+ }
+ catch ( ResourceException e )
+ {
+ LOG.debug( "Unable to persist the resource: " + producerResource + " with id: "
+ + producerResource.getID( ), e );
+ }
+ }
+ }
+
+ //notify listeners that this subscription expired.
+ ResourceTerminationEvent rte = new ResourceTerminationEventImpl( getID( ),
+ "Subscription Destroyed" );
+ for ( int i = 0; i < m_terminationListeners.size( ); i++ )
+ {
+ ResourceTerminationListener resourceTerminationListener =
+ (ResourceTerminationListener) m_terminationListeners.get( i );
+ resourceTerminationListener.terminationOccurred( rte );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void pause( )
+ throws Exception
+ {
+ m_isPaused = true;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public void resume( )
+ throws Exception
+ {
+ m_isPaused = false;
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void unsubscribe( )
+ {
+ destroy( );
+ }
+
+ private Topic[] evaluateTopicExpression( )
+ {
+ NotificationProducerResource resource = (NotificationProducerResource) getProducerResource( );
+ TopicSpaceSet topicSpaceSet = resource.getTopicSpaceSet( );
+ try
+ {
+ return topicSpaceSet.evaluateTopicExpression( m_topicExpression );
+ }
+ catch ( TopicExpressionException e )
+ {
+ LOG.debug( "Failed to evaluate TopicExpression.", e );
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ "An exception occurred evaluating the topic expression. " );
+ }
+ }
+
+ private boolean removeListener( Topic[] topics )
+ {
+ boolean removed = false;
+ for ( int i = 0; i < topics.length; i++ )
+ {
+ TopicListenerList topicListenerList = topics[i];
+ synchronized ( topicListenerList )
+ {
+ Iterator topicListenerIterator = topicListenerList.topicListenerIterator( );
+ while ( topicListenerIterator.hasNext( ) )
+ {
+ TopicListener listener = (TopicListener) topicListenerIterator.next( );
+ if ( listener instanceof SubscriptionTopicListener )
+ {
+ SubscriptionTopicListener lt = (SubscriptionTopicListener) listener;
+ Object subKey = lt.getSubscription( ).getID( );
+ if ( subKey.equals( m_id ) )
+ {
+ topicListenerIterator.remove( );
+ removed = true;
+ }
+ }
+ }
+ }
+ }
+
+ return removed;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/XmlBeansTopicExpression.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/XmlBeansTopicExpression.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/XmlBeansTopicExpression.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/impl/XmlBeansTopicExpression.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,187 @@
+/*=============================================================================*
+ * 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.base.impl;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.Soap1_1Constants;
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.resource.faults.FaultException;
+import org.apache.ws.resource.i18n.Keys;
+import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.resource.properties.query.impl.XmlBeansQueryExpression;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.i18n.Messages;
+import org.apache.ws.util.xml.impl.XmlBeansNamespaceContext;
+import org.apache.xmlbeans.XmlObject;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
+import javax.xml.rpc.JAXRPCException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * A TopicExpression impl that wraps a TopicExpressionType XMLBean.
+ *
+ * @author Ian Springer
+ */
+public class XmlBeansTopicExpression
+ implements TopicExpression,
+ XmlObjectWrapper
+{
+ private static final Log LOG = LogFactory.getLog( XmlBeansQueryExpression.class );
+
+ /** DOCUMENT_ME */
+ public static final Messages MSG = MessagesImpl.getInstance( );
+ private XmlObject m_topicExprXBean;
+ private URI m_dialect;
+ private Object m_content;
+ private Object m_nsContext;
+
+ /**
+ * Creates a new {@link XmlBeansTopicExpression} object.
+ *
+ * @param topicExprXBean DOCUMENT_ME
+ *
+ * @throws JAXRPCException DOCUMENT_ME
+ */
+ public XmlBeansTopicExpression( TopicExpressionType topicExprXBean )
+ throws InvalidTopicExpressionException
+ {
+ this( topicExprXBean,
+ getDialect( topicExprXBean ) );
+ }
+
+ /**
+ * Creates a new {@link XmlBeansTopicExpression} object.
+ *
+ * @param xBean DOCUMENT_ME
+ * @param dialect DOCUMENT_ME
+ *
+ * @throws InvalidTopicExpressionException DOCUMENT_ME
+ */
+ protected XmlBeansTopicExpression( XmlObject xBean,
+ URI dialect )
+ throws InvalidTopicExpressionException
+ {
+ m_topicExprXBean = xBean;
+ m_dialect = dialect;
+ XmlObject[] childElems = XmlBeanUtils.getChildElements( m_topicExprXBean );
+ if ( childElems.length > 1 )
+ {
+ throw new InvalidTopicExpressionException( MSG.getMessage( Keys.QUERY_ONLY_ONE_NODE ) );
+ }
+
+ if ( childElems.length == 1 )
+ {
+ m_content = childElems[0];
+ }
+ else
+ {
+ m_content = XmlBeanUtils.getValue( m_topicExprXBean );
+ }
+
+ m_nsContext = new XmlBeansNamespaceContext( m_topicExprXBean );
+ if ( LOG.isDebugEnabled( ) )
+ {
+ LOG.debug( MSG.getMessage( Keys.QUERY_EXPR,
+ toString( ) ) );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getContent( )
+ {
+ return m_content;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public URI getDialect( )
+ {
+ return m_dialect;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param nsContext DOCUMENT_ME
+ */
+ public void setNamespaceContext( Object nsContext )
+ {
+ m_nsContext = nsContext;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getNamespaceContext( )
+ {
+ return m_nsContext;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public XmlObject getXmlObject( )
+ {
+ return m_topicExprXBean;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String toString( )
+ {
+ return new ToStringBuilder( this ).append( MSG.getMessage( Keys.DIALECT ),
+ m_dialect ).append( MSG.getMessage( Keys.CONTENT ),
+ m_content ).toString( );
+ }
+
+ private static URI getDialect( TopicExpressionType topicExprElem )
+ {
+ if ( !topicExprElem.isSetDialect( ) )
+ {
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ "The Dialect attribute is required by the WS-BaseNotification TopicExpressionType." );
+ }
+
+ try
+ {
+ return new URI( topicExprElem.getDialect( ) );
+ }
+ catch ( URISyntaxException urise )
+ {
+ throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
+ "The Dialect attribute of the WS-BaseNotification TopicExpressionType must be a valid URI." );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/BaseNotificationConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,48 @@
+/*=============================================================================*
+ * 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.base.v2004_06;
+
+
+/**
+ * Constants defined by the WS-BaseNotification 1.2 Draft 01 specification.
+ */
+public interface BaseNotificationConstants
+{
+ /**
+ * Namespace URI of the WS-BaseNotification 1.2 Draft 01 schema.
+ */
+ String NSURI_WSNT_SCHEMA = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd";
+
+ /**
+ * Namespace prefix for the WS-BaseNotification 1.2 Draft 01 schema.
+ */
+ String NSPREFIX_WSNT_SCHEMA = "wsnt";
+
+ /**
+ * Namespace URI of the WS-BaseNotification 1.2 Draft 01 WSDL.
+ */
+ String NSURI_WSNT_WSDL = "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl";
+
+ /**
+ * Namespace prefix for the WS-BaseNotification 1.2 Draft 01 WSDL.
+ */
+ String NSPREFIX_WSNT_WSDL = "wsntw";
+
+ /**
+ * The value to use for the wsa:Action header in outgoing Notify messages.
+ */
+ String NOTIFY_ACTION_URL = BaseNotificationConstants.NSURI_WSNT_WSDL + "/Notify";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionHome.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionHome.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionHome.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionHome.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,237 @@
+/*=============================================================================*
+ * 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.base.v2004_06.impl;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.notification.base.Subscription;
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.resource.JndiConstants;
+import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.resource.properties.query.QueryExpression;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import java.lang.reflect.Constructor;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The home for the builtin SubscriptionManager service.
+ */
+public class SubscriptionHome
+ extends AbstractResourceHome
+{
+ /**
+ * The service endpoint name as registered with the SOAP Platform. This is useful for building EPR's. *
+ */
+ public static final javax.xml.namespace.QName SERVICE_NAME =
+ javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/notification/base/service/SubscriptionManager}SubscriptionManager" );
+
+ /**
+ * The management PortType associated with this resource. This is useful for building EPR's.*
+ */
+ public static final javax.xml.namespace.QName PORT_TYPE =
+ javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/notification/base/service/SubscriptionManager}SubscriptionManagerPortType" );
+
+ /**
+ * The WSDL Port name associated with the resource. This is useful for building EPR's. *
+ */
+ public static final String PORT_NAME = "SubscriptionManager";
+
+ /**
+ * The name of the resource key for this resource. *
+ */
+ public static final javax.xml.namespace.QName RESOURCE_KEY_NAME =
+ javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/notification/base/service/SubscriptionManager}ResourceID" );
+
+ /** DOCUMENT_ME */
+ public static final String HOME_LOCATION =
+ JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME.getLocalPart( ) + "/"
+ + JndiConstants.ATOMIC_NAME_HOME;
+ private static final NamespaceVersionHolder SPEC_NAMESPACE_SET = new WsnNamespaceVersionHolderImpl( );
+
+ /**
+ * Map containing all FilesystemResource instances - this map <em>must</em> be static for
+ * compatibility with certain JNDI providers.
+ */
+ private static Map s_resources;
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceVersionHolder( )
+ {
+ return SPEC_NAMESPACE_SET;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QName getPortType( )
+ {
+ return PORT_TYPE;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QName getResourceKeyNameQName( )
+ {
+ return RESOURCE_KEY_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public QName getServiceName( )
+ {
+ return SERVICE_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getServicePortName( )
+ {
+ return PORT_NAME;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param subscriptionResourceClass DOCUMENT_ME
+ * @param consumerReference DOCUMENT_ME
+ * @param producerReference DOCUMENT_ME
+ * @param initialTerminationTime DOCUMENT_ME
+ * @param policy DOCUMENT_ME
+ * @param precondition DOCUMENT_ME
+ * @param selector DOCUMENT_ME
+ * @param producerId DOCUMENT_ME
+ * @param producerHomeLocation DOCUMENT_ME
+ * @param topicExpression DOCUMENT_ME
+ * @param useNotify DOCUMENT_ME
+ * @param nsSet DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws ResourceException DOCUMENT_ME
+ */
+ public Subscription create( Class subscriptionResourceClass,
+ EndpointReference consumerReference,
+ EndpointReference producerReference,
+ Calendar initialTerminationTime,
+ Object policy,
+ QueryExpression precondition,
+ QueryExpression selector,
+ Object producerId,
+ String producerHomeLocation,
+ TopicExpression topicExpression,
+ boolean useNotify,
+ WsnNamespaceVersionHolder nsSet )
+ throws ResourceException
+ {
+ try
+ {
+ Constructor constructor =
+ subscriptionResourceClass.getConstructor( new Class[]
+ {
+ EndpointReference.class,
+ EndpointReference.class,
+ Object.class,
+ String.class,
+ TopicExpression.class
+ } );
+ Subscription subscription =
+ (Subscription) constructor.newInstance( new Object[]
+ {
+ consumerReference,
+ producerReference,
+ producerId,
+ producerHomeLocation,
+ topicExpression
+ } );
+ subscription.setTerminationTime( initialTerminationTime );
+ subscription.setUseNotify( useNotify );
+ subscription.setSelector( selector );
+ subscription.setPrecondition( precondition );
+ subscription.setPolicy( policy );
+ subscription.init( ); // initialize resource properties
+ String id = (String) subscription.getID( );
+ EndpointReference subscriptionEPR = getEndpointReference( id );
+
+ //do this here (rather than in find() ) since we need the EPR to be returned on the subscribe request.
+ subscription.setEndpointReference( subscriptionEPR );
+ add( subscription );
+ return subscription;
+ }
+ catch ( Exception e )
+ {
+ throw new ResourceException( "Failed to create Subscription resource.", e );
+ }
+ }
+
+ /**
+ * Returns a map of all FilesystemResource instances. Used by the {@link AbstractResourceHome}
+ * superclass.
+ */
+ protected final synchronized Map getResourceMap( )
+ {
+ if ( s_resources == null )
+ {
+ s_resources = AbstractResourceHome.createResourceMap( m_resourceIsPersistent );
+ }
+
+ return s_resources;
+ }
+
+ /**
+ * Do not modify this method.
+ */
+ protected final Map initResourceMap( )
+ throws NamingException
+ {
+ Context initialContext = new InitialContext( );
+ if ( m_resourceIsPersistent )
+ {
+ s_resources = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
+ initCachePolicy( initialContext );
+ }
+ else
+ {
+ s_resources = new HashMap( );
+ }
+
+ s_resources = Collections.synchronizedMap( s_resources );
+ return s_resources;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionResource.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,155 @@
+/*=============================================================================*
+ * 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.base.v2004_06.impl;
+
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.notification.base.impl.AbstractSubscription;
+import org.apache.ws.notification.base.impl.XmlBeansTopicExpression;
+import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.pubsub.SubscriptionEndConsumer;
+import org.apache.ws.resource.lifetime.callback.CurrentTimeCallback;
+import org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.ResourcePropertySet;
+import org.apache.ws.resource.properties.ResourcePropertySetMetaData;
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet;
+import org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySetMetaData;
+import org.apache.ws.resource.properties.query.impl.XmlBeansQueryExpression;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ConsumerReferenceDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.CreationTimeDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.PreconditionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SelectorDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscriptionManagerRPDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscriptionPolicyDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.UseNotifyDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryExpressionType;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
+import javax.xml.namespace.QName;
+
+/**
+ * The resource for the builtin SubscriptionManager service.
+ */
+public class SubscriptionResource
+ extends AbstractSubscription
+{
+ private static final QName[] READ_ONLY_PROP_NAMES =
+ {
+ ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME,
+ ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME,
+ SubscriptionManagerPortType.PROP_QNAME_CREATION_TIME
+ };
+
+ /**
+ * Creates a new {@link SubscriptionResource} object.
+ *
+ * @param consumerReference DOCUMENT_ME
+ * @param producerReference DOCUMENT_ME
+ * @param producerId DOCUMENT_ME
+ * @param producerHomeLocation DOCUMENT_ME
+ * @param topicExpression DOCUMENT_ME
+ */
+ public SubscriptionResource( EndpointReference consumerReference,
+ EndpointReference producerReference,
+ Object producerId,
+ String producerHomeLocation,
+ TopicExpression topicExpression )
+ {
+ super( consumerReference, producerReference, producerHomeLocation, producerId, topicExpression );
+ }
+
+ /**
+ * Get the subscriptionEnd consumer associated with this subscription.
+ *
+ * @return the subscriptionEnd consumer
+ */
+ public SubscriptionEndConsumer getSubscriptionEndConsumer( )
+ {
+ return null; //todo *SJC* pubsub stuff
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void init( )
+ {
+ SubscriptionManagerRPDocument propsDoc = SubscriptionManagerRPDocument.Factory.newInstance( );
+ ResourcePropertySetMetaData propSetMetaData =
+ new XmlBeansResourcePropertySetMetaData( propsDoc.schemaType( ), READ_ONLY_PROP_NAMES );
+ m_propSet = new XmlBeansResourcePropertySet( propsDoc, propSetMetaData );
+
+ // wsrlw:ScheduledResourceTermination props
+ ResourceProperty prop =
+ m_propSet.get( ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME );
+ CurrentTimeDocument currTimeDoc = CurrentTimeDocument.Factory.newInstance( );
+ currTimeDoc.setCurrentTime( getCurrentTime( ) );
+ prop.setCallback( new CurrentTimeCallback( ) );
+ prop.add( currTimeDoc );
+ prop = m_propSet.get( ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME );
+ TerminationTimeDocument termTimeDoc = TerminationTimeDocument.Factory.newInstance( );
+ termTimeDoc.setTerminationTime( getTerminationTime( ) );
+ prop.add( termTimeDoc );
+
+ // wsntw:SubscriptionManager props
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_CONSUMER_REFERENCE );
+ ConsumerReferenceDocument consumerRefDoc = ConsumerReferenceDocument.Factory.newInstance( );
+ consumerRefDoc.setConsumerReference( (EndpointReferenceType) ( (XmlObjectWrapper) m_consumerReference )
+ .getXmlObject( ) );
+ prop.add( consumerRefDoc );
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_CREATION_TIME );
+ CreationTimeDocument creationTimeDoc = CreationTimeDocument.Factory.newInstance( );
+ creationTimeDoc.setCreationTime( m_creationTime );
+ prop.add( creationTimeDoc );
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_TOPIC_EXPRESSION );
+ TopicExpressionDocument topicExprDoc = TopicExpressionDocument.Factory.newInstance( );
+ topicExprDoc.setTopicExpression( (TopicExpressionType) ( (XmlBeansTopicExpression) m_topicExpression )
+ .getXmlObject( ) );
+ prop.add( topicExprDoc );
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_USE_NOTIFY );
+ UseNotifyDocument useNotifyDoc = UseNotifyDocument.Factory.newInstance( );
+ useNotifyDoc.setUseNotify( m_useNotify );
+ prop.add( useNotifyDoc );
+ if ( m_precondition != null )
+ {
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_PRECONDITION );
+ PreconditionDocument preconditionDoc = PreconditionDocument.Factory.newInstance( );
+ preconditionDoc.setPrecondition( (QueryExpressionType) ( (XmlBeansQueryExpression) m_precondition )
+ .getXmlObject( ) );
+ prop.add( preconditionDoc );
+ }
+
+ if ( m_selector != null )
+ {
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_SELECTOR );
+ SelectorDocument selectorDoc = SelectorDocument.Factory.newInstance( );
+ selectorDoc.setSelector( (QueryExpressionType) ( (XmlBeansQueryExpression) m_selector ).getXmlObject( ) );
+ prop.add( selectorDoc );
+ }
+
+ if ( m_policy != null )
+ {
+ prop = m_propSet.get( SubscriptionManagerPortType.PROP_QNAME_SUBSCRIPTION_POLICY );
+ SubscriptionPolicyDocument subPolicyDoc = SubscriptionPolicyDocument.Factory.newInstance( );
+ subPolicyDoc.setSubscriptionPolicy( null );
+ prop.add( subPolicyDoc );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,231 @@
+/*=============================================================================*
+ * 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.base.v2004_06.impl;
+
+import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
+import org.apache.ws.notification.base.v2004_06.porttype.impl.SubscriptionManagerPortTypeImpl;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.handler.ServiceSoapMethodNameMap;
+import org.apache.ws.resource.handler.SoapMethodNameMap;
+import org.apache.ws.resource.handler.WsrfService;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.PauseSubscriptionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.PauseSubscriptionResponseDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ResumeSubscriptionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ResumeSubscriptionResponseDocument;
+import javax.xml.namespace.QName;
+
+/**
+ * The builtin SubscriptionManager service.
+ */
+public class SubscriptionService
+ implements WsrfService,
+ SubscriptionManagerPortType,
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType,
+ org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType,
+ org.apache.ws.resource.lifetime.v2004_06.porttype.ImmediateResourceTerminationPortType
+{
+ /** DOCUMENT_ME */
+ public static final String TARGET_NSURI =
+ "http://ws.apache.org/notification/base/service/SubscriptionManager";
+
+ /** DOCUMENT_ME */
+ public static final String TARGET_NSPREFIX = "SubscriptionManager";
+ private ResourceContext m_resourceContext;
+
+ /**
+ * DOCUMENT_ME
+ */
+ private ServiceSoapMethodNameMap m_methodNameMap;
+
+ /**
+ * DOCUMENT_ME
+ */
+ private boolean m_isInitialized;
+
+ /**
+ * Creates a new {@link SubscriptionService } object.
+ *
+ * @param resourceContext DOCUMENT_ME
+ */
+ public SubscriptionService( ResourceContext resourceContext )
+ {
+ m_resourceContext = resourceContext;
+ init( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param request DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.xmlsoap.schemas.ws.x2004.x09.mex.MetadataDocument getMetadata( org.xmlsoap.schemas.ws.x2004.x09.mex.GetMetadataDocument request )
+ {
+ return new org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl.MetadataExchangePortTypeImpl( getResourceContext( ) )
+ .getMetadata( request );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestQname DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getMethodName( QName requestQname )
+ {
+ return m_methodNameMap.getMethodName( requestQname );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public final SoapMethodNameMap getMethodNameMap( )
+ {
+ return m_methodNameMap;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesResponseDocument getMultipleResourceProperties( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMultipleResourcePropertiesDocument requestDoc )
+ {
+ return new org.apache.ws.resource.properties.v2004_06.porttype.impl.GetMultipleResourcePropertiesPortTypeImpl( getResourceContext( ) )
+ .getMultipleResourceProperties( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResourceContext getResourceContext( )
+ {
+ return m_resourceContext;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesResponseDocument setResourceProperties( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument requestDoc )
+ {
+ return new org.apache.ws.resource.properties.v2004_06.porttype.impl.SetResourcePropertiesPortTypeImpl( getResourceContext( ) )
+ .setResourceProperties( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyResponseDocument getResourceProperty( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResourcePropertyDocument requestDoc )
+ {
+ return new org.apache.ws.resource.properties.v2004_06.porttype.impl.GetResourcePropertyPortTypeImpl( getResourceContext( ) )
+ .getResourceProperty( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.SetTerminationTimeResponseDocument setTerminationTime( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.SetTerminationTimeDocument requestDoc )
+ {
+ return new org.apache.ws.resource.lifetime.v2004_06.porttype.impl.ScheduledResourceTerminationPortTypeImpl( getResourceContext( ) )
+ .setTerminationTime( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyResponseDocument destroy( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyDocument requestDoc )
+ {
+ return new org.apache.ws.resource.lifetime.v2004_06.porttype.impl.ImmediateResourceTerminationPortTypeImpl( getResourceContext( ) )
+ .destroy( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.xmlsoap.schemas.ws.x2004.x09.mex.AnyXmlType get( )
+ {
+ return new org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl.MetadataExchangePortTypeImpl( getResourceContext( ) )
+ .get( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public synchronized void init( )
+ {
+ if ( !m_isInitialized )
+ {
+ m_methodNameMap = new ServiceSoapMethodNameMap( getResourceContext( ) );
+ m_isInitialized = true;
+ }
+ }
+
+ /**
+ * @param requestDoc
+ *
+ * @return
+ */
+ public PauseSubscriptionResponseDocument pauseSubscription( PauseSubscriptionDocument requestDoc )
+ {
+ return new SubscriptionManagerPortTypeImpl( getResourceContext( ) ).pauseSubscription( requestDoc );
+ }
+
+ /**
+ * @param requestDoc
+ *
+ * @return
+ */
+ public ResumeSubscriptionResponseDocument resumeSubscription( ResumeSubscriptionDocument requestDoc )
+ {
+ return new SubscriptionManagerPortTypeImpl( getResourceContext( ) ).resumeSubscription( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected final boolean isInitialized( )
+ {
+ return m_isInitialized;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,59 @@
+/*=============================================================================*
+ * 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.base.v2004_06.impl;
+
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.notification.topics.v2004_06.TopicsConstants;
+import org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl;
+
+/**
+ * @author Sal Campana
+ */
+public class WsnNamespaceVersionHolderImpl
+ extends NamespaceVersionHolderImpl
+ implements WsnNamespaceVersionHolder
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getBaseNotificationXsdNamespace( )
+ {
+ return BaseNotificationConstants.NSURI_WSNT_SCHEMA;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getBrokeredNotificationXsdNamespace( )
+ {
+ return "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd";
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getTopicsXsdNamespace( )
+ {
+ return TopicsConstants.NSURI_WSTOP_SCHEMA;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,40 @@
+/*=============================================================================*
+ * 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.base.v2004_06.porttype;
+
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotifyDocument;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseNotification NotificationConsumer portType.
+ */
+public interface NotificationConsumerPortType
+{
+ /**
+ * QName of the NotificationConsumer
+ */
+ QName NAME =
+ new QName( BaseNotificationConstants.NSURI_WSNT_WSDL, "NotificationConsumer",
+ BaseNotificationConstants.NSPREFIX_WSNT_WSDL );
+
+ /**
+ * Method for receiving notifications.
+ *
+ * @param requestDoc
+ */
+ void notify( NotifyDocument requestDoc );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,80 @@
+/*=============================================================================*
+ * 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.base.v2004_06.porttype;
+
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageResponseDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseNotification NotificationProducer portType.
+ */
+public interface NotificationProducerPortType
+{
+ /**
+ * QName of NotificationProducer.
+ */
+ QName NAME =
+ new QName( BaseNotificationConstants.NSURI_WSNT_WSDL, "NotificationProducer",
+ BaseNotificationConstants.NSPREFIX_WSNT_WSDL );
+
+ /**
+ * QName of NotificationProducerRP Resource Properties Document.
+ */
+ QName PROPS_DOC_NAME =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "NotificationProducerRP",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * Topic property name.
+ */
+ QName PROP_QNAME_TOPIC =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Topic",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * FixedTopicSet property name.
+ */
+ QName PROP_QNAME_FIXED_TOPIC_SET =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "FixedTopicSet",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * TopicExpressionDialects property name.
+ */
+ QName PROP_QNAME_TOPIC_EXPRESSION_DIALECTS =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "TopicExpressionDialects",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * Method used for retrieving the current message from the NotificationProducer.
+ *
+ * @param requestDoc
+ * @return GetCurrentMessageResponseDocument
+ */
+ GetCurrentMessageResponseDocument getCurrentMessage( GetCurrentMessageDocument requestDoc );
+
+ /**
+ * Method used to subscribe for notifications.
+ *
+ * @param requestDoc
+ * @return SubscribeResponseDocument
+ */
+ SubscribeResponseDocument subscribe( SubscribeDocument requestDoc );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,110 @@
+/*=============================================================================*
+ * 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.base.v2004_06.porttype;
+
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.PauseSubscriptionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.PauseSubscriptionResponseDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ResumeSubscriptionDocument;
+import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ResumeSubscriptionResponseDocument;
+import javax.xml.namespace.QName;
+
+/**
+ * The WS-BaseNotification SubscriptionManager portType.
+ */
+public interface SubscriptionManagerPortType
+{
+ /**
+ * QName of SubscriptionManager
+ */
+ QName NAME =
+ new QName( BaseNotificationConstants.NSURI_WSNT_WSDL, "SubscriptionManager",
+ BaseNotificationConstants.NSPREFIX_WSNT_WSDL );
+
+ /**
+ * QName of the SubscriptionManagerRP Resource Property Document
+ */
+ QName PROPS_DOC_NAME =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "SubscriptionManagerRP",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * ConsumerReference property name.
+ */
+ QName PROP_QNAME_CONSUMER_REFERENCE =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "ConsumerReference",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * TopicExpression property name.
+ */
+ QName PROP_QNAME_TOPIC_EXPRESSION =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "TopicExpression",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * UseNotify property name.
+ */
+ QName PROP_QNAME_USE_NOTIFY =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "UseNotify",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * Precondition property name.
+ */
+ QName PROP_QNAME_PRECONDITION =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Precondition",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * Selector property name.
+ */
+ QName PROP_QNAME_SELECTOR =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "Selector",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * SubscriptionPolicy property name.
+ */
+ QName PROP_QNAME_SUBSCRIPTION_POLICY =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "SubscriptionPolicy",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * CreationTime property name.
+ */
+ QName PROP_QNAME_CREATION_TIME =
+ new QName( BaseNotificationConstants.NSURI_WSNT_SCHEMA, "CreationTime",
+ BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+
+ /**
+ * Method used to pause a subscription
+ *
+ * @param requestDoc
+ *
+ * @return PauseSubscriptionResponseDocument
+ */
+ PauseSubscriptionResponseDocument pauseSubscription( PauseSubscriptionDocument requestDoc );
+
+ /**
+ * Method used to resume a subscription
+ *
+ * @param requestDoc
+ *
+ * @return ResumeSubscriptionResponseDocument
+ */
+ ResumeSubscriptionResponseDocument resumeSubscription( ResumeSubscriptionDocument requestDoc );
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org