ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r326191 - in /webservices/wsrf/trunk/src: examples/filesystem/src/java/example/filesystem/callback/ examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ site/content/xdocs/tutorial/
Date Tue, 18 Oct 2005 18:19:43 GMT
Author: ips
Date: Tue Oct 18 11:19:38 2005
New Revision: 326191

URL: http://svn.apache.org/viewcvs?rev=326191&view=rev
Log:
made mountpoint prop callback implement SetCallback interface; set DeviceSpecialFile and Type
props to read-only in Filesystem resource init

Modified:
    webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
    webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java?rev=326191&r1=326190&r2=326191&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/BackupFrequencyCallback.java
Tue Oct 18 11:19:38 2005
@@ -24,17 +24,17 @@
 
     public void deleteProperty(QName propQName) throws CallbackFailedException
     {
-        return; // no need to implement - Apollo will never call delete for a prop whose
minOccurs != 0
+        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 - Apollo will never call insert for a prop whose
minOccurs == its maxOccurs
+        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
+        // BackupFrequency prop has cardinality of 1..1, so passed array will always have
exactly one element
         XmlInt xInt = (XmlInt) prop[0];
         m_fileSystem.setBackupFrequency(xInt.getIntValue());
     }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java?rev=326191&r1=326190&r2=326191&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/FsckPassNumberCallback.java
Tue Oct 18 11:19:38 2005
@@ -10,7 +10,6 @@
 
 import example.filesystem.backend.FileSystem;
 
-
 /**
  * A callback for the FsckPassNumber resource property.
  */
@@ -25,12 +24,12 @@
 
     public void deleteProperty(QName propQName) throws CallbackFailedException
     {
-        return; // no need to implement - Apollo will never call delete for a prop whose
minOccurs != 0
+        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 - Apollo will never call insert for a prop whose
minOccurs == its maxOccurs
+        return; // no need to implement - WSRF will never call insert for a prop whose minOccurs
== its maxOccurs
     }
 
     public void updateProperty(Object[] propElems) throws CallbackFailedException
@@ -46,4 +45,5 @@
         xInt.setIntValue( m_fileSystem.getFsckPassNumber() );
         return prop;
     }
+
 }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java?rev=326191&r1=326190&r2=326191&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/MountPointCallback.java
Tue Oct 18 11:19:38 2005
@@ -1,22 +1,41 @@
 package example.filesystem.callback;
 
-import org.apache.ws.resource.properties.ResourcePropertyCallback;
+import example.filesystem.backend.FileSystem;
+import org.apache.ws.resource.example.filesystem.MountPointDirectoryDocument;
 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.ws.resource.example.filesystem.MountPointDirectoryDocument;
 import org.apache.xmlbeans.XmlString;
-import example.filesystem.backend.FileSystem;
+
+import javax.xml.namespace.QName;
 
 /**
- * A callback for the MountPoint resource property.
+ * A callback for the MountPointDirectory resource property.
  */
-public class MountPointCallback  implements ResourcePropertyCallback
+public class MountPointCallback implements SetResourcePropertyCallback
 {
     FileSystem m_fileSystem;
 
     public MountPointCallback(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
+    {
+        // MountPointDirectory prop has cardinality of 1..1, so WSRF will ensure that the
passed array will always have exactly one element
+        XmlString xString = (XmlString) propElems[0];
+        m_fileSystem.setMountPoint( xString.getStringValue() );
     }
 
     public ResourceProperty refreshProperty(ResourceProperty prop)  throws CallbackFailedException

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java?rev=326191&r1=326190&r2=326191&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/example/filesystem/callback/OptionsCallback.java
Tue Oct 18 11:19:38 2005
@@ -53,7 +53,7 @@
      */
     public void deleteProperty( QName propQName )  throws CallbackFailedException
     {
-        return; // no need to implement - Apollo will never call delete for a prop whose
minOccurs != 0
+        return; // no need to implement - WSRF will never call delete for a prop whose minOccurs
!= 0
     }
 
     /**
@@ -63,7 +63,24 @@
      */
     public void insertProperty( Object[] prop )  throws CallbackFailedException
     {
-        return; // no need to implement - Apollo will never call insert for a prop whose
minOccurs == its maxOccurs
+        return; // no need to implement - WSRF will never call insert for a prop whose minOccurs
== its maxOccurs
+    }
+
+    /**
+     * DOCUMENT_ME
+     *
+     * @param propElems DOCUMENT_ME
+     */
+    public void updateProperty( Object[] propElems )  throws CallbackFailedException
+    {
+        List backendOptions = m_fileSystem.getOptions();
+        // Options prop has cardinality of 1..1, so passed array will always have exactly
one element
+        OptionsDocument.Options o = (OptionsDocument.Options) propElems[0];
+        String[] optionArray = o.getOptionArray();
+        for ( int j = 0; j < optionArray.length; j++ )
+        {
+            backendOptions.add( optionArray[j] );
+        }
     }
 
     /**
@@ -92,29 +109,11 @@
         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 )
+    private void clearOptionsFromProperty( OptionsDocument.Options opts )
     {
-        //remove the options...
-        for ( int i = 0; i < o.sizeOfOptionArray(); i++ )
+        for ( int i = 0; i < opts.sizeOfOptionArray(); i++ )
         {
-            o.removeOption( i );
+            opts.removeOption( i );
         }
     }
 }

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java?rev=326191&r1=326190&r2=326191&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemResource.java
Tue Oct 18 11:19:38 2005
@@ -39,11 +39,13 @@
             DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
             deviceDocXBean.setDeviceSpecialFile( m_filesystem.getDeviceSpecialFile() );
             resourceProperty.add( deviceDocXBean );
+            resourceProperty.getMetaData().setReadOnly( true );
 
             resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.TYPE );
             TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
             typeDocXBean.setType( m_filesystem.getType() );
             resourceProperty.add( typeDocXBean );
+            resourceProperty.getMetaData().setReadOnly( true );
 
             BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
             backupDocXBean.setBackupFrequency( m_filesystem.getBackupFrequency() );

Modified: webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml?rev=326191&r1=326190&r2=326191&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml (original)
+++ webservices/wsrf/trunk/src/site/content/xdocs/tutorial/mod_resource.xml Tue Oct 18 11:19:38
2005
@@ -49,11 +49,13 @@
             DeviceSpecialFileDocument deviceDocXBean = DeviceSpecialFileDocument.Factory.newInstance();
             deviceDocXBean.setDeviceSpecialFile( m_filesystem.getDeviceSpecialFile() );
             resourceProperty.add( deviceDocXBean );
+            resourceProperty.getMetaData().setReadOnly( true );
 
             resourceProperty = resourcePropertySet.get( FilesystemPropertyQNames.TYPE );
             TypeDocument typeDocXBean = TypeDocument.Factory.newInstance();
             typeDocXBean.setType( m_filesystem.getType() );
             resourceProperty.add( typeDocXBean );
+            resourceProperty.getMetaData().setReadOnly( true );
 
             BackupFrequencyDocument backupDocXBean = BackupFrequencyDocument.Factory.newInstance();
             backupDocXBean.setBackupFrequency( m_filesystem.getBackupFrequency() );



Mime
View raw message