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 jr...@apache.org on 2005/07/13 01:20:50 UTC
svn commit: r216047 [1/2] - in
/webservices/pubscribe/trunk/src/examples/filesystem: ./ epr/ lib/
requests/ src/ src/java/ src/java/example/ src/java/example/filesystem/
src/java/example/filesystem/backend/ src/java/example/filesystem/callback/
src/jav...
Author: jruzzi
Date: Tue Jul 12 16:20:48 2005
New Revision: 216047
URL: http://svn.apache.org/viewcvs?rev=216047&view=rev
Log:
moved from tutorial
Added:
webservices/pubscribe/trunk/src/examples/filesystem/
webservices/pubscribe/trunk/src/examples/filesystem/build.properties
webservices/pubscribe/trunk/src/examples/filesystem/build.xml
webservices/pubscribe/trunk/src/examples/filesystem/epr/
webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt
webservices/pubscribe/trunk/src/examples/filesystem/lib/
webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar (with props)
webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp
webservices/pubscribe/trunk/src/examples/filesystem/requests/
webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap
webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap
webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap
webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap
webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap
webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap
webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap
webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml
webservices/pubscribe/trunk/src/examples/filesystem/src/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemService.java
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_deploy.wsdd
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/Filesystem_jndi-config.xml
webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/MountDeviceBusyFaultException.java
webservices/pubscribe/trunk/src/examples/filesystem/src/wsdl/
webservices/pubscribe/trunk/src/examples/filesystem/src/wsdl/FileSystem.wsdl
Added: webservices/pubscribe/trunk/src/examples/filesystem/build.properties
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/build.properties?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/build.properties (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/build.properties Tue Jul 12 16:20:48 2005
@@ -0,0 +1,13 @@
+# **** NOTE: This file will not be overwritten during generation ****
+
+endpoint.url = http://localhost:8080/pubscribe/services/filesystem
+
+# Uncomment and modify the below lines if you would like to deploy to a
+# webapp located somewhere other than the default location of
+# ../webapps/hermes (e.g. \${env.CATALINA_HOME}/webapps/pubscribe )
+pubscribe.webapp.dir =${env.CATALINA_HOME}/webapps/pubscribe
+
+# Uncomment and modify the below lines if you require a proxy to connect to external web sites
+#http.proxyHost = proxy.xyz.com
+#http.proxyPort = 8088
+#http.nonProxyHosts = localhost
Added: webservices/pubscribe/trunk/src/examples/filesystem/build.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/build.xml?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/build.xml (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/build.xml Tue Jul 12 16:20:48 2005
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+
+<!-- **** WARNING: This file will be overwritten during generation **** -->
+
+<project name="Filesystem_buildfile" default="usage" basedir=".">
+
+ <property environment="env" />
+ <property file="build.properties" />
+ <property file="../../build.properties" />
+ <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="classes.dir" location="E:\apache_test\filesystem\generated\filesystem\classes" />
+ <property name="jar.dir" location="E:\apache_test\filesystem\generated\.xmlbeans\lib" />
+ <property name="src.dir" location="E:\apache_test\filesystem\generated\filesystem\src\java" />
+ <property name="wsdl.file" location="E:\apache_test\filesystem\generated\filesystem\src\java/../wsdl/FileSystem.wsdl" />
+
+ <target name="init" unless="Filesystem.classpath">
+
+ <fail message="Please set the location of the pubscribe.webapp.dir in build.properties" unless="pubscribe.webapp.dir" />
+ <echo>Using webapp dir: ${pubscribe.webapp.dir}</echo>
+ <path id="Filesystem.classpath.id">
+ <pathelement location="${pubscribe.webapp.dir}/WEB-INF/classes" />
+ <fileset dir="${pubscribe.webapp.dir}/WEB-INF/lib" includes="*.jar" />
+ <fileset dir="${jar.dir}" />
+ <pathelement location="${activation.jar}" />
+ <pathelement location="${mail.jar}" />
+ </path>
+ <property name="Filesystem.classpath" refid="Filesystem.classpath.id" />
+
+ </target>
+
+ <target name="compile"
+ depends="init"
+ description="compile all classes below classes directory">
+ <mkdir dir="${classes.dir}" />
+ <javac srcdir="${src.dir}"
+ destdir="${classes.dir}"
+ classpathref="Filesystem.classpath.id"
+ debug="on"
+ excludes="xmlbeans/**"/>
+ <copy todir="${classes.dir}">
+ <fileset dir="${src.dir}" excludes="**/*.java,**/package.html" />
+ </copy>
+ </target>
+
+ <target name="deploy"
+ depends="init"
+ description="deploys the filesystem service to the ${pubscribe.webapp.dir} webapp">
+
+ <copy file="${wsdl.file}" todir="${pubscribe.webapp.dir}/WEB-INF/classes/wsdl" overwrite="true" verbose="true" />
+ <echo>Deploying filesystem classes to ${pubscribe.webapp.dir}/WEB-INF/classes/...</echo>
+ <copy todir="${pubscribe.webapp.dir}/WEB-INF/classes">
+ <fileset dir="${classes.dir}" />
+ </copy>
+
+ <copy file="${jar.dir}/FileSystem-xbeans.jar" todir="${pubscribe.webapp.dir}/WEB-INF/lib" />
+ <!-- update server-config.wsdd using WsddUpdater -->
+ <taskdef name="wsddUpdater" classname="org.apache.ws.util.platform.axis.tool.WsddUpdater" classpathref="Filesystem.classpath.id" />
+ <property name="config.wsdd" location="${pubscribe.webapp.dir}/WEB-INF/server-config.wsdd" /> <!-- normalize path -->
+ <wsddUpdater configWsdd="${config.wsdd}">
+ <wsddPaths dir="${src.dir}" includes="**/Filesystem_deploy.wsdd" />
+ </wsddUpdater>
+
+ <!-- update jndi-config.wsdd using JndiConfigUpdater -->
+ <taskdef name="jndiUpdater" classname="org.apache.ws.util.jndi.tools.JndiConfigUpdater" classpathref="Filesystem.classpath.id" />
+ <property name="jndi.config" location="${pubscribe.webapp.dir}/WEB-INF/classes/jndi-config.xml" /> <!-- normalize path -->
+ <jndiUpdater jndiConfig="${jndi.config}">
+ <jndiConfigPaths dir="${src.dir}" includes="**/Filesystem_jndi-config.xml" />
+ </jndiUpdater>
+
+ </target>
+
+ <target name="sendRequest"
+ description="sends a request to the filesystem service">
+
+ <ant antfile="soapclient.xml">
+ <property name="url" value="${endpoint.url}" />
+ </ant>
+
+ </target>
+
+ <target name="clean" description="delete the generated source and class files">
+ <delete dir="${classes.dir}" />
+ </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/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/epr/filesystem.txt Tue Jul 12 16:20:48 2005
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
+ <Address>http://localhost:9081/pubscribe/services/Filesystem</Address>
+ <ReferenceProperties>
+ <svr:ResourceIdentifier xmlns:svr="http://ws.apache.org/resource/example/filesystem">/dev/vg00/lvol1</svr:ResourceIdentifier>
+ </ReferenceProperties>
+</EndpointReference>
+
Added: webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar?rev=216047&view=auto
==============================================================================
Binary file - no diff available.
Propchange: webservices/pubscribe/trunk/src/examples/filesystem/lib/FileSystem-xbeans.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/notifproducer.jsp Tue Jul 12 16:20:48 2005
@@ -0,0 +1,61 @@
+
+<%@ page import="example.NotifRequestUtils "%>
+
+<%
+ if(request.getParameter("page") == null)
+ {
+%>
+
+<HTML>
+<head>
+<title>Producer Resource Gui</title>
+</head>
+<BODY>
+<h1>Producer Resource Gui</h1>
+<FORM METHOD=POST ACTION="notifproducer.jsp">
+This form will trigger a ResourcePropertyChangedNotification on a Producer Resource's Simple-Type Resource Property. Modify the Comment Message and click the button to trigger the event.
+<P>Notification Producer EPR URL (a file on a URL which contains the 2004/08 EPR XML): <input type="text" name="serviceurl" value="http://localhost:8080/pubscribe/epr/filesystem.txt" size="100"/></P>
+<P>Simple-Type Property to be Changed (Note: Must be in format usable from QName.valueOf(..) see example in textfield): <input type="text" name="prop" value="{http://ws.apache.org/resource/example/filesystem}Comment" size="100"/></P>
+<P>Value to be Changed: <input type="text" name="msg" value="Quick test!" size="100"/></P>
+<P><INPUT TYPE="SUBMIT" value="Trigger Notification!"/>
+</P>
+<INPUT TYPE="hidden" name="page" value="trigger"/>
+</FORM>
+</BODY>
+</HTML>
+
+<%
+}
+else
+{
+ boolean bool = NotifRequestUtils.invokeSetResourceProperty(request.getParameter( "prop" ), request.getParameter("msg") ,request.getParameter( "serviceurl" ));
+ %>
+ <HTML>
+<head>
+<title>Producer Resource Gui</title>
+</head>
+<BODY>
+<h1>Producer Resource Gui</h1>
+ <%
+ if(!bool)
+ {
+ out.println("Invoke prop change failed!");
+ }
+
+ else
+ {
+ out.println("Invoke prop change was successful!");
+ }
+ %>
+
+ <FORM METHOD=POST ACTION="notifproducer.jsp">
+<P><INPUT TYPE="SUBMIT" value="Return to Form"/>
+</P>
+</FORM>
+</BODY>
+ </HTML>
+<%
+
+}
+%>
+
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/BadGetCurrentMessage.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,17 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:fs="http://ws.apache.org/resource/example/filesystem"
+ xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd">
+
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <wsa:To mustUnderstand="1">http://localhost:8080/pubscribe/services/filesystem</wsa:To>
+ <wsa:Action mustUnderstand="1">http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName</wsa:Action>
+ <fs:ResourceIdentifier mustUnderstand="1">/dev/vg00/lvol1</fs:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <wsnt:GetCurrentMessage>
+ <wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple">fs:foo</wsnt:Topic>
+ </wsnt:GetCurrentMessage>
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/GetCurrentMessage.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,17 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:fs="http://ws.apache.org/resource/example/filesystem"
+ xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd">
+
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <wsa:To mustUnderstand="1">http://localhost:8080/pubscribe/services/filesystem</wsa:To>
+ <wsa:Action mustUnderstand="1">http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName</wsa:Action>
+ <fs:ResourceIdentifier mustUnderstand="1">/dev/vg00/lvol1</fs:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <wsnt:GetCurrentMessage>
+ <wsnt:Topic Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple">fs:MountPointDirectory</wsnt:Topic>
+ </wsnt:GetCurrentMessage>
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/Pause_Subscription.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,15 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+ xmlns:sub="http://ws.apache.org/notification/base/service/SubscriptionManager">
+
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <wsa:To mustUnderstand="1">http://localhost:8080/pubscribe/services/SubscriptionManager</wsa:To>
+ <wsa:Action mustUnderstand="1">http://localhost:8080/pubscribe/services/SubscriptionManager/yourWsdlRequestName</wsa:Action>
+ <sub:ResourceIdentifier mustUnderstand="1">4623a820-7483-11d9-9a53-fe396408008d</sub:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <wsnt:PauseSubscription />
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/Resume_Subscription.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,15 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+ xmlns:sub="http://ws.apache.org/notification/base/service/SubscriptionManager">
+
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <wsa:To mustUnderstand="1">http://localhost:8080/pubscribe/services/SubscriptionManager</wsa:To>
+ <wsa:Action mustUnderstand="1">http://localhost:8080/pubscribe/services/SubscriptionManager/yourWsdlRequestName</wsa:Action>
+ <sub:ResourceIdentifier mustUnderstand="1">4623a820-7483-11d9-9a53-fe396408008d</sub:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <wsnt:ResumeSubscription />
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/SetResourceProperties_updateMountPointProp.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,18 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:fs="http://ws.apache.org/resource/example/filesystem">
+
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <wsa:To mustUnderstand="1">http://localhost:8080/pubscribe/services/filesystem</wsa:To>
+ <wsa:Action mustUnderstand="1">http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName</wsa:Action>
+ <fs:ResourceIdentifier mustUnderstand="1">/dev/vg00/lvol1</fs:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <wsrp:SetResourceProperties xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
+ <wsrp:Update>
+ <fs:MountPointDirectory>/var/tmp/foo</fs:MountPointDirectory>
+ </wsrp:Update>
+ </wsrp:SetResourceProperties>
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/Subscribe_updateMountPointProp.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,29 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:fs="http://ws.apache.org/resource/example/filesystem"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
+ xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
+ >
+
+ <Header>
+ <wsa:To mustUnderstand="1">http://localhost:8080/pubscribe/services/filesystem</wsa:To>
+ <wsa:Action mustUnderstand="1">http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName</wsa:Action>
+ <fs:ResourceIdentifier mustUnderstand="1">/dev/vg00/lvol1</fs:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <wsnt:Subscribe>
+
+ <wsnt:ConsumerReference>
+ <!-- make this filesystem for now... -->
+ <wsa:Address>http://localhost:8080/pubscribe/services/filesystem</wsa:Address>
+ <wsa:ReferenceProperties/>
+ </wsnt:ConsumerReference>
+
+ <wsnt:TopicExpression Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple">fs:MountPointDirectory</wsnt:TopicExpression>
+
+ <wsnt:UseNotify>true</wsnt:UseNotify>
+
+ </wsnt:Subscribe>
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/requests/_TEMPLATE.soap Tue Jul 12 16:20:48 2005
@@ -0,0 +1,14 @@
+<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:fs="http://ws.apache.org/resource/example/filesystem">
+
+ <Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
+ <wsa:To mustUnderstand="1">http://localhost:8080/wsrf/services/filesystem</wsa:To>
+ <wsa:Action mustUnderstand="1">http://ws.apache.org/resource/example/filesystem/FileSystemPortType/yourWsdlRequestName</wsa:Action>
+ <fs:ResourceIdentifier mustUnderstand="1">/dev/vg00/lvol1</fs:ResourceIdentifier>
+ </Header>
+
+ <Body>
+ <!-- yourRequest -->
+ </Body>
+
+</Envelope>
Added: webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/soapclient.xml Tue Jul 12 16:20:48 2005
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+
+<project name="soapClient" default="sendRequest" basedir=".">
+
+ <property environment="env" />
+ <property file="build.properties" />
+ <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"/>
+
+
+ <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>
+
+ <path id="pubscribe.classpath.id">
+ <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="sendRequest"
+ depends="init"
+ description="sends a SOAP request">
+
+ <fail unless="url" message="Please set the url property via -Durl=... when invoking this script." />
+ <fail unless="xml" message="Please set the xml property via -Dxml=... when invoking this script." />
+ <echo>Reading SOAP request from: ${xml} ,,,</echo>
+ <available file="${xml}" property="xml.exists" />
+ <fail unless="xml.exists" message="The specified request XML file ${xml} does not exist." />
+ <available file="${xml}" type="file" property="xml.is.file" />
+ <fail unless="xml.is.file" message="The specified request XML file ${xml} exists but is not a file." />
+
+ <echo>Sending SOAP request to ${url} ...</echo>
+ <echo />
+ <echo>========================== REQUEST ============================</echo>
+ <concat><path><pathelement location="${xml}" /></path></concat>
+ <echo />
+ <echo>========================== RESPONSE ============================</echo>
+ <taskdef name="soapClient" classname="org.apache.ws.util.soap.SoapClientTask" classpath="${pubscribe.classpath}" />
+ <soapClient serviceURL="${url}" requestFile="${xml}" soapAction="${action}" />
+
+ </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/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/NotifRequestUtils.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,158 @@
+package example;
+
+import org.apache.axis.message.addressing.Constants;
+import org.apache.ws.XmlObjectWrapper;
+import org.apache.ws.addressing.EndpointReference;
+import org.apache.ws.addressing.XmlBeansEndpointReference;
+import org.apache.ws.util.XmlBeanUtils;
+import org.apache.ws.util.soap.SoapClient;
+import org.apache.xmlbeans.XmlObject;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResourcePropertiesResponseDocument;
+import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.UpdateType;
+import org.xmlsoap.schemas.soap.envelope.Envelope;
+import org.xmlsoap.schemas.soap.envelope.EnvelopeDocument;
+import org.xmlsoap.schemas.soap.envelope.Header;
+import org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceDocument;
+
+import javax.xml.namespace.QName;
+import java.net.URI;
+import java.net.URL;
+
+
+/**
+ * @author Sal Campana
+ */
+public class NotifRequestUtils
+{
+ public static XmlObject sendRequest(XmlObject requestDoc, String action, EndpointReference epr)
+ {
+ EnvelopeDocument requestEnvelopeDoc = createEnvelope();
+ Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
+ addAddressingHeaders(requestEnvelope.getHeader(), action, epr);
+ XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc);
+ try
+ {
+ URL endpointURL = new URL(epr.getAddress());
+ System.out.println("Sending Request to " + endpointURL.toString());
+ URI actionURI = new URI(action);
+ String response = SoapClient.sendRequest(endpointURL, requestEnvelopeDoc.newInputStream(), actionURI);
+ EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(response);
+ Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
+ XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements(responseEnvelope.getBody());
+ System.out.println("Recieved response from " + endpointURL.toString());
+ if (responseBodyElems.length == 0)
+ {
+ return null;
+ }
+ else
+ {
+ return responseBodyElems[0];
+ }
+
+ }
+ catch (Exception e)
+ {
+ System.out.println("An Exception Occurred!");
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static boolean invokeSetResourceProperty(String prop, String value, String filesystemEPRUrl)
+ {
+ SetResourcePropertiesDocument setResourcePropertiesDocument = SetResourcePropertiesDocument.Factory.newInstance();
+ SetResourcePropertiesDocument.SetResourceProperties setResourceProperties = setResourcePropertiesDocument.addNewSetResourceProperties();
+ UpdateType updateType = UpdateType.Factory.newInstance();
+
+ XmlObject simpleType = XmlBeanUtils.addChildElement(updateType, QName.valueOf(prop));
+ XmlBeanUtils.setValue(simpleType, value);
+ setResourceProperties.setUpdateArray(new UpdateType[]{updateType});
+
+ XmlObject xmlObject = sendRequest(setResourcePropertiesDocument, "http://SetResourceProperties", createEpr(filesystemEPRUrl));
+ if (xmlObject instanceof SetResourcePropertiesResponseDocument.SetResourcePropertiesResponse)
+ {
+ return true;
+ }
+ else
+ {
+ System.out.println("The returned XmlObject from SetResourcePropertiesRequest for Comment: " + xmlObject.toString());
+ return false;
+ }
+ }
+
+ private static EndpointReference createEpr(String filesystemUrl)
+ {
+ XmlBeansEndpointReference epr = null;
+ try
+ {
+ EndpointReferenceDocument eprdoc = (EndpointReferenceDocument) XmlObject.Factory.parse(new URL(filesystemUrl));
+ epr = new XmlBeansEndpointReference(eprdoc.getEndpointReference());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ return epr;
+ }
+
+ private static EnvelopeDocument createEnvelope()
+ {
+ EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
+ Envelope envelope = envelopeDoc.addNewEnvelope();
+ envelope.addNewHeader();
+ envelope.addNewBody();
+ return envelopeDoc;
+ }
+
+ private static void addAddressingHeaders(Header header, String action, EndpointReference epr)
+ {
+ XmlObject eprXBean = ((XmlObjectWrapper) epr).getXmlObject();
+ XmlObject toElem;
+ XmlObject actionElem;
+ if (eprXBean.schemaType().getName().getNamespaceURI().equals(Constants.NS_URI_ADDRESSING_2003_03))
+ {
+ org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2003.x03.addressing.ToDocument.Factory.newInstance();
+ org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI attributedURI = toDoc.addNewTo();
+ attributedURI.setStringValue(epr.getAddress());
+ toElem = toDoc;
+ org.xmlsoap.schemas.ws.x2003.x03.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2003.x03.addressing.ActionDocument.Factory.newInstance();
+ org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI actionType = actionDoc.addNewAction();
+ actionType.setStringValue(action);
+ actionElem = actionDoc;
+ }
+ else
+ {
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument.Factory.newInstance();
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI attributedURI = toDoc.addNewTo();
+ attributedURI.setStringValue(epr.getAddress());
+ toElem = toDoc;
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument actionDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ActionDocument.Factory.newInstance();
+ org.xmlsoap.schemas.ws.x2004.x08.addressing.AttributedURI actionType = actionDoc.addNewAction();
+ actionType.setStringValue(action);
+ actionElem = actionDoc;
+ }
+ XmlBeanUtils.addChildElement(header, toElem);
+ XmlBeanUtils.addChildElement(header, actionElem);
+ XmlBeansEndpointReference newepr = null;
+ if (eprXBean.schemaType().getName().getNamespaceURI().equals(Constants.NS_URI_ADDRESSING_2003_03))
+ {
+ newepr = new XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType) eprXBean);
+ }
+ else
+ {
+ newepr = new XmlBeansEndpointReference((org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType) eprXBean);
+ }
+ if (newepr.getReferenceProperties() != null)
+ {
+ XmlObject[] refPropElems = (XmlObject[]) newepr.getReferenceProperties();
+ for (int i = 0; i < refPropElems.length; i++)
+ {
+ XmlBeanUtils.addChildElement(header, refPropElems[i]);
+ }
+ }
+ }
+
+
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/FileSystem.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,33 @@
+package example.filesystem.backend;
+
+import java.util.List;
+
+/**
+ * @author Sal Campana
+ */
+public interface FileSystem
+{
+ String getDeviceSpecialFile();
+
+ String getMountPoint();
+
+ void setMountPoint(String mountDir);
+
+ String getType();
+
+ int getBackupFrequency();
+
+ void setBackupFrequency(int backupFrequency);
+
+ List getOptions();
+
+ void setOptions(List options);
+
+ String getComment();
+
+ void setComment(String comment);
+
+ int getFsckPassNumber();
+
+ void setFsckPassNumber(int fsckPassNumber);
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/backend/UnixFileSystem.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,87 @@
+package example.filesystem.backend;
+
+import java.util.List;
+import java.util.ArrayList;
+
+
+/**
+ * This is a mock filesystem to act as the backend for the example FileSystemService
+ *
+ * @author Sal Campana
+ */
+public class UnixFileSystem implements FileSystem
+{
+
+ private String m_mountPoint="/usr";
+ private String m_type = "vxfs";
+ private int m_backupFrequency=0;
+ private int m_fsckPassNumber=2;
+ private List m_options;
+ private String m_comment="user files";
+ private String m_deviceSpecialFile = "/dev/vg00/lvol7";
+
+ public UnixFileSystem(String devicePath)
+ {
+ m_deviceSpecialFile = devicePath;
+ m_options = new ArrayList();
+ m_options.add("delaylog");
+ m_options.add("quota");
+ }
+
+ public String getDeviceSpecialFile()
+ {
+ return m_deviceSpecialFile;
+ }
+ public String getMountPoint()
+ {
+ return m_mountPoint;
+ }
+ public void setMountPoint(String mountDir)
+ {
+ m_mountPoint=mountDir;
+ }
+ public String getType()
+ {
+ return m_type;
+ }
+
+ public int getBackupFrequency()
+ {
+ return m_backupFrequency;
+ }
+
+ public void setBackupFrequency(int backupFrequency)
+ {
+ m_backupFrequency = backupFrequency;
+ }
+
+ public List getOptions()
+ {
+ return m_options;
+ }
+
+ public void setOptions(List options)
+ {
+ m_options = options;
+ }
+
+ public String getComment()
+ {
+ return m_comment;
+ }
+
+ public void setComment(String comment)
+ {
+ m_comment = comment;
+ }
+
+ public int getFsckPassNumber()
+ {
+ return m_fsckPassNumber;
+ }
+
+ public void setFsckPassNumber(int fsckPassNumber)
+ {
+ m_fsckPassNumber = fsckPassNumber;
+ }
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,48 @@
+package example.filesystem.callback;
+
+import org.apache.ws.resource.properties.SetResourcePropertyCallback;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.apache.ws.resource.example.filesystem.BackupFrequencyDocument;
+import org.apache.xmlbeans.XmlInt;
+
+import javax.xml.namespace.QName;
+
+import example.filesystem.backend.FileSystem;
+
+/**
+ * A callback for the BackupFrequency resource property.
+ */
+public class BackupFrequencyCallback implements SetResourcePropertyCallback
+{
+ FileSystem m_fileSystem;
+
+ public BackupFrequencyCallback(FileSystem fileSystem)
+ {
+ m_fileSystem = fileSystem;
+ }
+
+ public void deleteProperty(QName propQName) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0
+ }
+
+ public void insertProperty(Object[] prop) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call insert for a prop whose minOccurs == its maxOccurs
+ }
+
+ public void updateProperty(Object[] prop) throws CallbackFailedException
+ {
+ // BackupFrequency prop has cardinality of 1, so passed array will always have exactly one element
+ XmlInt xInt = (XmlInt) prop[0];
+ m_fileSystem.setBackupFrequency(xInt.getIntValue());
+ }
+
+ public ResourceProperty refreshProperty(ResourceProperty prop) throws CallbackFailedException
+ {
+ XmlInt xInt = (XmlInt) prop.get( 0 );
+ xInt.setIntValue( m_fileSystem.getBackupFrequency() );
+ return prop;
+ }
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/CommentCallback.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,46 @@
+package example.filesystem.callback;
+
+import example.filesystem.backend.FileSystem;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.SetResourcePropertyCallback;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.apache.xmlbeans.XmlString;
+
+import javax.xml.namespace.QName;
+
+/**
+ * A callback for the Comment resource property.
+ */
+public class CommentCallback implements SetResourcePropertyCallback
+{
+ FileSystem m_fileSystem;
+
+ public CommentCallback( FileSystem fileSystem )
+ {
+ m_fileSystem = fileSystem;
+ }
+
+ public void deleteProperty( QName propQName ) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0
+ }
+
+ public void insertProperty( Object[] propElems ) throws CallbackFailedException
+ {
+ // Comment prop has cardinality of 1, so passed array will always have exactly one element
+ XmlString xString = (XmlString) propElems[0];
+ m_fileSystem.setComment( xString.getStringValue() );
+ }
+
+ public void updateProperty( Object[] prop ) throws CallbackFailedException
+ {
+ insertProperty( prop );
+ }
+
+ public ResourceProperty refreshProperty( ResourceProperty prop ) throws CallbackFailedException
+ {
+ XmlString xString = (XmlString) prop.get( 0 );
+ xString.setStringValue( m_fileSystem.getComment() );
+ return prop;
+ }
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,49 @@
+package example.filesystem.callback;
+
+import org.apache.ws.resource.properties.SetResourcePropertyCallback;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.apache.ws.resource.example.filesystem.FsckPassNumberDocument;
+import org.apache.xmlbeans.XmlInt;
+
+import javax.xml.namespace.QName;
+
+import example.filesystem.backend.FileSystem;
+
+
+/**
+ * A callback for the FsckPassNumber resource property.
+ */
+public class FsckPassNumberCallback implements SetResourcePropertyCallback
+{
+ FileSystem m_fileSystem;
+
+ public FsckPassNumberCallback(FileSystem fileSystem)
+ {
+ m_fileSystem = fileSystem;
+ }
+
+ public void deleteProperty(QName propQName) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0
+ }
+
+ public void insertProperty(Object[] propElems) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call insert for a prop whose minOccurs == its maxOccurs
+ }
+
+ public void updateProperty(Object[] propElems) throws CallbackFailedException
+ {
+ // FsckPassNumber prop has cardinality of 1, so passed array will always have exactly one element
+ XmlInt xInt = (XmlInt) propElems[0];
+ m_fileSystem.setFsckPassNumber(xInt.getIntValue());
+ }
+
+ public ResourceProperty refreshProperty(ResourceProperty prop) throws CallbackFailedException
+ {
+ XmlInt xInt = (XmlInt) prop.get( 0 );
+ xInt.setIntValue( m_fileSystem.getFsckPassNumber() );
+ return prop;
+ }
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,28 @@
+package example.filesystem.callback;
+
+import org.apache.ws.resource.properties.ResourcePropertyCallback;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+import org.apache.ws.resource.example.filesystem.MountPointDirectoryDocument;
+import org.apache.xmlbeans.XmlString;
+import example.filesystem.backend.FileSystem;
+
+/**
+ * A callback for the MountPoint resource property.
+ */
+public class MountPointCallback implements ResourcePropertyCallback
+{
+ FileSystem m_fileSystem;
+
+ public MountPointCallback(FileSystem fileSystem)
+ {
+ m_fileSystem = fileSystem;
+ }
+
+ public ResourceProperty refreshProperty(ResourceProperty prop) throws CallbackFailedException
+ {
+ XmlString xString = (XmlString) prop.get( 0 );
+ xString.setStringValue( m_fileSystem.getMountPoint() );
+ return prop;
+ }
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,120 @@
+/*=============================================================================*
+ * 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 example.filesystem.callback;
+
+import example.filesystem.backend.FileSystem;
+import org.apache.ws.resource.example.filesystem.OptionsDocument;
+import org.apache.ws.resource.properties.ResourceProperty;
+import org.apache.ws.resource.properties.SetResourcePropertyCallback;
+import org.apache.ws.resource.properties.impl.CallbackFailedException;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * A callback for the Options resource property.
+ */
+public class OptionsCallback
+ implements SetResourcePropertyCallback
+{
+ /**
+ * DOCUMENT_ME
+ */
+ FileSystem m_fileSystem;
+
+ /**
+ * Creates a new {@link OptionsCallback} object.
+ *
+ * @param fileSystem DOCUMENT_ME
+ */
+ public OptionsCallback( FileSystem fileSystem )
+ {
+ m_fileSystem = fileSystem;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param propQName DOCUMENT_ME
+ */
+ public void deleteProperty( QName propQName ) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call delete for a prop whose minOccurs != 0
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ */
+ public void insertProperty( Object[] prop ) throws CallbackFailedException
+ {
+ return; // no need to implement - WSRF will never call insert for a prop whose minOccurs == its maxOccurs
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public ResourceProperty refreshProperty( ResourceProperty prop ) throws CallbackFailedException
+ {
+ Iterator iterator = prop.iterator();
+ while ( iterator.hasNext() )
+ {
+ OptionsDocument.Options o = (OptionsDocument.Options) iterator.next();
+ clearOptionsFromProperty( o );
+
+ //add current options...
+ List options = m_fileSystem.getOptions();
+ for ( int i = 0; i < options.size(); i++ )
+ {
+ o.addOption( options.get( i ).toString() );
+ }
+ }
+
+ return prop;
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param prop DOCUMENT_ME
+ */
+ public void updateProperty( Object[] prop ) throws CallbackFailedException
+ {
+ List backendOptions = m_fileSystem.getOptions();
+ // Options prop has cardinality of 1, so passed array will always have exactly one element
+ OptionsDocument.Options o = (OptionsDocument.Options) prop[0];
+ String[] optionArray = o.getOptionArray();
+ for ( int j = 0; j < optionArray.length; j++ )
+ {
+ backendOptions.add( optionArray[j] );
+ }
+ }
+
+ private void clearOptionsFromProperty( OptionsDocument.Options o )
+ {
+ //remove the options...
+ for ( int i = 0; i < o.sizeOfOptionArray(); i++ )
+ {
+ o.removeOption( i );
+ }
+ }
+}
\ No newline at end of file
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemResource.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,190 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.addressing.EndpointReference;
+
+/**
+ * **** WARNING: This file will be overwritten during generation ****
+ *
+ * An abstract Filesystem WS-Resource.
+ * <p/>
+ * NOTE: This class is generated and is NOT meant to be modified.
+ */
+public abstract class AbstractFilesystemResource implements org.apache.ws.resource.lifetime.ScheduledResourceTerminationResource, org.apache.ws.resource.PropertiesResource, org.apache.ws.notification.base.NotificationProducerResource {
+
+ /**
+ * The resource ID of the instance.
+ */
+ protected String m_id;
+
+ /** The EndpointReference for this resource **/
+ protected EndpointReference m_endpointReference;
+
+ /**
+ * The set of properties associated with this resource.
+ */
+ protected org.apache.ws.resource.properties.ResourcePropertySet m_propSet;
+
+
+ /**
+ * A list of termination listeners to be notified when the resource is terminated.
+ */
+ private java.util.List m_terminationListeners = new java.util.ArrayList();
+
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param id DOCUMENT_ME
+ */
+ public void setID( Object id )
+ {
+ if ( m_id != null )
+ {
+ throw new IllegalStateException( "This resource's ID has already been set." );
+ }
+
+ try
+ {
+ m_id = (String) id;
+ }
+ catch ( ClassCastException cce )
+ {
+ throw new IllegalArgumentException( "Specified ID is not a String." );
+ }
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param listener DOCUMENT_ME
+ */
+ public void addTerminationListener( org.apache.ws.resource.lifetime.ResourceTerminationListener listener)
+ {
+ m_terminationListeners.add(listener);
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public Object getID()
+ {
+ return m_id;
+ }
+
+ public void destroy()
+ {
+ org.apache.ws.resource.lifetime.ResourceTerminationEvent rte = new org.apache.ws.resource.lifetime.impl.ResourceTerminationEventImpl(getID(),"Resource Destroyed");
+ for (int i = 0; i < m_terminationListeners.size(); i++)
+ {
+ org.apache.ws.resource.lifetime.ResourceTerminationListener resourceTerminationEventListener = (org.apache.ws.resource.lifetime.ResourceTerminationListener) m_terminationListeners.get(i);
+ resourceTerminationEventListener.terminationOccurred(rte);
+ }
+ return;
+ }
+
+ public void init()
+ {
+
+ org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument propsDoc = org.apache.ws.resource.example.filesystem.FileSystemPropertiesDocument.Factory.newInstance();
+ m_propSet = new org.apache.ws.resource.properties.impl.XmlBeansResourcePropertySet( propsDoc );
+
+ // initialize wsrl:CurrentTime property
+ org.apache.ws.resource.properties.ResourceProperty prop = m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME );
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument currTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.CurrentTimeDocument.Factory.newInstance();
+ currTime.setCurrentTime( java.util.Calendar.getInstance() );
+ prop.add( currTime );
+ prop.setCallback( new org.apache.ws.resource.lifetime.callback.CurrentTimeCallback() );
+
+ // initialize wsrl:TerminationTime property
+ prop = m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME );
+ org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument termTime = org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.TerminationTimeDocument.Factory.newInstance();
+ termTime.setNilTerminationTime();
+ prop.add( termTime );
+
+
+
+
+ }
+
+ /**
+ * 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 EndpointReference getEndpointReference()
+ {
+ return m_endpointReference;
+ }
+
+ /**
+ * Sets the EndpointReference associated with this Resource.
+ *
+ * @param epr The Resource's EndpointReference.
+ *
+ * Note: It is the responsibility of the Resource creator to set the EndpointReference (i.e. ResourceHome impl)
+ */
+ public void setEndpointReference(EndpointReference epr)
+ {
+ m_endpointReference = epr;
+ }
+
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param time DOCUMENT_ME
+ */
+ public void setTerminationTime( java.util.Calendar time )
+ {
+ org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.setDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) getResourcePropertySet().get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ),
+ time );
+ }
+
+ /**
+ * Returns the current time from the prop set.
+ *
+ * @return java.util.Calendar
+ */
+ public java.util.Calendar getCurrentTime()
+ {
+ return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME ) );
+ }
+
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public java.util.Calendar getTerminationTime()
+ {
+ return org.apache.ws.resource.properties.XmlBeansResourcePropertyUtils.getDateTimePropertyValue( (org.apache.ws.resource.properties.impl.XmlBeansResourceProperty) m_propSet.get( org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME ) );
+ }
+ /**
+ * @see org.apache.ws.resource.PropertiesResource#setResourcePropertySet(org.apache.ws.resource.properties.ResourcePropertySet)
+ */
+ public void setResourcePropertySet( org.apache.ws.resource.properties.ResourcePropertySet propSet )
+ {
+ m_propSet = propSet;
+ }
+
+ /**
+ * @see org.apache.ws.resource.PropertiesResource#getResourcePropertySet()
+ */
+ public org.apache.ws.resource.properties.ResourcePropertySet getResourcePropertySet()
+ {
+ return m_propSet;
+ }
+ org.apache.ws.notification.topics.TopicSpaceSet m_topicSpaceSet = new org.apache.ws.notification.topics.impl.TopicSpaceSetImpl(true);
+
+ public org.apache.ws.notification.topics.TopicSpaceSet getTopicSpaceSet()
+ {
+ return m_topicSpaceSet;
+ }
+
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,184 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.handler.SoapMethodNameMap;
+import org.apache.ws.resource.handler.WsrfService;
+import org.apache.ws.resource.AbstractPortType;
+import org.apache.ws.resource.handler.ServiceSoapMethodNameMap;
+import javax.xml.namespace.QName;
+
+/**
+ * **** WARNING: This file will be overwritten during generation ****
+ *
+ * This class should be generated on every "generation" against the WSDL.
+ * This will ensure it is always up-to-date with the WSDL.
+ *
+ * NOTE: This class is generated and is NOT meant to be modified.
+ */
+public abstract class AbstractFilesystemService extends AbstractPortType
+ implements org.apache.ws.resource.handler.WsrfService, org.apache.ws.resource.properties.v2004_06.porttype.QueryResourcePropertiesPortType, org.apache.ws.resource.properties.v2004_06.porttype.SetResourcePropertiesPortType, org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePropertiesPortType, org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminationPortType, org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType, org.apache.ws.notification.base.v2004_06.porttype.NotificationProducerPortType, org.apache.ws.resource.lifetime.v2004_06.porttype.ImmediateResourceTerminationPortType {
+
+ public static final String TARGET_NSURI = "http://ws.apache.org/resource/example/filesystem";
+ public static final String TARGET_NSPREFIX = "filesystem";
+
+ /**
+ * DOCUMENT_ME
+ */
+ private ServiceSoapMethodNameMap m_methodNameMap;
+
+ /**
+ * DOCUMENT_ME
+ */
+ private boolean m_isInitialized;
+
+ public AbstractFilesystemService( ResourceContext resourceContext )
+ {
+ super(resourceContext);
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestQname DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public String getMethodName( QName requestQname )
+ {
+ if ( !m_isInitialized )
+ {
+ init( );
+ }
+
+ return m_methodNameMap.getMethodName( requestQname );
+ }
+
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public final SoapMethodNameMap getMethodNameMap( )
+ {
+ return m_methodNameMap;
+ }
+
+ /**
+ * DOCUMENT_ME
+ */
+ public void init( )
+ {
+ m_methodNameMap = new ServiceSoapMethodNameMap( getResourceContext( ) );
+ m_methodNameMap.addMapping( javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}Unmount") , "Unmount" );
+ m_methodNameMap.addMapping( javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}Mount") , "Mount" );
+ 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.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesResponseDocument queryResourceProperties( org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesDocument requestDoc )
+ {
+ return new org.apache.ws.resource.properties.v2004_06.porttype.impl.QueryResourcePropertiesPortTypeImpl( getResourceContext( ) ).queryResourceProperties( 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.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.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.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeResponseDocument subscribe( org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.SubscribeDocument requestDoc )
+ {
+ return new org.apache.ws.notification.base.v2004_06.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).subscribe( requestDoc );
+ }
+
+ /**
+ * DOCUMENT_ME
+ *
+ * @param requestDoc DOCUMENT_ME
+ *
+ * @return DOCUMENT_ME
+ */
+ public org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageResponseDocument getCurrentMessage( org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.GetCurrentMessageDocument requestDoc )
+ {
+ return new org.apache.ws.notification.base.v2004_06.porttype.impl.NotificationProducerPortTypeImpl( getResourceContext( ) ).getCurrentMessage( 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 );
+ }
+
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemCustomOperationsPortType.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,18 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+/**
+ * **** WARNING: This file will be overwritten during generation ****
+ *
+ * Custom operations portType.
+ *
+ * NOTE: This class is generated and is NOT meant to be modified.
+ *
+ */
+public interface FilesystemCustomOperationsPortType
+{
+
+ public org.apache.ws.resource.example.filesystem.UnmountResponseDocument Unmount( org.apache.ws.resource.example.filesystem.UnmountDocument requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException ;
+ public org.apache.ws.resource.example.filesystem.MountResponseDocument Mount( org.apache.ws.resource.example.filesystem.MountDocument requestDoc ) throws org.apache.ws.resource.example.filesystem.MountDeviceBusyFaultException ;
+
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,116 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+import org.apache.ws.resource.Resource;
+import org.apache.ws.resource.ResourceContext;
+import org.apache.ws.resource.ResourceContextException;
+import org.apache.ws.resource.ResourceException;
+import org.apache.ws.resource.ResourceKey;
+import org.apache.ws.resource.ResourceUnknownException;
+import org.apache.ws.resource.impl.AbstractResourceHome;
+import org.apache.ws.addressing.EndpointReference;
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+
+/**
+ * **** NOTE: This file will not be overwritten during generation ****
+ *
+ * Home for Filesystem WS-Resources.
+ */
+public class FilesystemHome
+ extends AbstractResourceHome
+ implements Serializable
+{
+
+ /** The service endpoint name as registered with the SOAP Platform. This is useful for building EPR's. **/
+ public static final QName SERVICE_NAME = javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}filesystem");
+
+ /** The management PortType associated with this resource. This is useful for building EPR's.**/
+ public static final QName PORT_TYPE = javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}FileSystemPortType");
+
+ /** The WSDL Port name associated with the resource. This is useful for building EPR's. **/
+ public static final String PORT_NAME = "filesystem";
+
+ /** The name of the resource key for this resource. **/
+ public static final QName RESOURCE_KEY_NAME = javax.xml.namespace.QName.valueOf("{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier");
+
+ /**
+ * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+ */
+ public static final org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl();
+ /** A constant for the JNDI Lookup name for this home. **/
+ public static final String HOME_LOCATION =
+ org.apache.ws.resource.JndiConstants.CONTEXT_NAME_SERVICES + "/" + SERVICE_NAME.getLocalPart() + "/" + org.apache.ws.resource.JndiConstants.ATOMIC_NAME_HOME;
+
+ /**
+ *
+ * @param resourceContext
+ *
+ * @return A Resource
+ *
+ * @throws ResourceException
+ * @throws ResourceContextException
+ * @throws ResourceUnknownException
+ */
+ public Resource getInstance( ResourceContext resourceContext )
+ throws ResourceException,
+ ResourceContextException,
+ ResourceUnknownException
+ {
+ ResourceKey key = resourceContext.getResourceKey();
+ FilesystemResource resource = null;
+ try
+ {
+ resource = (FilesystemResource)find( key );
+ }
+ catch ( ResourceException re )
+ {
+ Object id = key.getValue();
+ /**
+ * Determine if the passed-in key is, in fact, something we expect.
+ */
+ if ( id.equals( "/dev/vg00/lvol1" ) || id.equals( "/dev/vg00/lvol2" ) )
+ {
+ try
+ {
+ resource = (FilesystemResource)createInstance( key);
+ EndpointReference epr = getEndpointReference(resourceContext.getBaseURL( ) + "/" + getServiceName().getLocalPart() , key, SPEC_NAMESPACE_SET.getAddressingNamespace());
+ resource.setEndpointReference(epr);
+ }
+ catch ( Exception e )
+ {
+ throw new ResourceException( e );
+ }
+ add( key, resource );
+ }
+ else
+ {
+ throw new ResourceUnknownException( id,
+ resourceContext.getServiceName() );
+ }
+ }
+ return resource;
+ }
+
+ public QName getServiceName()
+ {
+ return SERVICE_NAME;
+ }
+
+ public QName getPortType()
+ {
+ return PORT_TYPE;
+ }
+
+ public String getServicePortName()
+ {
+ return PORT_NAME;
+ }
+
+ public QName getResourceKeyNameQName()
+ {
+ return RESOURCE_KEY_NAME;
+ }
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemPropertyQNames.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,41 @@
+package org.apache.ws.resource.example.filesystem;
+
+import javax.xml.namespace.QName;
+
+/**
+ * **** WARNING: This file will be overwritten during generation ****
+ *
+ * QNames of the resource properties defined by Filesystem WSDL.
+ * <p/>
+ * NOTE: This class is generated and is NOT meant to be modified.
+ *
+ */
+public interface FilesystemPropertyQNames
+{
+
+ QName TYPE =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "Type", "tns");
+ QName OPTIONS =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "Options", "tns");
+ QName DEVICESPECIALFILE =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "DeviceSpecialFile", "tns");
+ QName TOPICEXPRESSIONDIALECTS =
+ new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "TopicExpressionDialects", "wsnt");
+ QName COMMENT =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "Comment", "tns");
+ QName TERMINATIONTIME =
+ new QName( "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "TerminationTime", "wsrl");
+ QName MOUNTPOINTDIRECTORY =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "MountPointDirectory", "tns");
+ QName FSCKPASSNUMBER =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "FsckPassNumber", "tns");
+ QName FIXEDTOPICSET =
+ new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "FixedTopicSet", "wsnt");
+ QName CURRENTTIME =
+ new QName( "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd", "CurrentTime", "wsrl");
+ QName BACKUPFREQUENCY =
+ new QName( "http://ws.apache.org/resource/example/filesystem", "BackupFrequency", "tns");
+ QName TOPIC =
+ new QName( "http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd", "Topic", "wsnt");
+
+}
Added: webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=216047&view=auto
==============================================================================
--- webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java (added)
+++ webservices/pubscribe/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java Tue Jul 12 16:20:48 2005
@@ -0,0 +1,154 @@
+
+package org.apache.ws.resource.example.filesystem;
+
+/**
+ * **** NOTE: This file will not be overwritten during generation ****
+ *
+ * A Filesystem WS-Resource.
+ * <p/>
+ * NOTE: This class is generated but IS meant to be modified.
+ */
+public class FilesystemResource extends AbstractFilesystemResource
+
+{
+
+ /**
+ * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+ */
+ public static final org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl();
+
+ /**
+ * Initializes this resource's state (properties, etc.).
+ */
+ public void init()
+ {
+
+ super.init();
+
+ /**
+ * The ResourcePropertySet which contains all the defined ResourceProperties
+ */
+ org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet();
+ org.apache.ws.resource.properties.ResourceProperty resourceProperty = null;
+
+
+
+ /*
+ * This is where you should associate the backend instance with
+ * the resource instance for a given id.
+ */
+ example.filesystem.backend.FileSystem m_fileSystem = new example.filesystem.backend.UnixFileSystem( m_id );
+
+ try{
+ /*
+ * Initialize each of our properties by calling resourceProperty.add(propElem) and/or resourceProperty.setCallback(callback)...
+ */
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.DEVICESPECIALFILE );
+ DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
+ deviceDocXBean.setDeviceSpecialFile( m_fileSystem.getDeviceSpecialFile() );
+ resourceProperty.add( deviceDocXBean );
+
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.TYPE );
+ TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
+ typeDocXBean.setType( m_fileSystem.getType() );
+ resourceProperty.add( typeDocXBean );
+
+ BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
+ backupDocXBean.setBackupFrequency( m_fileSystem.getBackupFrequency() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.BACKUPFREQUENCY );
+ resourceProperty.add( backupDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.BackupFrequencyCallback( m_fileSystem ) );
+
+ CommentDocument commentDocXBean = CommentDocument.Factory.newInstance();
+ commentDocXBean.setComment( m_fileSystem.getComment() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.COMMENT );
+ resourceProperty.add( commentDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.CommentCallback( m_fileSystem ) );
+
+ FsckPassNumberDocument fsckDocXBean = FsckPassNumberDocument.Factory.newInstance();
+ fsckDocXBean.setFsckPassNumber( m_fileSystem.getFsckPassNumber() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.FSCKPASSNUMBER );
+ resourceProperty.add( fsckDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.FsckPassNumberCallback( m_fileSystem ) );
+
+ MountPointDirectoryDocument mountPointDocXBean = MountPointDirectoryDocument.Factory.newInstance();
+ mountPointDocXBean.setMountPointDirectory( m_fileSystem.getMountPoint() );
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.MOUNTPOINTDIRECTORY );
+ resourceProperty.add( mountPointDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.MountPointCallback( m_fileSystem ) );
+
+ OptionsDocument optionsDocXBean =
+ OptionsDocument.Factory.newInstance();
+ org.apache.ws.resource.example.filesystem.OptionsDocument.Options options =
+ optionsDocXBean.addNewOptions();
+ java.util.List backendOptions =
+ m_fileSystem.getOptions();
+ for ( int i = 0; i < backendOptions.size(); i++ )
+ {
+ options.addOption( (String) backendOptions.get( i ) );
+ }
+
+ resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.OPTIONS );
+ resourceProperty.add( optionsDocXBean );
+ resourceProperty.setCallback( new example.filesystem.callback.OptionsCallback( m_fileSystem ) );
+ }
+ catch (Exception e)
+ {
+ throw new javax.xml.rpc.JAXRPCException("There was a problem in initializing your resource properties. Please check your init() method. Cause: " + e.getLocalizedMessage());
+ }
+ // Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}TerminationTime is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd}CurrentTime is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}FixedTopicSet is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}Topic is implemented by the framework.
+ // Resource Property {http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd}TopicExpressionDialects is implemented by the framework.
+
+
+
+ /**
+ * This method enables the ResourceTermination Topic for notifications
+ * about this resource's termination. If you would not like this
+ * behaviour either comment or remove the line of code.
+ */
+ try
+ {
+ org.apache.ws.notification.topics.util.TopicUtils.addResourceTerminationTopic( getTopicSpaceSet(), this, SPEC_NAMESPACE_SET );
+ }
+ catch (Exception e)
+ {
+ throw new javax.xml.rpc.JAXRPCException("Unable to init the ResourceTermination topic. Cause: " + e.getLocalizedMessage(), e);
+ }
+ /**
+ * This method call will make all resource properties be exposed
+ * as Topics. If you would like to change that behaviour you can
+ * call TopicUtils.addResourcePropertyValueChangeTopic for each
+ * Topic you'd like to expose property change notifications for.
+ */
+ try
+ {
+ org.apache.ws.notification.topics.util.TopicUtils.addResourcePropertyValueChangeTopics( getResourcePropertySet(), getTopicSpaceSet() );
+ }
+ catch (Exception e)
+ {
+ throw new javax.xml.rpc.JAXRPCException("Unable to init the ResourceProperty Changed topics. Cause: " + e.getLocalizedMessage(), e);
+ }
+
+ /**
+ * Initializes the Topic, TopicExpressionDialects and FixedTopicSet resource properties
+ *
+ * </br>
+ * <strong>NOTE this MUST be called last in the Resource.init() method to ensure all topics get registered</strong>
+ * </br>
+ * FixedTopicSet will be set based on the value returned from the {@see TopicSpaceSet#isFixed()} method.
+ * </br>
+ * Topic will have all root topics in the TopicSpaceSet, set to Simple dialect AND all child topics set ot
+ * Concrete dialect.
+ * </br>
+ *
+ * TopicExpressionDialects will be set to the engine's known Topic Dialects acquired from the TopicExpressionEngine
+ *
+ * @param topicSpaceSet
+ * @param propSet
+ */
+ org.apache.ws.notification.topics.util.TopicUtils.initNotificationProducerProperties(getTopicSpaceSet() , getResourcePropertySet());
+ }
+}