jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r409598 - in /jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi: client/ClientNode.java client/ClientProperty.java server/ServerNode.java
Date Fri, 26 May 2006 09:05:55 GMT
Author: jukka
Date: Fri May 26 02:05:55 2006
New Revision: 409598

URL: http://svn.apache.org/viewvc?rev=409598&view=rev
Log:
1.0: Merged revision 399638: JCR-420

Modified:
    jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientNode.java
    jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
    jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerNode.java

Modified: jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientNode.java?rev=409598&r1=409597&r2=409598&view=diff
==============================================================================
--- jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientNode.java
(original)
+++ jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientNode.java
Fri May 26 02:05:55 2006
@@ -119,9 +119,14 @@
     public Property setProperty(String name, Value value)
             throws RepositoryException {
         try {
-            RemoteProperty property =
-                remote.setProperty(name, SerialValueFactory.makeSerialValue(value));
-            return getFactory().getProperty(getSession(), property);
+            if (value == null) {
+                remote.setProperty(name, (Value) null);
+                return null;
+            } else {
+                RemoteProperty property = remote.setProperty(
+                        name, SerialValueFactory.makeSerialValue(value));
+                return getFactory().getProperty(getSession(), property);
+            }
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }
@@ -131,9 +136,14 @@
     public Property setProperty(String name, Value[] values)
             throws RepositoryException {
         try {
-            Value[] serials = SerialValueFactory.makeSerialValueArray(values);
-            RemoteProperty property = remote.setProperty(name, serials);
-            return getFactory().getProperty(getSession(), property);
+            if (values == null) {
+                remote.setProperty(name, (Value[]) null);
+                return null;
+            } else {
+                Value[] serials = SerialValueFactory.makeSerialValueArray(values);
+                RemoteProperty property = remote.setProperty(name, serials);
+                return getFactory().getProperty(getSession(), property);
+            }
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }
@@ -142,23 +152,35 @@
     /** {@inheritDoc} */
     public Property setProperty(String name, String[] strings)
             throws RepositoryException {
-        Value[] values = new Value[strings.length];
-        for (int i = 0; i < strings.length; i++) {
-            values[i] = getSession().getValueFactory().createValue(strings[i]);
+        if (strings == null) {
+            return setProperty(name, (Value[]) null);
+        } else {
+            Value[] values = new Value[strings.length];
+            for (int i = 0; i < strings.length; i++) {
+                values[i] = getSession().getValueFactory().createValue(strings[i]);
+            }
+            return setProperty(name, values);
         }
-        return setProperty(name, values);
     }
 
     /** {@inheritDoc} */
     public Property setProperty(String name, String value)
             throws RepositoryException {
-        return setProperty(name, getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            return setProperty(name, (Value) null);
+        } else {
+            return setProperty(name, getSession().getValueFactory().createValue(value));
+        }
     }
 
     /** {@inheritDoc} */
     public Property setProperty(String name, InputStream value)
             throws RepositoryException {
-        return setProperty(name, getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            return setProperty(name, (Value) null);
+        } else {
+            return setProperty(name, getSession().getValueFactory().createValue(value));
+        }
     }
 
     /** {@inheritDoc} */
@@ -182,13 +204,21 @@
     /** {@inheritDoc} */
     public Property setProperty(String name, Calendar value)
             throws RepositoryException {
-        return setProperty(name, getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            return setProperty(name, (Value) null);
+        } else {
+            return setProperty(name, getSession().getValueFactory().createValue(value));
+        }
     }
 
     /** {@inheritDoc} */
     public Property setProperty(String name, Node value)
             throws RepositoryException {
-        return setProperty(name, getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            return setProperty(name, (Value) null);
+        } else {
+            return setProperty(name, getSession().getValueFactory().createValue(value));
+        }
     }
 
     /** {@inheritDoc} */

Modified: jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientProperty.java?rev=409598&r1=409597&r2=409598&view=diff
==============================================================================
--- jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
(original)
+++ jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/ClientProperty.java
Fri May 26 02:05:55 2006
@@ -165,7 +165,11 @@
      * {@inheritDoc}
      */
     public void setValue(Calendar value) throws RepositoryException {
-        setValue(getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            setValue((Value) null);
+        } else {
+            setValue(getSession().getValueFactory().createValue(value));
+        }
     }
 
     /**
@@ -185,7 +189,11 @@
      * {@inheritDoc}
      */
     public void setValue(InputStream value) throws RepositoryException {
-        setValue(getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            setValue((Value) null);
+        } else {
+            setValue(getSession().getValueFactory().createValue(value));
+        }
     }
 
     /**
@@ -205,7 +213,11 @@
      * {@inheritDoc}
      */
     public void setValue(Node value) throws RepositoryException {
-        setValue(getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            setValue((Value) null);
+        } else {
+            setValue(getSession().getValueFactory().createValue(value));
+        }
     }
 
     /**
@@ -215,7 +227,11 @@
      * {@inheritDoc}
      */
     public void setValue(String value) throws RepositoryException {
-        setValue(getSession().getValueFactory().createValue(value));
+        if (value == null) {
+            setValue((Value) null);
+        } else {
+            setValue(getSession().getValueFactory().createValue(value));
+        }
     }
 
     /**
@@ -225,17 +241,25 @@
      * {@inheritDoc}
      */
     public void setValue(String[] strings) throws RepositoryException {
-        Value[] values = new Value[strings.length];
-        for (int i = 0; i < strings.length; i++) {
-            values[i] = getSession().getValueFactory().createValue(strings[i]);
+        if (strings == null) {
+            setValue((Value[]) null);
+        } else {
+            Value[] values = new Value[strings.length];
+            for (int i = 0; i < strings.length; i++) {
+                values[i] = getSession().getValueFactory().createValue(strings[i]);
+            }
+            setValue(values);
         }
-        setValue(values);
     }
 
     /** {@inheritDoc} */
     public void setValue(Value value) throws RepositoryException {
         try {
-            remote.setValue(SerialValueFactory.makeSerialValue(value));
+            if (value == null) {
+                remote.setValue((Value) null);
+            } else {
+                remote.setValue(SerialValueFactory.makeSerialValue(value));
+            }
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }
@@ -244,7 +268,11 @@
     /** {@inheritDoc} */
     public void setValue(Value[] values) throws RepositoryException {
         try {
-            remote.setValue(SerialValueFactory.makeSerialValueArray(values));
+            if (values == null) {
+                remote.setValue((Value[]) null);
+            } else {
+                remote.setValue(SerialValueFactory.makeSerialValueArray(values));
+            }
         } catch (RemoteException ex) {
             throw new RemoteRepositoryException(ex);
         }

Modified: jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerNode.java?rev=409598&r1=409597&r2=409598&view=diff
==============================================================================
--- jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerNode.java
(original)
+++ jackrabbit/branches/1.0/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/ServerNode.java
Fri May 26 02:05:55 2006
@@ -253,7 +253,12 @@
     public RemoteProperty setProperty(String name, Value value, int type)
             throws RepositoryException, RemoteException {
         try {
-            return getFactory().getRemoteProperty(node.setProperty(name, value, type));
+            Property property = node.setProperty(name, value, type);
+            if (property == null) {
+                return null;
+            } else {
+                return getFactory().getRemoteProperty(property);
+            }
         } catch (RepositoryException ex) {
             throw getRepositoryException(ex);
         }
@@ -304,7 +309,11 @@
             throws RepositoryException, RemoteException {
         try {
             Property property = node.setProperty(name, values);
-            return getFactory().getRemoteProperty(property);
+            if (property == null) {
+                return null;
+            } else {
+                return getFactory().getRemoteProperty(property);
+            }
         } catch (RepositoryException ex) {
             throw getRepositoryException(ex);
         }



Mime
View raw message