You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-commits@ws.apache.org by sc...@apache.org on 2005/08/02 18:41:44 UTC
svn commit: r227035 [5/12] - in /webservices/pubscribe/trunk: ./
src/java/org/apache/ws/eventing/ src/java/org/apache/ws/eventing/porttype/
src/java/org/apache/ws/eventing/porttype/impl/
src/java/org/apache/ws/eventing/pubsub/ src/java/org/apache/ws/ev...
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/SubscriptionService.java Tue Aug 2 09:41:00 2005
@@ -1,201 +1,231 @@
-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
-{
-
- public static final String TARGET_NSURI = "http://ws.apache.org/notification/base/service/SubscriptionManager";
- 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 requestQname DOCUMENT_ME
- *
- * @return DOCUMENT_ME
- */
- public String getMethodName( QName requestQname )
- {
- return m_methodNameMap.getMethodName( requestQname );
- }
-
- /**
- * DOCUMENT_ME
- *
- * @return DOCUMENT_ME
- */
- public ResourceContext getResourceContext()
- {
- return m_resourceContext;
- }
-
- /**
- * DOCUMENT_ME
- *
- * @return DOCUMENT_ME
- */
- public final SoapMethodNameMap getMethodNameMap()
- {
- return m_methodNameMap;
- }
-
- /**
- * DOCUMENT_ME
- */
- public synchronized void init()
- {
- if ( ! m_isInitialized )
- {
- m_methodNameMap = new ServiceSoapMethodNameMap( getResourceContext() );
- m_isInitialized = true;
- }
- }
-
- /**
- * DOCUMENT_ME
- *
- * @return DOCUMENT_ME
- */
- protected final boolean isInitialized()
- {
- return m_isInitialized;
- }
-
- /**
- * 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.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.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
- *
- * @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.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 );
- }
-
- /**
- * @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 );
-
- }
-
- 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);
- }
-
- public org.xmlsoap.schemas.ws.x2004.x09.mex.AnyXmlType get()
- {
- return new org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl.MetadataExchangePortTypeImpl(getResourceContext()).get();
- }
-
-}
+/*=============================================================================*
+ * 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
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/impl/WsnNamespaceVersionHolderImpl.java Tue Aug 2 09:41:00 2005
@@ -1,27 +1,59 @@
-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
-{
- public String getTopicsXsdNamespace()
- {
- return TopicsConstants.NSURI_WSTOP_SCHEMA;
- }
-
- public String getBaseNotificationXsdNamespace()
- {
- return BaseNotificationConstants.NSURI_WSNT_SCHEMA;
- }
-
- public String getBrokeredNotificationXsdNamespace()
- {
- return "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BrokeredNotification-1.2-draft-01.xsd";
- }
-}
+/*=============================================================================*
+ * 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
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationConsumerPortType.java Tue Aug 2 09:41:00 2005
@@ -1,40 +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.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.NotifyDocument;
-import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
-
-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 );
-
-}
+/*=============================================================================*
+ * 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
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/NotificationProducerPortType.java Tue Aug 2 09:41:00 2005
@@ -1,74 +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.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageResponseDocument;
-import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument;
-import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
-
-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 to subscribe for notifications.
- *
- * @param requestDoc
- * @return SubscribeResponseDocument
- */
- SubscribeResponseDocument subscribe( SubscribeDocument requestDoc );
-
- /**
- * Method used for retrieving the current message from the NotificationProducer.
- *
- * @param requestDoc
- * @return GetCurrentMessageResponseDocument
- */
- GetCurrentMessageResponseDocument getCurrentMessage( GetCurrentMessageDocument requestDoc );
-
-}
+/*=============================================================================*
+ * 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
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/SubscriptionManagerPortType.java Tue Aug 2 09:41:00 2005
@@ -1,102 +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 );
-
-}
+/*=============================================================================*
+ * 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
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java Tue Aug 2 09:41:00 2005
@@ -1,225 +1,261 @@
-/*=============================================================================*
- * 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.impl;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ws.XmlObjectWrapper;
-import org.apache.ws.addressing.EndpointReference;
-import org.apache.ws.addressing.XmlBeansEndpointReference;
-import org.apache.ws.notification.base.NotificationProducerResource;
-import org.apache.ws.notification.base.Subscription;
-import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
-import org.apache.ws.notification.base.faults.InvalidTopicExpressionFaultException;
-import org.apache.ws.notification.base.faults.NoCurrentMessageOnTopicFaultException;
-import org.apache.ws.notification.base.faults.SubscribeCreationFailedFaultException;
-import org.apache.ws.notification.base.faults.TopicPathDialectUnknownFaultException;
-import org.apache.ws.notification.base.impl.XmlBeansTopicExpression;
-import org.apache.ws.notification.base.v2004_06.impl.SubscriptionHome;
-import org.apache.ws.notification.base.v2004_06.impl.SubscriptionResource;
-import org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl;
-import org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType;
-import org.apache.ws.notification.topics.Topic;
-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.expression.TopicPathDialectUnknownException;
-import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
-import org.apache.ws.notification.topics.impl.SubscriptionTopicListener;
-import org.apache.ws.resource.ResourceContext;
-import org.apache.ws.resource.faults.BaseFaultException;
-import org.apache.ws.resource.impl.AbstractResourceContext;
-import org.apache.ws.resource.properties.NamespaceVersionHolder;
-import org.apache.ws.resource.properties.impl.AbstractResourcePropertiesPortType;
-import org.apache.ws.resource.properties.query.QueryExpression;
-import org.apache.ws.resource.properties.query.impl.XmlBeansQueryExpression;
-import org.apache.ws.util.XmlBeanUtils;
-import org.apache.xmlbeans.XmlObject;
-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 org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
-import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Calendar;
-
-/**
- * An implementation of the WS-BaseNotification NotificationProducer portType.
- *
- * @author Ian Springer (ian DOT springer AT hp DOT com)
- */
-public class NotificationProducerPortTypeImpl extends AbstractResourcePropertiesPortType
- implements NotificationProducerPortType
-{
-
- private static final Log LOG = LogFactory.getLog(NotificationProducerPortTypeImpl.class.getName());
- private static final WsnNamespaceVersionHolder NAMESPACE_SET = new WsnNamespaceVersionHolderImpl() ;
-
- public NotificationProducerPortTypeImpl( ResourceContext resourceContext )
- {
- super( resourceContext );
- }
-
- /**
- * @see NotificationProducerPortType#subscribe(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument)
- */
- public SubscribeResponseDocument subscribe( SubscribeDocument requestDoc )
- {
- SubscribeDocument.Subscribe request = requestDoc.getSubscribe();
- TopicExpression topicExpr = getTopicExpression( request.getTopicExpression() );
- Topic[] topics = evaluateTopicExpression( topicExpr );
- if ( topics.length == 0 )
- {
- throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
- "Given TopicExpression did not match any Topics supported by this NotificationProducer - the WS-BaseN spec mandates that it match at least one." );
- }
- Calendar initialTerminationTime = null;
- if ( request.isSetInitialTerminationTime() )
- {
- initialTerminationTime = request.getInitialTerminationTime();
- }
- QueryExpression precondition = null;
- if ( request.isSetPrecondition() )
- {
- precondition = new XmlBeansQueryExpression( request.getPrecondition() );
- }
- QueryExpression selector = null;
- if ( request.isSetSelector() )
- {
- selector = new XmlBeansQueryExpression( request.getSelector() );
- }
- XmlObject subPolicy = null;
- if ( request.isSetSubscriptionPolicy() )
- {
- subPolicy = request.getSubscriptionPolicy();
- }
- EndpointReferenceType subscriptionEPR = null;
-
- boolean useNotify = request.isSetUseNotify() ? request.getUseNotify() : true; // NOTE: we must set the default value ourselves, as XMLBeans does NOT do this for us
- EndpointReference producerEPR = getResource().getEndpointReference();
- SubscriptionHome subscriptionHome = null;
- try
- {
- subscriptionHome = (SubscriptionHome) new InitialContext().lookup(
- SubscriptionHome.HOME_LOCATION );
- }
- catch ( NamingException ne )
- {
- LOG.error( "Subscribe failed due to internal error: " + ne );
- throw new BaseFaultException( NAMESPACE_SET, "Subscribe failed due to internal server error." );
- }
- Subscription subscription = null;
- try
- {
- subscription = subscriptionHome.create( SubscriptionResource.class,
- new XmlBeansEndpointReference( request.getConsumerReference() ), producerEPR, initialTerminationTime,
- subPolicy, precondition, selector, getResource().getID(),
- ( (AbstractResourceContext) getResourceContext() ).getResourceHomeLocation(), topicExpr, useNotify, (WsnNamespaceVersionHolder) getNamespaceSet() );
- }
- catch ( Exception e )
- {
- LOG.error( "Subscribe failed due to internal error: " + e );
- if ( LOG.isDebugEnabled() )
- {
- e.printStackTrace( );
- }
- throw new SubscribeCreationFailedFaultException( NAMESPACE_SET );
- }
- SubscriptionTopicListener subscriptionTopicListener = new SubscriptionTopicListener( subscription );
- for ( int i = 0; i < topics.length; i++ )
- {
- topics[i].addTopicListener( subscriptionTopicListener );
- }
- SubscribeResponseDocument subscribeResponseDoc = SubscribeResponseDocument.Factory.newInstance();
- SubscribeResponseDocument.SubscribeResponse subscribeResponse = subscribeResponseDoc.addNewSubscribeResponse();
- subscriptionEPR = (EndpointReferenceType) ( (XmlObjectWrapper) subscription.getEndpointReference() ).getXmlObject();
- subscribeResponse.setSubscriptionReference( subscriptionEPR );
- return subscribeResponseDoc;
- }
-
- private TopicExpression getTopicExpression( TopicExpressionType topicExpressionType )
- {
- TopicExpression topicExpr = null;
- try
- {
- topicExpr = new XmlBeansTopicExpression( topicExpressionType );
- }
- catch ( InvalidTopicExpressionException ite )
- {
- throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
- ite.getLocalizedMessage() );
- }
- return topicExpr;
- }
-
- /**
- * @see NotificationProducerPortType#getCurrentMessage(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument)
- */
- public GetCurrentMessageResponseDocument getCurrentMessage( GetCurrentMessageDocument requestDoc )
- {
- GetCurrentMessageDocument.GetCurrentMessage request = requestDoc.getGetCurrentMessage();
- TopicExpression topicExpr = getTopicExpression( request.getTopic() );
- Topic[] topics = evaluateTopicExpression( topicExpr );
- if ( topics.length == 0 )
- {
- throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
- "Given TopicExpression 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 InvalidTopicExpressionFaultException( NAMESPACE_SET,
- "Given TopicExpression matched more than one Topic supported by this NotificationProducer - the WS-BaseN spec mandates that it match exactly one." );
- }
- Topic topic = topics[0];
- XmlObject currentMsg = (XmlObject) topic.getCurrentMessage();
- if ( currentMsg == null )
- {
- throw new NoCurrentMessageOnTopicFaultException( NAMESPACE_SET );
- }
- GetCurrentMessageResponseDocument responseDoc = GetCurrentMessageResponseDocument.Factory.newInstance();
- GetCurrentMessageResponseDocument.GetCurrentMessageResponse response = responseDoc.addNewGetCurrentMessageResponse();
- XmlBeanUtils.addChildElement( response, currentMsg );
- return responseDoc;
- }
-
- private Topic[] evaluateTopicExpression( TopicExpression topicExpr )
- {
- try
- {
- NotificationProducerResource resource = (NotificationProducerResource) getResource();
- TopicSpaceSet topicSpaceSet = resource.getTopicSpaceSet();
- return topicSpaceSet.evaluateTopicExpression( topicExpr );
- }
- catch ( TopicPathDialectUnknownException tpdue )
- {
- throw new TopicPathDialectUnknownFaultException( NAMESPACE_SET,
- tpdue.getLocalizedMessage() );
- }
- catch ( TopicExpressionException tee )
- {
- throw new BaseFaultException( NAMESPACE_SET, tee.getLocalizedMessage() );
- }
- }
-
- protected NamespaceVersionHolder getNamespaceSet()
- {
- return NAMESPACE_SET;
- }
-
-}
+/*=============================================================================*
+ * 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.impl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.notification.base.NotificationProducerResource;
+import org.apache.ws.notification.base.Subscription;
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.faults.InvalidTopicExpressionFaultException;
+import org.apache.ws.notification.base.faults.NoCurrentMessageOnTopicFaultException;
+import org.apache.ws.notification.base.faults.SubscribeCreationFailedFaultException;
+import org.apache.ws.notification.base.faults.TopicPathDialectUnknownFaultException;
+import org.apache.ws.notification.base.impl.XmlBeansTopicExpression;
+import org.apache.ws.notification.base.v2004_06.impl.SubscriptionHome;
+import org.apache.ws.notification.base.v2004_06.impl.SubscriptionResource;
+import org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl;
+import org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType;
+import org.apache.ws.notification.topics.Topic;
+import org.apache.ws.notification.topics.TopicSpaceSet;
+import org.apache.ws.notification.topics.expression.InvalidTopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicExpression;
+import org.apache.ws.notification.topics.expression.TopicExpressionException;
+import org.apache.ws.notification.topics.expression.TopicPathDialectUnknownException;
+import org.apache.ws.notification.topics.impl.SubscriptionTopicListener;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.faults.BaseFaultException;
+import org.apache.ws.resource.impl.AbstractResourceContext;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.resource.properties.impl.AbstractResourcePropertiesPortType;
+import org.apache.ws.resource.properties.query.QueryExpression;
+import org.apache.ws.resource.properties.query.impl.XmlBeansQueryExpression;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlObject;
+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 org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Calendar;
+
+/**
+ * An implementation of the WS-BaseNotification NotificationProducer portType.
+ *
+ * @author Ian Springer (ian DOT springer AT hp DOT com)
+ */
+public class NotificationProducerPortTypeImpl
+ extends AbstractResourcePropertiesPortType
+ implements NotificationProducerPortType
+{
+ private static final Log LOG =
+ LogFactory.getLog( NotificationProducerPortTypeImpl.class.getName( ) );
+ private static final WsnNamespaceVersionHolder NAMESPACE_SET = new WsnNamespaceVersionHolderImpl( );
+
+ /**
+ * Creates a new {@link NotificationProducerPortTypeImpl} object.
+ *
+ * @param resourceContext DOCUMENT_ME
+ */
+ public NotificationProducerPortTypeImpl( ResourceContext resourceContext )
+ {
+ super( resourceContext );
+ }
+
+ /**
+ * @see NotificationProducerPortType#getCurrentMessage(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument)
+ */
+ public GetCurrentMessageResponseDocument getCurrentMessage( GetCurrentMessageDocument requestDoc )
+ {
+ GetCurrentMessageDocument.GetCurrentMessage request = requestDoc.getGetCurrentMessage( );
+ TopicExpression topicExpr = getTopicExpression( request.getTopic( ) );
+ Topic[] topics = evaluateTopicExpression( topicExpr );
+ if ( topics.length == 0 )
+ {
+ throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
+ "Given TopicExpression 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 InvalidTopicExpressionFaultException( NAMESPACE_SET,
+ "Given TopicExpression matched more than one Topic supported by this NotificationProducer - the WS-BaseN spec mandates that it match exactly one." );
+ }
+
+ Topic topic = topics[0];
+ XmlObject currentMsg = (XmlObject) topic.getCurrentMessage( );
+ if ( currentMsg == null )
+ {
+ throw new NoCurrentMessageOnTopicFaultException( NAMESPACE_SET );
+ }
+
+ GetCurrentMessageResponseDocument responseDoc =
+ GetCurrentMessageResponseDocument.Factory.newInstance( );
+ GetCurrentMessageResponseDocument.GetCurrentMessageResponse response =
+ responseDoc.addNewGetCurrentMessageResponse( );
+ XmlBeanUtils.addChildElement( response, currentMsg );
+ return responseDoc;
+ }
+
+ /**
+ * @see NotificationProducerPortType#subscribe(org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument)
+ */
+ public SubscribeResponseDocument subscribe( SubscribeDocument requestDoc )
+ {
+ SubscribeDocument.Subscribe request = requestDoc.getSubscribe( );
+ TopicExpression topicExpr = getTopicExpression( request.getTopicExpression( ) );
+ Topic[] topics = evaluateTopicExpression( topicExpr );
+ if ( topics.length == 0 )
+ {
+ throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
+ "Given TopicExpression did not match any Topics supported by this NotificationProducer - the WS-BaseN spec mandates that it match at least one." );
+ }
+
+ Calendar initialTerminationTime = null;
+ if ( request.isSetInitialTerminationTime( ) )
+ {
+ initialTerminationTime = request.getInitialTerminationTime( );
+ }
+
+ QueryExpression precondition = null;
+ if ( request.isSetPrecondition( ) )
+ {
+ precondition = new XmlBeansQueryExpression( request.getPrecondition( ) );
+ }
+
+ QueryExpression selector = null;
+ if ( request.isSetSelector( ) )
+ {
+ selector = new XmlBeansQueryExpression( request.getSelector( ) );
+ }
+
+ XmlObject subPolicy = null;
+ if ( request.isSetSubscriptionPolicy( ) )
+ {
+ subPolicy = request.getSubscriptionPolicy( );
+ }
+
+ EndpointReferenceType subscriptionEPR = null;
+
+ boolean useNotify = request.isSetUseNotify( ) ? request.getUseNotify( ) : true; // NOTE: we must set the default value ourselves, as XMLBeans does NOT do this for us
+ EndpointReference producerEPR = getResource( ).getEndpointReference( );
+ SubscriptionHome subscriptionHome = null;
+ try
+ {
+ subscriptionHome = (SubscriptionHome) new InitialContext( ).lookup( SubscriptionHome.HOME_LOCATION );
+ }
+ catch ( NamingException ne )
+ {
+ LOG.error( "Subscribe failed due to internal error: " + ne );
+ throw new BaseFaultException( NAMESPACE_SET, "Subscribe failed due to internal server error." );
+ }
+
+ Subscription subscription = null;
+ try
+ {
+ subscription =
+ subscriptionHome.create( SubscriptionResource.class,
+ new XmlBeansEndpointReference( request.getConsumerReference( ) ),
+ producerEPR,
+ initialTerminationTime,
+ subPolicy,
+ precondition,
+ selector,
+ getResource( ).getID( ),
+ ( (AbstractResourceContext) getResourceContext( ) ).getResourceHomeLocation( ),
+ topicExpr,
+ useNotify,
+ (WsnNamespaceVersionHolder) getNamespaceSet( ) );
+ }
+ catch ( Exception e )
+ {
+ LOG.error( "Subscribe failed due to internal error: " + e );
+ if ( LOG.isDebugEnabled( ) )
+ {
+ e.printStackTrace( );
+ }
+
+ throw new SubscribeCreationFailedFaultException( NAMESPACE_SET );
+ }
+
+ SubscriptionTopicListener subscriptionTopicListener = new SubscriptionTopicListener( subscription );
+ for ( int i = 0; i < topics.length; i++ )
+ {
+ topics[i].addTopicListener( subscriptionTopicListener );
+ }
+
+ SubscribeResponseDocument subscribeResponseDoc =
+ SubscribeResponseDocument.Factory.newInstance( );
+ SubscribeResponseDocument.SubscribeResponse subscribeResponse =
+ subscribeResponseDoc.addNewSubscribeResponse( );
+ subscriptionEPR =
+ (EndpointReferenceType) ( (XmlObjectWrapper) subscription.getEndpointReference( ) ).getXmlObject( );
+ subscribeResponse.setSubscriptionReference( subscriptionEPR );
+ return subscribeResponseDoc;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected NamespaceVersionHolder getNamespaceSet( )
+ {
+ return NAMESPACE_SET;
+ }
+
+ private TopicExpression getTopicExpression( TopicExpressionType topicExpressionType )
+ {
+ TopicExpression topicExpr = null;
+ try
+ {
+ topicExpr = new XmlBeansTopicExpression( topicExpressionType );
+ }
+ catch ( InvalidTopicExpressionException ite )
+ {
+ throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
+ ite.getLocalizedMessage( ) );
+ }
+
+ return topicExpr;
+ }
+
+ private Topic[] evaluateTopicExpression( TopicExpression topicExpr )
+ {
+ try
+ {
+ NotificationProducerResource resource = (NotificationProducerResource) getResource( );
+ TopicSpaceSet topicSpaceSet = resource.getTopicSpaceSet( );
+ return topicSpaceSet.evaluateTopicExpression( topicExpr );
+ }
+ catch ( TopicPathDialectUnknownException tpdue )
+ {
+ throw new TopicPathDialectUnknownFaultException( NAMESPACE_SET,
+ tpdue.getLocalizedMessage( ) );
+ }
+ catch ( TopicExpressionException tee )
+ {
+ throw new BaseFaultException( NAMESPACE_SET,
+ tee.getLocalizedMessage( ) );
+ }
+ }
+}
\ No newline at end of file
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java Tue Aug 2 09:41:00 2005
@@ -1,99 +1,122 @@
-/*=============================================================================*
- * 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.impl;
-
-import org.apache.ws.notification.base.Subscription;
-import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
-import org.apache.ws.notification.base.faults.PauseFailedFaultException;
-import org.apache.ws.notification.base.faults.ResumeFailedFaultException;
-import org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl;
-import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
-import org.apache.ws.resource.ResourceContext;
-import org.apache.ws.resource.properties.NamespaceVersionHolder;
-import org.apache.ws.resource.properties.impl.AbstractResourcePropertiesPortType;
-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;
-
-/**
- * An implementation of the WS-BaseNotification SubscriptionManager portType.
- *
- * @author Ian Springer (ian DOT springer AT hp DOT com)
- */
-public class SubscriptionManagerPortTypeImpl extends AbstractResourcePropertiesPortType
- implements SubscriptionManagerPortType
-{
-
- private static final WsnNamespaceVersionHolder NAMESPACE_SET = new WsnNamespaceVersionHolderImpl();
-
- public SubscriptionManagerPortTypeImpl( ResourceContext resourceContext )
- {
- super( resourceContext );
- }
-
- public PauseSubscriptionResponseDocument pauseSubscription( PauseSubscriptionDocument requestDoc )
- {
- Subscription subscription = (Subscription) getResource();
- try
- {
- subscription.pause();
- }
- catch ( Exception e )
- {
- throw new PauseFailedFaultException( NAMESPACE_SET,
- "Pause failed on subscription: " + subscription.getID() );
- }
- return createPauseSubscriptionResponseDocument();
- }
-
- public ResumeSubscriptionResponseDocument resumeSubscription( ResumeSubscriptionDocument requestDoc )
- {
- Subscription subscription = (Subscription) getResource();
- try
- {
- subscription.resume();
- }
- catch ( Exception e )
- {
- throw new ResumeFailedFaultException( NAMESPACE_SET,
- "Resume failed on subscription: " + subscription.getID() );
- }
- return createResumeSubscriptionResponseDocument();
- }
-
- private PauseSubscriptionResponseDocument createPauseSubscriptionResponseDocument()
- {
- PauseSubscriptionResponseDocument responseDoc =
- PauseSubscriptionResponseDocument.Factory.newInstance();
- responseDoc.addNewPauseSubscriptionResponse();
- return responseDoc;
- }
-
- private ResumeSubscriptionResponseDocument createResumeSubscriptionResponseDocument()
- {
- ResumeSubscriptionResponseDocument responseDoc =
- ResumeSubscriptionResponseDocument.Factory.newInstance();
- responseDoc.addNewResumeSubscriptionResponse();
- return responseDoc;
- }
-
- protected NamespaceVersionHolder getNamespaceSet()
- {
- return NAMESPACE_SET;
- }
-
-}
+/*=============================================================================*
+ * 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.impl;
+
+import org.apache.ws.notification.base.Subscription;
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.faults.PauseFailedFaultException;
+import org.apache.ws.notification.base.faults.ResumeFailedFaultException;
+import org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl;
+import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import org.apache.ws.resource.properties.impl.AbstractResourcePropertiesPortType;
+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;
+
+/**
+ * An implementation of the WS-BaseNotification SubscriptionManager portType.
+ *
+ * @author Ian Springer (ian DOT springer AT hp DOT com)
+ */
+public class SubscriptionManagerPortTypeImpl
+ extends AbstractResourcePropertiesPortType
+ implements SubscriptionManagerPortType
+{
+ private static final WsnNamespaceVersionHolder NAMESPACE_SET = new WsnNamespaceVersionHolderImpl( );
+
+ /**
+ * Creates a new {@link SubscriptionManagerPortTypeImpl} object.
+ *
+ * @param resourceContext DOCUMENT_ME
+ */
+ public SubscriptionManagerPortTypeImpl( ResourceContext resourceContext )
+ {
+ super( resourceContext );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public PauseSubscriptionResponseDocument pauseSubscription( PauseSubscriptionDocument requestDoc )
+ {
+ Subscription subscription = (Subscription) getResource( );
+ try
+ {
+ subscription.pause( );
+ }
+ catch ( Exception e )
+ {
+ throw new PauseFailedFaultException( NAMESPACE_SET,
+ "Pause failed on subscription: " + subscription.getID( ) );
+ }
+
+ return createPauseSubscriptionResponseDocument( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResumeSubscriptionResponseDocument resumeSubscription( ResumeSubscriptionDocument requestDoc )
+ {
+ Subscription subscription = (Subscription) getResource( );
+ try
+ {
+ subscription.resume( );
+ }
+ catch ( Exception e )
+ {
+ throw new ResumeFailedFaultException( NAMESPACE_SET,
+ "Resume failed on subscription: " + subscription.getID( ) );
+ }
+
+ return createResumeSubscriptionResponseDocument( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ protected NamespaceVersionHolder getNamespaceSet( )
+ {
+ return NAMESPACE_SET;
+ }
+
+ private PauseSubscriptionResponseDocument createPauseSubscriptionResponseDocument( )
+ {
+ PauseSubscriptionResponseDocument responseDoc = PauseSubscriptionResponseDocument.Factory.newInstance( );
+ responseDoc.addNewPauseSubscriptionResponse( );
+ return responseDoc;
+ }
+
+ private ResumeSubscriptionResponseDocument createResumeSubscriptionResponseDocument( )
+ {
+ ResumeSubscriptionResponseDocument responseDoc = ResumeSubscriptionResponseDocument.Factory.newInstance( );
+ responseDoc.addNewResumeSubscriptionResponse( );
+ return responseDoc;
+ }
+}
\ No newline at end of file
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Publisher.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Publisher.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Publisher.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Publisher.java Tue Aug 2 09:41:00 2005
@@ -13,29 +13,46 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*=============================================================================*/
-
-
package org.apache.ws.notification.pubsub;
-import javax.xml.soap.SOAPMessage;
import org.apache.ws.pubsub.emitter.EmitterTask;
+import javax.xml.soap.SOAPMessage;
/**
*
* @author Stefan Lischke
*/
-public class Publisher implements org.apache.ws.pubsub.Publisher{
-
- private String m_url;
- public Publisher(String url){
- m_url=url;
- }
-
- public void publish(Object msg, org.apache.ws.notification.topics.Topic t) {
- }
-
- private void publish(SOAPMessage soapMsg) throws Exception{
- EmitterTask et = EmitterTask.createEmitterTask(soapMsg, new java.net.URL(m_url));
- et.run();
- }
-}
+public class Publisher
+ implements org.apache.ws.pubsub.Publisher
+{
+ private String m_url;
+
+ /**
+ * Creates a new {@link Publisher} object.
+ *
+ * @param url DOCUMENT_ME
+ */
+ public Publisher( String url )
+ {
+ m_url = url;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param msg DOCUMENT_ME
+ * @param t DOCUMENT_ME
+ */
+ public void publish( Object msg,
+ org.apache.ws.notification.topics.Topic t )
+ {
+ }
+
+ private void publish( SOAPMessage soapMsg )
+ throws Exception
+ {
+ EmitterTask et = EmitterTask.createEmitterTask( soapMsg,
+ new java.net.URL( m_url ) );
+ et.run( );
+ }
+}
\ No newline at end of file
Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscriber.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscriber.java?rev=227035&r1=227034&r2=227035&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscriber.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/pubsub/Subscriber.java Tue Aug 2 09:41:00 2005
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*=============================================================================*/
-
package org.apache.ws.notification.pubsub;
+
//import org.xmlsoap.schemas.ws.x2003.x03.addressing.EEndpointReference;
import org.apache.axis.AxisProperties;
import org.apache.axis.configuration.EngineConfigurationFactoryDefault;
@@ -36,119 +36,173 @@
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument;
import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.TopicExpressionType;
import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
-
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import java.util.Calendar;
+
/**
*
* @author Stefan Lischke
*/
-public class Subscriber implements NotificationProducer{
+public class Subscriber
+ implements NotificationProducer
+{
+ private static final Log LOG = LogFactory.getLog( Subscriber.class.getName( ) );
+ private EndpointReference epr;
+ private SubscriptionHome sH;
+
+ /** Creates a new instance of Subscriber */
+ public Subscriber( String url,
+ String configfile )
+ {
+ //Axis stuff to enable Addressing HandlerChain
+ AxisProperties.setProperty( EngineConfigurationFactoryDefault.OPTION_CLIENT_CONFIG_FILE,
+ "/org/apache/ws/eventing/client-config.wsdd" );
+ try
+ {
+ //read jndi-config.xml
+ init( configfile );
+
+ //create EPR TODO clean
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e =
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance( );
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI auri =
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI.Factory.newInstance( );
+ auri.setStringValue( url );
+ e.setAddress( auri );
+
+ //wrapper
+ this.epr = new XmlBeansEndpointReference( e );
+
+ //getlocal SubscriptionHome from jndi-config
+ Context initialContext = new InitialContext( );
+ sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
- private static final Log LOG = LogFactory.getLog( Subscriber.class.getName() );
-
- private EndpointReference epr;
- private SubscriptionHome sH;
-
- /** Creates a new instance of Subscriber */
- public Subscriber(String url,String configfile){
- //Axis stuff to enable Addressing HandlerChain
- AxisProperties.setProperty(EngineConfigurationFactoryDefault.OPTION_CLIENT_CONFIG_FILE,"/org/apache/ws/eventing/client-config.wsdd");
- try{
- //read jndi-config.xml
- init(configfile);
-
- //create EPR TODO clean
- org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType e = org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance();
- org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI auri = org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI.Factory.newInstance();
- auri.setStringValue(url);
- e.setAddress(auri);
- //wrapper
- this.epr= new XmlBeansEndpointReference(e);
-
- //getlocal SubscriptionHome from jndi-config
- Context initialContext = new InitialContext( );
- sH = (SubscriptionHome) initialContext.lookup( SubscriptionHome.HOME_LOCATION );
-
- }catch (Exception e){
- e.printStackTrace();
- }
- }
-
- public Object getCurrentMessage(org.apache.ws.pubsub.Filter[] filters) {
- return null;
- }
-
- public org.apache.ws.addressing.EndpointReference getEPR() {
- return this.epr;
- }
-
- public org.apache.ws.pubsub.Subscription subscribe(NotificationConsumer notificationConsumer, SubscriptionEndConsumer subscriptionEndConsumer, TopicFilter tf, XPathFilter xf, Calendar initialTerminationTime, boolean UseNotify) {
- SubscribeDocument sdom = SubscribeDocument.Factory.newInstance();
- SubscribeDocument.Subscribe s = sdom.addNewSubscribe();
- //subscription ends are send to:
- //TODO
-
- //notifications are send to:
- s.setConsumerReference((org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType)((XmlObjectWrapper)notificationConsumer.getEPR()).getXmlObject());
-
- //TODO check Calendar serializing
- s.setInitialTerminationTime(initialTerminationTime);
-
- //TODO multiple filters
- if(tf!=null){
- TopicExpressionType te = s.addNewTopicExpression();
- XmlCursor xc = te.newCursor();
- xc.toNextToken();
- xc.insertNamespace( "tns",tf.getNameSpace());
- te.newCursor().setTextValue((String)tf.getExpression());
- te.setDialect(tf.getURI().toString());
- }
-
- //create Subscription
- //add to local SubscriptionHome
- org.apache.ws.notification.pubsub.Subscription ls = this.sH.create();
- SubscribeResponseDocument.SubscribeResponse sresres=null;
- try{
- //now call
- wsaSOAPConnection sconn = wsaSOAPConnection.newInstance();
- MessageFactory mf = MessageFactory.newInstance();
- SOAPMessage soapm = mf.createMessage();
- //put XMLbean into SOAPBody
- soapm.getSOAPBody().addDocument((org.w3c.dom.Document) sdom.newDomNode());
- SOAPMessage subscribeResponse = sconn.call(soapm, epr.getAddress().toString());
- java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream();
- subscribeResponse.writeTo(os);
- EnvelopeDocument sres = EnvelopeDocument.Factory.parse(new java.io.ByteArrayInputStream(os.toByteArray()));
+ /**
+ * DOCUMENT_ME
+ *
+ * @param filters DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getCurrentMessage( org.apache.ws.pubsub.Filter[] filters )
+ {
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.apache.ws.addressing.EndpointReference getEPR( )
+ {
+ return this.epr;
+ }
- //extract SubscribeResponse from SOAPBody
- /*SubscribeResponseDocument sresdom = SubscribeResponseDocument.Factory.newInstance();
- sresres= sresdom.addNewSubscribeResponse();
- sresres.set(sres.getEnvelope().getBody());
- */
- //TODO handle faults
- SubscribeResponseDocument sresdom = SubscribeResponseDocument.Factory.parse(sres.getEnvelope().getBody().xmlText());
- sresres= sresdom.getSubscribeResponse();
- }catch(Exception e){
- e.printStackTrace();
- }
-
- //set SubscritpionManager
- ls.setSubscriptionManager(sresres);
- ls.setNotificationConsumer(notificationConsumer);
- return ls;
- }
/**
* runs resource discovery.
*
*/
- public void init(String configfile)
- throws Exception
+ public void init( String configfile )
+ throws Exception
+ {
+ LOG.info( this.getClass( ).getName( ) + " : initialize with " + configfile );
+ XmlBeanJndiUtils.initFromInputStream( Thread.currentThread( ).getContextClassLoader( ).getResourceAsStream( configfile ) );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param notificationConsumer DOCUMENT_ME
+ * @param subscriptionEndConsumer DOCUMENT_ME
+ * @param tf DOCUMENT_ME
+ * @param xf DOCUMENT_ME
+ * @param initialTerminationTime DOCUMENT_ME
+ * @param UseNotify DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.apache.ws.pubsub.Subscription subscribe( NotificationConsumer notificationConsumer,
+ SubscriptionEndConsumer subscriptionEndConsumer,
+ TopicFilter tf,
+ XPathFilter xf,
+ Calendar initialTerminationTime,
+ boolean UseNotify )
{
- LOG.info(this.getClass().getName()+" : initialize with "+configfile);
- XmlBeanJndiUtils.initFromInputStream(Thread.currentThread().getContextClassLoader().getResourceAsStream(configfile));
- }
-}
+ SubscribeDocument sdom = SubscribeDocument.Factory.newInstance( );
+ SubscribeDocument.Subscribe s = sdom.addNewSubscribe( );
+
+ //subscription ends are send to:
+ //TODO
+ //notifications are send to:
+ s.setConsumerReference( (org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType) ( (XmlObjectWrapper) notificationConsumer
+ .getEPR( ) )
+ .getXmlObject( ) );
+
+ //TODO check Calendar serializing
+ s.setInitialTerminationTime( initialTerminationTime );
+
+ //TODO multiple filters
+ if ( tf != null )
+ {
+ TopicExpressionType te = s.addNewTopicExpression( );
+ XmlCursor xc = te.newCursor( );
+ xc.toNextToken( );
+ xc.insertNamespace( "tns",
+ tf.getNameSpace( ) );
+ te.newCursor( ).setTextValue( (String) tf.getExpression( ) );
+ te.setDialect( tf.getURI( ).toString( ) );
+ }
+
+ //create Subscription
+ //add to local SubscriptionHome
+ org.apache.ws.notification.pubsub.Subscription ls = this.sH.create( );
+ SubscribeResponseDocument.SubscribeResponse sresres = null;
+ try
+ {
+ //now call
+ wsaSOAPConnection sconn = wsaSOAPConnection.newInstance( );
+ MessageFactory mf = MessageFactory.newInstance( );
+ SOAPMessage soapm = mf.createMessage( );
+
+ //put XMLbean into SOAPBody
+ soapm.getSOAPBody( ).addDocument( (org.w3c.dom.Document) sdom.newDomNode( ) );
+ SOAPMessage subscribeResponse = sconn.call( soapm,
+ epr.getAddress( ).toString( ) );
+ java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream( );
+ subscribeResponse.writeTo( os );
+ EnvelopeDocument sres =
+ EnvelopeDocument.Factory.parse( new java.io.ByteArrayInputStream( os.toByteArray( ) ) );
+
+ //extract SubscribeResponse from SOAPBody
+
+ /*SubscribeResponseDocument sresdom = SubscribeResponseDocument.Factory.newInstance();
+ sresres= sresdom.addNewSubscribeResponse();
+ sresres.set(sres.getEnvelope().getBody());
+ */
+
+ //TODO handle faults
+ SubscribeResponseDocument sresdom =
+ SubscribeResponseDocument.Factory.parse( sres.getEnvelope( ).getBody( ).xmlText( ) );
+ sresres = sresdom.getSubscribeResponse( );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+
+ //set SubscritpionManager
+ ls.setSubscriptionManager( sresres );
+ ls.setNotificationConsumer( notificationConsumer );
+ return ls;
+ }
+}
\ No newline at end of file