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 [4/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/examples/pubsubclient/build.xml
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/examples/pubsubclient/build.xml?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/examples/pubsubclient/build.xml (added)
+++ webservices/muse/branches/1.0/src/examples/pubsubclient/build.xml Fri Jun 2 10:32:46 2006
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+
+<project name="broker_example" default="usage" basedir=".">
+
+ <property environment="env" />
+ <property file="build.properties" />
+
+ <!-- workaround for those IDEs that dont set ant.home as per the ant script -->
+ <property name="ant.home" value="env.ANT_HOME"/>
+<property name="base.dir" value="${basedir}"/>
+ <target name="init">
+
+ <available file="../../webapps/pubscribe" type="dir" property="dist.pubscribe.webapp.dir" value="../../webapps/pubscribe" />
+ <condition property="pubscribe.webapp.dir" value="${dist.pubscribe.webapp.dir}">
+ <isset property="dist.pubscribe.webapp.dir"/>
+ </condition>
+
+ <fail unless="pubscribe.webapp.dir" message="webapp dir ../../webapps/pubscribe does not exist." />
+ <echo>Using webapp dir: ${pubscribe.webapp.dir}</echo>
+
+
+ <mkdir dir="build/classes"/>
+ <copy file="jndi-config.xml" todir="build/classes/"/>
+
+ <path id="pubscribe.classpath.id">
+ <pathelement location="build/classes" />
+ <fileset dir="./lib" includes="*.jar" />
+ <pathelement location="${pubscribe.webapp.dir}/WEB-INF/classes" />
+ <fileset dir="${pubscribe.webapp.dir}/WEB-INF/lib" includes="*.jar" />
+ <pathelement location="${activation.jar}" />
+ <pathelement location="${mail.jar}" />
+ </path>
+ <property name="pubscribe.classpath" refid="pubscribe.classpath.id" />
+
+ </target>
+
+ <target name="build" depends="init">
+ <javac srcdir="." destdir="build/classes" classpathref="pubscribe.classpath.id">
+ <include name="*.java"/>
+ </javac>
+ </target>
+
+ <target name="execute" depends="build">
+ <java classname="PubSubClient" classpathref="pubscribe.classpath.id" fork="true">
+ <arg value="${base.dir}"/>
+ </java>
+ </target>
+
+ <target name="usage">
+ <java classname="org.apache.tools.ant.Main">
+ <arg value="-buildfile" />
+ <arg value="${ant.file}" />
+ <arg value="-projecthelp" />
+ </java>
+ </target>
+
+</project>
Added: webservices/muse/branches/1.0/src/examples/pubsubclient/client-config.wsdd
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/examples/pubsubclient/client-config.wsdd?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/examples/pubsubclient/client-config.wsdd (added)
+++ webservices/muse/branches/1.0/src/examples/pubsubclient/client-config.wsdd Fri Jun 2 10:32:46 2006
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment name="defaultClientConfig"
+ xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+ <globalConfiguration>
+ <requestFlow>
+ <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+ </requestFlow>
+
+ <responseFlow>
+ <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+ </responseFlow>
+ </globalConfiguration>
+
+ <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
+ <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:EndpointReferenceType"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ type="java:org.apache.axis.message.addressing.EndpointReferenceType"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:ReferencePropertiesType"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ type="java:org.apache.axis.message.addressing.ReferencePropertiesType"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:AttributedURI"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ type="java:org.apache.axis.message.addressing.AttributedURI"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:AttributedQName"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ type="java:org.apache.axis.message.addressing.AttributedQName" />
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:ServiceNameType"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ type="java:org.apache.axis.message.addressing.ServiceNameType" />
+
+</deployment>
+
Added: webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wse.xml
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wse.xml?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wse.xml (added)
+++ webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wse.xml Fri Jun 2 10:32:46 2006
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <global>
+
+ <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyClassName</name>
+ <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/eval/simple" type="org.apache.ws.notification.topics.impl.SimpleTopicExpressionEvaluator">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/ContainerTopicExpressionEngine" type="org.apache.ws.notification.topics.impl.TopicExpressionEngineImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </global>
+
+
+
+ <service name="SubscriptionEndPort">
+ <resource name="home" type="org.apache.ws.eventing.pubsub.SubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>baseWebappUrl</name>
+ <!--
+ The baseWebappUrl can contain the following:
+ -the marker $IP_ADDRESS$ in which case we will attempt to determine the IP address at runtime. (Do not use on multi-homed systems)
+ -the marker $HOST_NAME$ in which case we will attempt to determine the host name at runtime
+ -NO Marker in which case whatever value you add will be static and used.
+ -->
+ <value>http://$IP_ADDRESS$:8080/pubscribe</value>
+ </parameter>
+
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.SubscriberService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.pubsub.Subscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/SubscriptionEndPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceIdentifierReferenceParameterName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+
+ <service name="NotificationPort">
+
+ <resourceLink name="home" target="/wsrf/services/SubscriptionEndPort/home" />
+<!--
+ <resource name="home" type="org.apache.ws.eventing.SubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>baseWebappUrl</name>
+ <!--
+ The baseWebappUrl can contain the following:
+ -the marker $IP_ADDRESS$ in which case we will attempt to determine the IP address at runtime. (Do not use on multi-homed systems)
+ -the marker $HOST_NAME$ in which case we will attempt to determine the host name at runtime
+ -NO Marker in which case whatever value you add will be static and used.
+ -->
+ <value>http://$IP_ADDRESS$:8080/pubscribe</value>
+ </parameter>
+
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.eventing.services.subscriber.SubscriberService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.eventing.Subscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/eventing/services/NotificationPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceIdentifierReferenceParameterName</name>
+ <value>{http://schemas.xmlsoap.org/ws/2004/08/eventing}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ -->
+ </service>
+</jndiConfig>
+
Added: webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wsn.xml
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wsn.xml?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wsn.xml (added)
+++ webservices/muse/branches/1.0/src/examples/pubsubclient/jndi-config_wsn.xml Fri Jun 2 10:32:46 2006
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+
+<jndiConfig xmlns="http://www.apache.org/wsfx/wsrf/jndi/config">
+
+ <global>
+
+ <resource name="DefaultParameters" type="org.apache.ws.util.jndi.DefaultParameters">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ <parameter>
+ <name>resourceKeyClassName</name>
+ <value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="timer/ContainerTimer" type="org.apache.ws.util.timer.TimerManagerImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/eval/simple" type="org.apache.ws.notification.topics.impl.SimpleTopicExpressionEvaluator">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ <resource name="topic/ContainerTopicExpressionEngine" type="org.apache.ws.notification.topics.impl.TopicExpressionEngineImpl">
+ <resourceParams>
+ <parameter>
+ <name>factory</name>
+ <value>org.apache.ws.util.jndi.BeanFactory</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+
+ </global>
+
+
+
+ <service name="NotificationPort">
+ <resource name="home" type="org.apache.ws.notification.pubsub.SubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>baseWebappUrl</name>
+ <!--
+ The baseWebappUrl can contain the following:
+ -the marker $IP_ADDRESS$ in which case we will attempt to determine the IP address at runtime. (Do not use on multi-homed systems)
+ -the marker $HOST_NAME$ in which case we will attempt to determine the host name at runtime
+ -NO Marker in which case whatever value you add will be static and used.
+ -->
+ <value>http://$IP_ADDRESS$:8080/pubscribe</value>
+ </parameter>
+
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.notification.base.impl.SubscriberService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.notification.pubsub.Subscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/notification/services/NotificationPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceIdentifierReferenceParameterName</name>
+ <value>{http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+
+ <service name="SubscriptionEndPort">
+ <resource name="home" type="org.apache.ws.notification.pubsub.SubscriptionHome">
+ <resourceParams>
+ <parameter>
+ <name>baseWebappUrl</name>
+ <!--
+ The baseWebappUrl can contain the following:
+ -the marker $IP_ADDRESS$ in which case we will attempt to determine the IP address at runtime. (Do not use on multi-homed systems)
+ -the marker $HOST_NAME$ in which case we will attempt to determine the host name at runtime
+ -NO Marker in which case whatever value you add will be static and used.
+ -->
+ <value>http://$IP_ADDRESS$:8080/pubscribe</value>
+ </parameter>
+
+ <parameter>
+ <name>serviceClassName</name>
+ <value>org.apache.ws.notification.base.impl.SubscriberService</value>
+ </parameter>
+ <parameter>
+ <name>resourceClassName</name>
+ <value>org.apache.ws.notification.pubsub.Subscription</value>
+ </parameter>
+ <parameter>
+ <name>wsdlTargetNamespace</name>
+ <value>http://ws.apache.org/notification/services/NotificationPort</value>
+ </parameter>
+ <parameter>
+ <name>resourceIdentifierReferenceParameterName</name>
+ <value>{http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification}Identifier</value>
+ </parameter>
+ </resourceParams>
+ </resource>
+ </service>
+</jndiConfig>
+
Added: webservices/muse/branches/1.0/src/examples/pubsubclient/topicspace.xml
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/examples/pubsubclient/topicspace.xml?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/examples/pubsubclient/topicspace.xml (added)
+++ webservices/muse/branches/1.0/src/examples/pubsubclient/topicspace.xml Fri Jun 2 10:32:46 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wstop:topicSpace name="TopicSpaceExample1"
+targetNamespace="http://example.org/topicSpace/example1"
+xmlns:tns="http://example.org/topicSpace/example1"
+xmlns:xyz="http://example.org/anotherNamespace"
+xmlns:wstop=
+"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics" >
+
+<wstop:topic name="t1">
+ <wstop:topic name="t2"/>
+ <wstop:topic name="t3" />
+</wstop:topic>
+
+<wstop:topic name="t4">
+ <wstop:topic name="t5"/>
+ <wstop:topic name="t6"/>
+</wstop:topic>
+
+<wstop:topic name="t7">
+ <wstop:topic name="t8"/>
+ <wstop:topic name="t9"/>
+ <wstop:topic name="t10">
+ <wstop:topic name="t11"/>
+ <wstop:topic name="t12"/>
+ </wstop:topic>
+</wstop:topic>
+</wstop:topicSpace>
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/META-INF/services/org.apache.axis.deployment.wsdd.Provider
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/META-INF/services/org.apache.axis.deployment.wsdd.Provider?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/META-INF/services/org.apache.axis.deployment.wsdd.Provider (added)
+++ webservices/muse/branches/1.0/src/java/META-INF/services/org.apache.axis.deployment.wsdd.Provider Fri Jun 2 10:32:46 2006
@@ -0,0 +1 @@
+org.apache.ws.resource.handler.axis.ResourceProviderFactory
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/Soap1_1Constants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/Soap1_1Constants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/Soap1_1Constants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/Soap1_1Constants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,68 @@
+/*=============================================================================*
+ * 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;
+
+import javax.xml.namespace.QName;
+
+/**
+ * SOAP 1.1 constants.
+ */
+public interface Soap1_1Constants
+{
+ /*============================ SOAP 1.1 Namespaces ===========================*/
+
+ /**
+ * Namespace prefix for SOAP 1.1 Envelope schema.
+ */
+ String NSPREFIX_SOAP_ENVELOPE = "soapenv";
+
+ /**
+ * Namespace URI for SOAP 1.1 Envelope schema.
+ */
+ String NSURI_SOAP_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
+
+ /**
+ * Namespace prefix for SOAP 1.1 Encoding schema.
+ */
+ String NSPREFIX_SOAP_ENCODING = "soapenc";
+
+ /**
+ * Namespace URI for SOAP 1.1 Encoding schema.
+ */
+ String NSURI_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
+
+ /*============================== SOAP 1.1 Faults =============================*/
+
+ /**
+ * Client fault.
+ */
+ QName FAULT_CLIENT = new QName( NSURI_SOAP_ENVELOPE, "Client", NSPREFIX_SOAP_ENVELOPE );
+
+ /**
+ * Server fault.
+ */
+ QName FAULT_SERVER = new QName( NSURI_SOAP_ENVELOPE, "Server", NSPREFIX_SOAP_ENVELOPE );
+
+ /**
+ * Must-understand fault.
+ */
+ QName FAULT_MUST_UNDERSTAND = new QName( NSURI_SOAP_ENVELOPE, "MustUnderstand", NSPREFIX_SOAP_ENVELOPE );
+
+ /**
+ * Version-mismatch fault.
+ */
+ QName FAULT_VERSION_MISMATCH = new QName( NSURI_SOAP_ENVELOPE, "VersionMismatch", NSPREFIX_SOAP_ENVELOPE );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/XmlObjectWrapper.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/XmlObjectWrapper.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/XmlObjectWrapper.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/XmlObjectWrapper.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,36 @@
+/*=============================================================================*
+ * 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;
+
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * A wrapper for an {@link XmlObject}.
+ *
+ * This class is used as an abstraction layer for XmlBean versioned types to make it possible to handle multiple
+ * versions of specs in the code base.
+ *
+ * @author Ian Springer (ian DOT springer AT hp DOT com)
+ */
+public interface XmlObjectWrapper
+{
+ /**
+ * Returns the XmlObject which is being wrapped.
+ *
+ * @return XmlObject which is being wrapped
+ */
+ XmlObject getXmlObject( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/EndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/EndpointReference.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/EndpointReference.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/EndpointReference.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,68 @@
+/*=============================================================================*
+ * 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.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface for EndpointReferences
+ *
+ * @author Sal Campana
+ */
+public interface EndpointReference
+{
+ /**
+ * Returns the Address from the EPR as a String.
+ *
+ * @return Address
+ */
+ String getAddress( );
+
+ /**
+ * Returns the PortName associated with the Service in the EPR as a String
+ *
+ * @return Service's Port Name
+ */
+ String getPortName( );
+
+ /**
+ * Returns the PortType QName
+ *
+ * @return PortType QName
+ */
+ QName getPortType( );
+
+ /**
+ * Returns the ReferenceParameters Object.
+ *
+ * @return Object[] The ReferenceParameters
+ */
+ Object[] getReferenceParameters( );
+
+ /**
+ * Returns the ReferenceProperties Object.
+ *
+ * @return Object[] The ReferenceProperties
+ */
+ Object[] getReferenceProperties( );
+
+ /**
+ * Service QName
+ *
+ * @return Service QName
+ */
+ QName getServiceName( );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/XmlBeansEndpointReference.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,440 @@
+/*=============================================================================*
+ * 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.addressing;
+
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.xmlbeans.XmlObject;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedQName;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.ReferencePropertiesType;
+import org.xmlsoap.schemas.ws.x2003.x03.addressing.ServiceNameType;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.ReferenceParametersType;
+import javax.xml.namespace.QName;
+
+/**
+ * This class wraps XmlBean-generated XmlBeansEndpointReference types for use throughout the system.
+ * <p/>
+ * As a new version of the schema is generated, a new constructor should be added to encompass the new version.
+ * <p/>
+ * Note..Use fully qualified class name in constructors for different versions.
+ *
+ * @author Sal Campana
+ */
+public class XmlBeansEndpointReference
+ implements XmlObjectWrapper,
+ EndpointReference
+{
+ private XmlObject m_xmlObjectEPR;
+ private String m_address;
+ private QName m_portTypeQName;
+ private String m_servicePortName;
+ private QName m_serviceQName;
+ private Object[] m_referenceProps;
+ private String m_addressingVersionURI;
+ private Object[] m_referenceParameters;
+ private Object m_resourceId;
+ private QName m_resourceIdRefParamName;
+
+ /**
+ * Constructs an EPR (and the underlying XmlObject representation) given the params.
+ *
+ * @param address - Endpoint Address. Must Not Be Null
+ * @param addressingURI - WS-Addressing URI - Must Not Be Null
+ */
+ public XmlBeansEndpointReference( String address,
+ String addressingURI )
+ {
+ if ( address == null )
+ {
+ throw new IllegalArgumentException( "Address must not be null!" );
+ }
+
+ if ( addressingURI == null )
+ {
+ throw new IllegalArgumentException( "WS-Addressing addresingURI must not be null!" );
+ }
+
+ m_address = address;
+ m_addressingVersionURI = addressingURI;
+ }
+
+ /**
+ * Creates a new {@link XmlBeansEndpointReference} object.
+ *
+ * @param epr org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType XMLBean generated type
+ */
+ public XmlBeansEndpointReference( org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType epr )
+ {
+ m_xmlObjectEPR = epr;
+
+ if ( epr.getAddress( ) != null )
+ {
+ m_address = epr.getAddress( ).getStringValue( );
+ }
+
+ if ( epr.isSetPortType( ) )
+ {
+ m_portTypeQName = epr.getPortType( ).getQNameValue( );
+ }
+
+ if ( epr.isSetServiceName( ) && epr.getServiceName( ).isSetPortName( ) )
+ {
+ m_servicePortName = epr.getServiceName( ).getPortName( );
+ }
+
+ if ( epr.isSetServiceName( ) )
+ {
+ m_serviceQName = epr.getServiceName( ).getQNameValue( );
+ }
+
+ if ( epr.isSetReferenceProperties( ) )
+ {
+ m_referenceProps = XmlBeanUtils.getChildElements( epr.getReferenceProperties( ) );
+ }
+ }
+
+ /**
+ * Creates a new {@link XmlBeansEndpointReference} object.
+ *
+ * @param epr org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType XMLBean generated type
+ */
+ public XmlBeansEndpointReference( org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType epr )
+ {
+ m_xmlObjectEPR = epr;
+ if ( epr.getAddress( ) != null )
+ {
+ m_address = epr.getAddress( ).getStringValue( );
+ }
+
+ if ( epr.isSetPortType( ) )
+ {
+ m_portTypeQName = epr.getPortType( ).getQNameValue( );
+ }
+
+ if ( epr.isSetServiceName( ) && epr.getServiceName( ).isSetPortName( ) )
+ {
+ m_servicePortName = epr.getServiceName( ).getPortName( );
+ }
+
+ if ( epr.isSetServiceName( ) )
+ {
+ m_serviceQName = epr.getServiceName( ).getQNameValue( );
+ }
+
+ if ( epr.isSetReferenceProperties( ) )
+ {
+ m_referenceProps = XmlBeanUtils.getChildElements( epr.getReferenceProperties( ) );
+ }
+
+ if ( epr.isSetReferenceParameters( ) )
+ {
+ m_referenceParameters = XmlBeanUtils.getChildElements( epr.getReferenceParameters( ) );
+ }
+ }
+
+ /**
+ * Returns the Address from the EPR as a String.
+ *
+ * @return Address
+ */
+ public String getAddress( )
+ {
+ return m_address;
+ }
+
+ /**
+ * Returns the PortName associated with the Service in the EPR as a String
+ *
+ * @return Service's Port Name
+ */
+ public String getPortName( )
+ {
+ return m_servicePortName;
+ }
+
+ /**
+ * Returns the PortType QName
+ *
+ * @return PortType QName
+ */
+ public QName getPortType( )
+ {
+ return m_portTypeQName;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param portTypeQName DOCUMENT_ME
+ */
+ public void setPortTypeQName( QName portTypeQName )
+ {
+ m_portTypeQName = portTypeQName;
+ }
+
+ /**
+ * @param referenceParameters XmlObject[] of refernece parameters to be added
+ */
+ public void setReferenceParameters( Object[] referenceParameters )
+ {
+ if ( !( referenceParameters instanceof XmlObject[] ) )
+ {
+ throw new IllegalArgumentException( "Refernece Params are expected to be an XmlObject[]!" );
+ }
+
+ m_referenceParameters = referenceParameters;
+ }
+
+ /**
+ * Returns the ReferenceParameters Object.
+ *
+ * @return Object[] The ReferenceParameters
+ */
+ public Object[] getReferenceParameters( )
+ {
+ return m_referenceParameters;
+ }
+
+ /**
+ * @param referenceProps XmlObject[] of refernece properties to be added
+ */
+ public void setReferenceProperties( Object[] referenceProps )
+ {
+ if ( !( referenceProps instanceof XmlObject[] ) )
+ {
+ throw new IllegalArgumentException( "Refernece Props are expected to be an XmlObject[]!" );
+ }
+
+ m_referenceProps = referenceProps;
+ }
+
+ /**
+ * Returns the ReferenceProperties directly from the underlying XmlBean-generated class. The signature returns
+ * Object to make it generic for other impls.
+ *
+ * @return Object[] containing the Reference Property elements
+ */
+ public Object[] getReferenceProperties( )
+ {
+ return m_referenceProps;
+ }
+
+ /**
+ * Adds the ResourceKey which will be added to the ReferenceProperties
+ *
+ * @param resourceId
+ */
+ public void setResourceIdentifier( Object resourceId )
+ {
+ m_resourceId = resourceId;
+ }
+
+ /**
+ * Adds the ResourceKey which will be added to the ReferenceProperties
+ *
+ * @param name
+ */
+ public void setResourceIdentifierReferenceParameterName( QName name )
+ {
+ m_resourceIdRefParamName = name;
+ }
+
+ /**
+ * Service QName
+ *
+ * @return Service QName
+ */
+ public QName getServiceName( )
+ {
+ return m_serviceQName;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param servicePortName DOCUMENT_ME
+ */
+ public void setServicePortName( String servicePortName )
+ {
+ m_servicePortName = servicePortName;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param serviceQName DOCUMENT_ME
+ */
+ public void setServiceQName( QName serviceQName )
+ {
+ m_serviceQName = serviceQName;
+ }
+
+ /**
+ * The underlying XmlBean-Generated EPR
+ *
+ * @return The generated EPR
+ */
+ public XmlObject getXmlObject( )
+ {
+ XmlObject epr = null;
+
+ if ( m_xmlObjectEPR != null )
+ {
+ epr = m_xmlObjectEPR;
+ }
+
+ else if ( ( m_addressingVersionURI != null ) && ( m_address != null ) )
+ {
+ if ( org.apache.ws.addressing.v2003_03.AddressingConstants.NSURI_ADDRESSING_SCHEMA.equals( m_addressingVersionURI ) )
+ {
+ EndpointReferenceType endpointReferenceType = build2003_03_EPR( );
+
+ m_xmlObjectEPR = endpointReferenceType;
+ epr = endpointReferenceType;
+ }
+ else if ( org.apache.ws.addressing.v2004_08_10.AddressingConstants.NSURI_ADDRESSING_SCHEMA.equals( m_addressingVersionURI ) )
+ {
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType endpointReferenceType =
+ build2004_08_EPR( );
+
+ m_xmlObjectEPR = endpointReferenceType;
+ epr = endpointReferenceType;
+ }
+ }
+
+ return epr;
+ }
+
+ /**
+ * Returns a version-specific XmlBean-Generated EPR
+ *
+ * @param namespace the WS-Addressing namespace for which you would like an EPR returned.
+ *
+ * @return Version-Specific EPR
+ */
+ public XmlObject getXmlObject( String namespace )
+ {
+ XmlObject epr = null;
+
+ if ( ( namespace != null ) && ( m_address != null ) )
+ {
+ if ( org.apache.ws.addressing.v2003_03.AddressingConstants.NSURI_ADDRESSING_SCHEMA.equals( namespace ) )
+ {
+ EndpointReferenceType endpointReferenceType = build2003_03_EPR( );
+ epr = endpointReferenceType;
+ }
+ else if ( org.apache.ws.addressing.v2004_08_10.AddressingConstants.NSURI_ADDRESSING_SCHEMA.equals( namespace ) )
+ {
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType endpointReferenceType =
+ build2004_08_EPR( );
+ epr = endpointReferenceType;
+ }
+ }
+
+ return epr;
+ }
+
+ private void addToProperties( XmlObject propertiesType,
+ Object[] referenceProps )
+ {
+ for ( int i = 0; i < referenceProps.length; i++ )
+ {
+ Object referenceProp = referenceProps[i];
+ XmlBeanUtils.addChildElement( propertiesType, (XmlObject) referenceProp );
+ }
+ }
+
+ private EndpointReferenceType build2003_03_EPR( )
+ {
+ EndpointReferenceType endpointReferenceType = EndpointReferenceType.Factory.newInstance( );
+ AttributedURI attributedURI = endpointReferenceType.addNewAddress( );
+ attributedURI.setStringValue( m_address );
+
+ if ( m_portTypeQName != null )
+ {
+ AttributedQName attributedQName = endpointReferenceType.addNewPortType( );
+ attributedQName.setQNameValue( m_portTypeQName );
+ }
+
+ if ( m_servicePortName != null )
+ {
+ ServiceNameType serviceNameType = endpointReferenceType.addNewServiceName( );
+ serviceNameType.setPortName( m_servicePortName );
+ }
+
+ ReferencePropertiesType refPropsType = endpointReferenceType.addNewReferenceProperties( );
+
+ if ( m_referenceProps != null )
+ {
+ addToProperties( refPropsType, m_referenceProps );
+ }
+
+ if ( m_resourceId != null )
+ {
+ XmlObject resourceIdRefParam = XmlBeanUtils.addChildElement( refPropsType, m_resourceIdRefParamName );
+ XmlBeanUtils.setValue( resourceIdRefParam,
+ m_resourceId.toString( ) );
+ }
+
+ return endpointReferenceType;
+ }
+
+ private org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType build2004_08_EPR( )
+ {
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType endpointReferenceType =
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType.Factory.newInstance( );
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI attributedURI =
+ endpointReferenceType.addNewAddress( );
+ attributedURI.setStringValue( m_address );
+
+ if ( m_portTypeQName != null )
+ {
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedQName attributedQName =
+ endpointReferenceType.addNewPortType( );
+ attributedQName.setQNameValue( m_portTypeQName );
+ }
+
+ if ( m_servicePortName != null )
+ {
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.ServiceNameType serviceNameType =
+ endpointReferenceType.addNewServiceName( );
+ serviceNameType.setPortName( m_servicePortName );
+ }
+
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.ReferencePropertiesType referencePropertiesType =
+ endpointReferenceType.addNewReferenceProperties( );
+ if ( m_referenceProps != null )
+ {
+ addToProperties( referencePropertiesType, m_referenceProps );
+ }
+
+ if ( m_resourceId != null )
+ {
+ XmlObject resourceKey = XmlBeanUtils.addChildElement( referencePropertiesType, m_resourceIdRefParamName );
+ XmlBeanUtils.setValue( resourceKey, ( String.valueOf( m_resourceId ) ) );
+ }
+
+ if ( m_referenceParameters != null )
+ {
+ ReferenceParametersType referenceParametersType = endpointReferenceType.addNewReferenceParameters( );
+ addToProperties( referenceParametersType, m_referenceParameters );
+ }
+
+ return endpointReferenceType;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2003_03/AddressingConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2003_03/AddressingConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2003_03/AddressingConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2003_03/AddressingConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,35 @@
+/*=============================================================================*
+ * 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.addressing.v2003_03;
+
+
+/**
+ * WS-Addressing constants.
+ */
+public interface AddressingConstants
+{
+ /** DOCUMENT_ME */
+ String NSURI_ADDRESSING_SCHEMA = "http://schemas.xmlsoap.org/ws/2003/03/addressing";
+
+ /** DOCUMENT_ME */
+ String NSPREFIX_ADDRESSING_SCHEMA = "wsa03";
+
+ /** DOCUMENT_ME */
+ String TO = "To";
+
+ /** DOCUMENT_ME */
+ String ACTION = "Action";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2004_08_10/AddressingConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2004_08_10/AddressingConstants.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2004_08_10/AddressingConstants.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/addressing/v2004_08_10/AddressingConstants.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,37 @@
+/*=============================================================================*
+ * 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.addressing.v2004_08_10;
+
+
+/**
+ * @author Sal Campana
+ */
+public interface AddressingConstants
+{
+ /** DOCUMENT_ME */
+ String NSURI_ADDRESSING_SCHEMA = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+
+ /**
+ * DOCUMENT_ME
+ */
+ String NSPREFIX_ADDRESSING_SCHEMA = "wsa";
+
+ /** DOCUMENT_ME */
+ String TO = "To";
+
+ /** DOCUMENT_ME */
+ String ACTION = "Action";
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscription.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscription.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscription.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscription.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,221 @@
+/*=============================================================================*
+ * 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.eventing;
+
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.pubsub.NotificationConsumer;
+import org.apache.ws.pubsub.NotificationProducer;
+import org.apache.ws.pubsub.SubscriptionEndConsumer;
+import org.apache.ws.resource.ResourceHome;
+import org.apache.ws.resource.lifetime.ResourceTerminationListener;
+import java.util.Calendar;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public abstract class AbstractSubscription
+ implements org.apache.ws.pubsub.Subscription,
+ org.apache.ws.resource.Resource
+{
+ /** DOCUMENT_ME */
+ protected NotificationConsumer consumer;
+
+ /** DOCUMENT_ME */
+ protected SubscriptionEndConsumer endconsumer;
+
+ /** DOCUMENT_ME */
+ protected String m_id;
+
+ /** DOCUMENT_ME */
+ protected Calendar m_terminationTime;
+
+ /** DOCUMENT_ME */
+ protected Calendar m_creationTime;
+
+ /** DOCUMENT_ME */
+ protected ResourceHome rH;
+
+ /** DOCUMENT_ME */
+ protected boolean m_usenotify;
+
+ /** The EndpointReference for this resource **/
+ protected EndpointReference m_endpointReference;
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public java.util.Calendar getCreationTime( )
+ {
+ return m_creationTime;
+ }
+
+ /**
+ * Sets the EndpointReference associated with this Resource.
+ *
+ * @param epr The EndpointReference for the Resource.
+ */
+ public void setEndpointReference( org.apache.ws.addressing.EndpointReference epr )
+ {
+ m_endpointReference = epr;
+ }
+
+ /**
+ * Returns the EndpointReference associated with this Resource.
+ *
+ * @return The Resource's EndpointReference or null if the EndpointReference has not been set.
+ *
+ * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
+ */
+ public org.apache.ws.addressing.EndpointReference getEndpointReference( )
+ {
+ return m_endpointReference;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public void setEpr( EndpointReference epr )
+ {
+ this.m_endpointReference = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.apache.ws.pubsub.Filter getFilters( )
+ {
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param id DOCUMENT_ME
+ */
+ public void setID( Object id )
+ {
+ this.m_id = (String) id;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getID( )
+ {
+ return this.m_id;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param consumer DOCUMENT_ME
+ */
+ public void setNotificationConsumer( NotificationConsumer consumer )
+ {
+ this.consumer = consumer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public NotificationConsumer getNotificationConsumer( )
+ {
+ return this.consumer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public NotificationProducer getNotificationProducer( )
+ {
+ return null;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param rH DOCUMENT_ME
+ */
+ public void setResourceHome( ResourceHome rH )
+ {
+ this.rH = rH;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param endconsumer DOCUMENT_ME
+ */
+ public void setSubscriptionEndConsumer( SubscriptionEndConsumer endconsumer )
+ {
+ this.endconsumer = endconsumer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public SubscriptionEndConsumer getSubscriptionEndConsumer( )
+ {
+ return this.endconsumer;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public java.util.Calendar getTerminationTime( )
+ {
+ return m_terminationTime;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public boolean getUseNotify( )
+ {
+ return m_usenotify;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param resourceTerminationListener DOCUMENT_ME
+ */
+ public void addTerminationListener( ResourceTerminationListener resourceTerminationListener )
+ {
+ //this is a no op todo Stefan I need to know if you want to leverege this
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscriptionHome.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscriptionHome.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscriptionHome.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/AbstractSubscriptionHome.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,65 @@
+/*=============================================================================*
+ * 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.eventing;
+
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class should not be modified.
+ * <p/>
+ * The class acts as an extension of the AbstractResourceHome which
+ * maintains a reference to the STATIC map needed for accessing resources via JNDI.
+ * <p/>
+ * This ensures the resources will be accessible if serialized via JNDI in certain platforms.
+ */
+abstract class AbstractSubscriptionHome
+ extends AbstractResourceHome
+{
+ /**
+ * The static reference which is maintained and used by the AbstractResourceHome.
+ * <p/>
+ * Do not modify.
+ */
+ private static Map m_resource;
+
+ /**
+ * Do not modify this method.
+ */
+ protected final Map initResourceMap( )
+ throws NamingException
+ {
+ Context initialContext = new InitialContext( );
+ if ( m_resourceIsPersistent )
+ {
+ m_resources = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.SOFT, true );
+ initCachePolicy( initialContext );
+ }
+ else
+ {
+ m_resources = new HashMap( );
+ }
+
+ m_resources = Collections.synchronizedMap( m_resources );
+ return m_resources;
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/EchoConsumer.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/EchoConsumer.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/EchoConsumer.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/EchoConsumer.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,126 @@
+/*=============================================================================*
+ * 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.eventing;
+
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.ws.addressing.*;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public class EchoConsumer
+ implements org.apache.ws.pubsub.NotificationConsumer
+{
+ private EndpointReference epr;
+
+ /**
+ * Creates a new {@link EchoConsumer} object.
+ *
+ * @param epr DOCUMENT_ME
+ *
+ * @throws org.apache.axis.types.URI.MalformedURIException DOCUMENT_ME
+ */
+ public EchoConsumer( String epr )
+ throws org.apache.axis.types.URI.MalformedURIException
+ {
+ 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( epr );
+ e.setAddress( auri );
+
+ //wrapper
+ this.epr = new XmlBeansEndpointReference( e );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public void setEPR( EndpointReference epr )
+ {
+ this.epr = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getEPR( )
+ {
+ return epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param mode DOCUMENT_ME
+ */
+ public void setMode( int mode )
+ {
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public int getMode( )
+ {
+ return 0;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param subscription DOCUMENT_ME
+ * @param status DOCUMENT_ME
+ * @param reason DOCUMENT_ME
+ */
+ public void end( org.apache.ws.pubsub.Subscription subscription,
+ java.net.URI status,
+ String reason )
+ {
+ System.out.println( "end notification" );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param subscription DOCUMENT_ME
+ * @param message DOCUMENT_ME
+ */
+ public void notify( org.apache.ws.pubsub.Subscription subscription,
+ Object message )
+ {
+ try
+ {
+ SOAPEnvelope env = (SOAPEnvelope) message;
+ System.out.println( "--got notification --" );
+ System.out.println( env.toString( ) );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardConsumer.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardConsumer.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardConsumer.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardConsumer.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.eventing;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.addressing.*;
+import org.apache.ws.pubsub.*;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.soap.*;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public class ForwardConsumer
+ implements org.apache.ws.pubsub.NotificationConsumer
+{
+ private static final Log LOG = LogFactory.getLog( ForwardConsumer.class.getName( ) );
+
+ /** DOCUMENT_ME */
+ public EndpointReference epr;
+
+ /**
+ * Creates a new {@link ForwardConsumer} object.
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public ForwardConsumer( EndpointReference epr )
+ {
+ this.epr = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public void setEPR( EndpointReference epr )
+ {
+ this.epr = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getEPR( )
+ {
+ return this.epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param subscription DOCUMENT_ME
+ * @param message DOCUMENT_ME
+ */
+ public void notify( org.apache.ws.pubsub.Subscription subscription,
+ Object message )
+ {
+ LOG.info( "ForwardConsumer :" + this.epr.getAddress( ) );
+ try
+ {
+ //now call
+ wsaSOAPConnection sconn = wsaSOAPConnection.newInstance( );
+ MessageFactory mf = MessageFactory.newInstance( );
+ SOAPMessage soapm = mf.createMessage( );
+
+ //DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ //org.w3c.dom.Document dom = builder.parse(new java.io.ByteArrayInputStream(((String) message).getBytes()));
+ //put Message into SOAPBody
+ if ( subscription.getUseNotify( ) == true )
+ {
+ SOAPElement se =
+ soapm.getSOAPBody( ).addChildElement( "http://schemas.xmlsoap.org/ws/2004/08/eventing", "Notify" );
+ se.addChildElement( (SOAPElement) ( (org.apache.axis.message.SOAPBody) message ).getChildElements( )
+ .next( ) );
+ }
+ else
+ {
+ soapm.getSOAPBody( ).addChildElement( (SOAPElement) ( (org.apache.axis.message.SOAPBody) message ).getChildElements( )
+ .next( ) );
+ }
+
+ sconn.call( soapm, epr );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardEndConsumer.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardEndConsumer.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardEndConsumer.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/ForwardEndConsumer.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,111 @@
+/*=============================================================================*
+ * 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.eventing;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.addressing.*;
+import org.apache.ws.pubsub.*;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.LanguageSpecificStringType;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument.SubscriptionEnd;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.soap.*;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public class ForwardEndConsumer
+ implements org.apache.ws.pubsub.SubscriptionEndConsumer
+{
+ private static final Log LOG = LogFactory.getLog( ForwardEndConsumer.class.getName( ) );
+
+ /** DOCUMENT_ME */
+ public EndpointReference epr;
+
+ /**
+ * Creates a new {@link ForwardEndConsumer} object.
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public ForwardEndConsumer( EndpointReference epr )
+ {
+ this.epr = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param epr DOCUMENT_ME
+ */
+ public void setEPR( EndpointReference epr )
+ {
+ this.epr = epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public EndpointReference getEPR( )
+ {
+ return this.epr;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param subscription DOCUMENT_ME
+ * @param reason DOCUMENT_ME
+ */
+ public void end( org.apache.ws.pubsub.Subscription subscription,
+ String reason )
+ {
+ //TODO maybe unsubscribe myself
+ if ( epr == null )
+ {
+ LOG.info( "SubscriptionEnd without notification" );
+ return;
+ }
+
+ //send SubscriptionEnd Notification
+ SubscriptionEndDocument sedom = SubscriptionEndDocument.Factory.newInstance( );
+ SubscriptionEndDocument.SubscriptionEnd se = sedom.addNewSubscriptionEnd( );
+ LanguageSpecificStringType reasont = se.addNewReason( );
+ reasont.setStringValue( reason );
+ 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) sedom.newDomNode( ) );
+
+ sconn.call( soapm, epr );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/Subscription.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/Subscription.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/Subscription.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/Subscription.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,146 @@
+/*=============================================================================*
+ * 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.eventing;
+
+import org.apache.commons.id.IdentifierUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.pubsub.Filter;
+import org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource;
+import java.util.Calendar;
+
+/**
+ *
+ * @author Stefan Lischke
+ */
+public class Subscription
+ extends AbstractSubscription
+ implements ScheduledResourceTerminationResource
+{
+ private static final Log LOG = LogFactory.getLog( Subscription.class.getName( ) );
+ private String QueryID;
+ private Filter m_filter;
+ private java.net.URI m_delivery;
+
+ /**
+ * Creates a new {@link Subscription} object.
+ *
+ * @param filter DOCUMENT_ME
+ * @param expires DOCUMENT_ME
+ * @param delivery DOCUMENT_ME
+ */
+ public Subscription( Filter filter,
+ Calendar expires,
+ java.net.URI delivery )
+ {
+ m_id = IdentifierUtils.UUID_VERSION_FOUR_GENERATOR.nextIdentifier( ).toString( );
+ m_creationTime = Calendar.getInstance( );
+ m_filter = filter;
+ setTerminationTime( expires );
+ m_delivery = delivery;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Calendar getCurrentTime( )
+ {
+ return Calendar.getInstance( );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ *
+ * @throws Exception DOCUMENT_ME
+ */
+ public Filter getFilter( )
+ throws Exception
+ {
+ // LOG.info("getFilterString : "+this.subdom.getSubscribe().getFilter().newCursor().getTextValue());
+ return this.m_filter;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param q DOCUMENT_ME
+ */
+ public void setQueryID( String q )
+ {
+ this.QueryID = q;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getQueryID( )
+ {
+ return QueryID;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param terminationTime DOCUMENT_ME
+ */
+ public void setTerminationTime( java.util.Calendar terminationTime )
+ {
+ LOG.info( "Remote setTerminationTime " + terminationTime );
+ m_terminationTime = terminationTime;
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void destroy( )
+ {
+ getSubscriptionEndConsumer( ).end( this, "killya" );
+ LOG.info( "destroyed" );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void init( )
+ {
+ LOG.info( "init" );
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void unsubscribe( )
+ {
+ try
+ {
+ this.rH.remove( getID( ) );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+
+ //TODO
+ }
+
+ destroy( );
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/SubscriptionHome.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/SubscriptionHome.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/SubscriptionHome.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/SubscriptionHome.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,289 @@
+/*=============================================================================*
+ * 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.eventing;
+
+import edu.berkeley.cs.db.yfilter.filter.EXfilterBasic;
+import edu.berkeley.cs.db.yfilter.filter.SystemGlobals;
+import edu.berkeley.cs.db.yfilterplus.queryparser.Query;
+import edu.berkeley.cs.db.yfilterplus.queryparser.XPQuery;
+import edu.berkeley.cs.db.yfilterplus.xmltree.XMLTree;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl;
+import org.apache.ws.pubsub.Filter;
+import org.apache.ws.resource.JndiConstants;
+import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.ResourceUnknownException;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.ws.resource.properties.NamespaceVersionHolder;
+import javax.xml.namespace.QName;
+import java.util.Calendar;
+import java.util.Map;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public class SubscriptionHome
+ extends AbstractResourceHome
+{
+ private static final Log LOG = LogFactory.getLog( SubscriptionHome.class.getName( ) );
+
+ /** 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 */
+ public int c = 0;
+
+ // private java.util.HashMap subs;
+ private java.util.HashMap queriesBack;
+ private String[] queries;
+
+ /** DOCUMENT_ME */
+ EXfilterBasic yfilter;
+
+ /** Creates a new instance of ResourceHome */
+ public SubscriptionHome( )
+ {
+ yfilter = new EXfilterBasic( );
+
+ // subs= new java.util.HashMap();
+ queriesBack = new java.util.HashMap( );
+ queries = new String[1000000];
+ LOG.info( "ResourceHome" + this.toString( ) );
+ }
+
+ /**
+ * 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 filter DOCUMENT_ME
+ * @param expires DOCUMENT_ME
+ * @param delivery DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Subscription create( Filter filter,
+ Calendar expires,
+ java.net.URI delivery )
+ {
+ Subscription rs = new Subscription( filter, expires, delivery );
+ rs.setResourceHome( this );
+ String id = (String) rs.getID( );
+
+ //TODO !!!!! woher kommt publisher epr url ??? HACK for tcpmon 12345-8080
+ String subscriptionAddress = "http://localhost:12345/axis/services/SubscriptionManager";
+ EndpointReference subscriptionEPR = getEndpointReference( id );
+ rs.setEpr( subscriptionEPR );
+ addSubscription( rs );
+ return rs;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param message DOCUMENT_ME
+ */
+ public void notify( Object message )
+ {
+ //first check dialect
+ try
+ {
+ org.apache.axis.message.SOAPEnvelope env = (org.apache.axis.message.SOAPEnvelope) message;
+ String xml =
+ org.apache.axis.utils.XMLUtils.ElementToString( env.getBody( ) );
+ LOG.info( "Notify: " );
+ LOG.info( "--" + xml + "--" );
+
+ //copy
+ //first parse and drive YFilter,
+ XMLTree tree = new XMLTree( new java.io.StringReader( xml ) );
+ yfilter.setEventSequence( tree.getEvents( ) );
+ yfilter.startParsing( );
+
+ // print the matched queries //
+ if ( SystemGlobals.hasQueries )
+ {
+ yfilter.printQueryResults( System.out );
+ }
+ else
+ {
+ LOG.info( "no match" );
+ }
+
+ //get matches
+ java.util.Iterator it = yfilter.getMatchedQueries( ).iterator( );
+ while ( it.hasNext( ) )
+ {
+ Integer qid = (Integer) it.next( );
+ String sid = queries[qid.intValue( )];
+ Subscription s = (Subscription) super.find( sid );
+
+ //notify matches
+ LOG.info( "notify : " + sid );
+ s.getNotificationConsumer( ).notify( s,
+ env.getBody( ) );
+ }
+
+ yfilter.clear( );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
+
+ /*
+ public Resource find( ResourceKey key ) throws ResourceException {
+ LOG.info("find "+ key.getValue()+" have "+subs.size());
+ if(subs.containsKey(key.getValue())){
+ RemoteSubscription s = (RemoteSubscription)subs.get(key.getValue());
+ return s;
+ }else
+ throw new ResourceUnknownException();
+ }
+ */
+
+ /**
+ * Removes a resource.
+ *
+ * @throws ResourceUnknownException if no resource exists with the given key
+ * @throws ResourceException if any other error occurs.
+ */
+ public void remove( Object id )
+ throws ResourceException
+ {
+ LOG.info( "removeSubscription : " + id );
+ Query q = (Query) queriesBack.get( id );
+ yfilter.deleteQuery( q,
+ q.getQueryId( ) );
+
+ //TODO remove from Hashmap
+ super.remove( id );
+ }
+
+ /**
+ * 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;
+ }
+
+ /*
+ *-------------------------------------------------------------------
+ */
+ private void addSubscription( Subscription s )
+ {
+ try
+ {
+ c++;
+ Query query = XPQuery.parseQuery( (String) s.getFilter( ).getExpression( ), c );
+ LOG.info( "addSubscription " + s.getID( ) + " query :" + query );
+ yfilter.addQuery( query );
+ add( s );
+ queriesBack.put( s.getID( ),
+ query );
+ queries[c] = (String) s.getID( );
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/client-config.wsdd
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/client-config.wsdd?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/client-config.wsdd (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/client-config.wsdd Fri Jun 2 10:32:46 2006
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment name="defaultClientConfig"
+ xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+
+ <globalConfiguration>
+ <requestFlow>
+ <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+ </requestFlow>
+
+ <responseFlow>
+ <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler"/>
+ </responseFlow>
+ </globalConfiguration>
+
+ <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
+ <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
+ <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:EndpointReferenceType"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ type="java:org.apache.axis.message.addressing.EndpointReferenceType"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:ReferencePropertiesType"
+ serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
+ type="java:org.apache.axis.message.addressing.ReferencePropertiesType"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:AttributedURI"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ type="java:org.apache.axis.message.addressing.AttributedURI"/>
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:AttributedQName"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ type="java:org.apache.axis.message.addressing.AttributedQName" />
+
+ <typeMapping
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ qname="wsa:ServiceNameType"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ type="java:org.apache.axis.message.addressing.ServiceNameType" />
+
+</deployment>
+
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/EventSourcePortType.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/EventSourcePortType.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/EventSourcePortType.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/EventSourcePortType.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,36 @@
+/*=============================================================================*
+ * 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.eventing.porttype;
+
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeDocument;
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscribeResponseDocument;
+import java.rmi.RemoteException;
+
+/**
+ * This is the Port of the Publisher,
+ * it enables Subscriptions.
+ */
+public interface EventSourcePortType
+{
+ /**
+ * Subscribe
+ * @param body
+ * @throws RemoteException
+ * @return
+ */
+ SubscribeResponseDocument subscribe( SubscribeDocument body )
+ throws RemoteException;
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/NotificationPortType.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,36 @@
+/*=============================================================================*
+ * 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.eventing.porttype;
+
+import org.apache.axis.message.SOAPEnvelope;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public interface NotificationPortType
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @param req DOCUMENT_ME
+ * @param resp DOCUMENT_ME
+ */
+ void filter( SOAPEnvelope req,
+ SOAPEnvelope resp );
+}
\ No newline at end of file
Added: webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/SubscriptionEndPortType.java
URL: http://svn.apache.org/viewvc/webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/SubscriptionEndPortType.java?rev=411218&view=auto
==============================================================================
--- webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/SubscriptionEndPortType.java (added)
+++ webservices/muse/branches/1.0/src/java/org/apache/ws/eventing/porttype/SubscriptionEndPortType.java Fri Jun 2 10:32:46 2006
@@ -0,0 +1,38 @@
+/*=============================================================================*
+ * 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.eventing.porttype;
+
+import org.xmlsoap.schemas.ws.x2004.x08.eventing.SubscriptionEndDocument;
+import java.rmi.RemoteException;
+
+/**
+ * DOCUMENT_ME
+ *
+ * @version $Revision: 1.8 $
+ * @author $author$
+ */
+public interface SubscriptionEndPortType
+{
+ /**
+ * DOCUMENT_ME
+ *
+ * @param body DOCUMENT_ME
+ *
+ * @throws RemoteException DOCUMENT_ME
+ */
+ void subscriptionEnd( SubscriptionEndDocument body )
+ throws RemoteException;
+}
\ 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