jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r995032 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: ./ query/ session/
Date Wed, 08 Sep 2010 12:48:51 GMT
Author: jukka
Date: Wed Sep  8 12:48:51 2010
New Revision: 995032

URL: http://svn.apache.org/viewvc?rev=995032&view=rev
Log:
JCR-2741: Improved logging for session operations

Add toString() methods to most session operations

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AddMixinOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRefreshOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RemoveMixinOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionRefreshOperation.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionSaveOperation.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AddMixinOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AddMixinOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AddMixinOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/AddMixinOperation.java
Wed Sep  8 12:48:51 2010
@@ -166,4 +166,14 @@ class AddMixinOperation implements Sessi
         return this;
     }
 
+
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "node.addMixin(" + mixinName + ")";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemImpl.java
Wed Sep  8 12:48:51 2010
@@ -363,6 +363,9 @@ public abstract class ItemImpl implement
                     throw new ItemNotFoundException("Ancestor not found", e);
                 }
             }
+            public String toString() {
+                return "item.getAncestor(" + degree + ")";
+            }
         });
     }
 
@@ -375,6 +378,9 @@ public abstract class ItemImpl implement
                     throws RepositoryException {
                 return context.getJCRPath(getPrimaryPath());
             }
+            public String toString() {
+                return "item.getPath()";
+            }
         });
     }
 
@@ -392,6 +398,9 @@ public abstract class ItemImpl implement
                     return context.getHierarchyManager().getDepth(id);
                 }
             }
+            public String toString() {
+                return "item.getDepth()";
+            }
         });
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRefreshOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRefreshOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRefreshOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRefreshOperation.java
Wed Sep  8 12:48:51 2010
@@ -135,4 +135,13 @@ public class ItemRefreshOperation implem
         return this;
     }
 
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "item.refresh(" + keepChanges + ")";
+    }
+
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemRemoveOperation.java
Wed Sep  8 12:48:51 2010
@@ -85,4 +85,14 @@ class ItemRemoveOperation implements Ses
         return this;
     }
 
+
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "item.remove()";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ItemSaveOperation.java
Wed Sep  8 12:48:51 2010
@@ -908,4 +908,14 @@ class ItemSaveOperation implements Sessi
         }
     }
 
+
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "item.save()";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Wed Sep  8 12:48:51 2010
@@ -1095,6 +1095,9 @@ public class NodeImpl extends ItemImpl i
                     throw new ItemNotFoundException();
                 }
             }
+            public String toString() {
+                return "node.getNode(" + name + "[" + index + "])";
+            }
         });
     }
 
@@ -1131,6 +1134,9 @@ public class NodeImpl extends ItemImpl i
                 return cne != null
                     && context.getItemManager().itemExists(cne.getId());
             }
+            public String toString() {
+                return "node.hasNode(" + name + "[" + index + "])";
+            }
         });
     }
 
@@ -1158,6 +1164,9 @@ public class NodeImpl extends ItemImpl i
                             "Property " + n + " not found");
                 }
             }
+            public String toString() {
+                return "node.getProperty(" + name + ")";
+            }
         });
     }
 
@@ -1178,6 +1187,9 @@ public class NodeImpl extends ItemImpl i
                     && context.getItemManager().itemExists(
                             new PropertyId(getNodeId(), name));
             }
+            public String toString() {
+                return "node.hasProperty(" + name + ")";
+            }
         });
     }
 
@@ -1649,6 +1661,9 @@ public class NodeImpl extends ItemImpl i
                 }
                 return context.getJCRName(name);
             }
+            public String toString() {
+                return "node.getName()";
+            }
         });
     }
 
@@ -1677,6 +1692,9 @@ public class NodeImpl extends ItemImpl i
                             "Root node doesn't have a parent");
                 }
             }
+            public String toString() {
+                return "node.getParent()";
+            }
         });
     }
 
@@ -1985,6 +2003,15 @@ public class NodeImpl extends ItemImpl i
             return property;
         }
 
+        //--------------------------------------------------------------< Object >
+
+        /**
+         * Returns a string representation of this operation.
+         */
+        public String toString() {
+            return "node.setProperty(" + name + ", " + value + ")";
+        }
+
     }
 
     /**
@@ -2046,6 +2073,9 @@ public class NodeImpl extends ItemImpl i
                 }
                 return prop;
             }
+            public String toString() {
+                return "node.setProperty(...)";
+            }
         });
     }
 
@@ -2081,6 +2111,9 @@ public class NodeImpl extends ItemImpl i
                     throw new PathNotFoundException(relPath);
                 }
             }
+            public String toString() {
+                return "node.getNode(" + relPath + ")";
+            }
         });
     }
 
@@ -2104,6 +2137,9 @@ public class NodeImpl extends ItemImpl i
                             "Failed to list child nodes of " + NodeImpl.this, e);
                 }
             }
+            public String toString() {
+                return "node.getNodes()";
+            }
         });
     }
 
@@ -2127,6 +2163,9 @@ public class NodeImpl extends ItemImpl i
                             "Failed to list properties of " + NodeImpl.this, e);
                 }
             }
+            public String toString() {
+                return "node.getProperties()";
+            }
         });
     }
 
@@ -2151,6 +2190,9 @@ public class NodeImpl extends ItemImpl i
                     throw new PathNotFoundException(relPath);
                 }
             }
+            public String toString() {
+                return "node.getProperty(" + relPath + ")";
+            }
         });
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RemoveMixinOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RemoveMixinOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RemoveMixinOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RemoveMixinOperation.java
Wed Sep  8 12:48:51 2010
@@ -293,4 +293,13 @@ class RemoveMixinOperation implements Se
             || mixin.isDerivedFrom(MIX_REFERENCEABLE);
     }
 
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "node.removeMixin(" + mixinName + ")";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionMoveOperation.java
Wed Sep  8 12:48:51 2010
@@ -213,4 +213,14 @@ public class SessionMoveOperation implem
         return this;
     }
 
+
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "session.move(" + srcAbsPath + ", " + destAbsPath + ")";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/VersionManagerImpl.java
Wed Sep  8 12:48:51 2010
@@ -121,6 +121,9 @@ public class VersionManagerImpl extends 
                 NodeId baseId = checkoutCheckin(state, true, false, created);
                 return (Version) session.getNodeById(baseId);
             }
+            public String toString() {
+                return "versionManager.checkin(" + absPath + ", " + created + ")";
+            }
         });
     }
 
@@ -137,6 +140,9 @@ public class VersionManagerImpl extends 
                         Permission.VERSION_MNGMT);
                 return checkoutCheckin(state, false, true, null);
             }
+            public String toString() {
+                return "versionManager.checkout(" + absPath + ")";
+            }
         });
     }
 
@@ -154,6 +160,9 @@ public class VersionManagerImpl extends 
                 NodeId baseId = checkoutCheckin(state, true, true, null);
                 return (Version) session.getNodeById(baseId);
             }
+            public String toString() {
+                return "versionManager.checkpoint(" + absPath + ")";
+            }
         });
     }
 
@@ -174,6 +183,9 @@ public class VersionManagerImpl extends 
                 InternalVersionHistory vh = getVersionHistory(state);
                 return (VersionHistory) session.getNodeById(vh.getId());
             }
+            public String toString() {
+                return "versionManager.getVersionHistory(" + absPath + ")";
+            }
         });
     }
 
@@ -189,6 +201,9 @@ public class VersionManagerImpl extends 
                 InternalVersion v = getBaseVersion(state);
                 return (Version) session.getNodeById(v.getId());
             }
+            public String toString() {
+                return "versionManager.getBaseVersion(" + absPath + ")";
+            }
         });
     }
 
@@ -240,6 +255,9 @@ public class VersionManagerImpl extends 
 
                 return this;
             }
+            public String toString() {
+                return "versionManager.restore(versions, " + removeExisting + ")";
+            }
         });
     }
 
@@ -259,6 +277,11 @@ public class VersionManagerImpl extends 
                 restore(state, context.getQName(versionName), removeExisting);
                 return this;
             }
+            public String toString() {
+                return "versionManager.restore("
+                    + absPath + ", " +  versionName + ", "
+                    +  removeExisting + ")";
+            }
         });
     }
 
@@ -300,6 +323,10 @@ public class VersionManagerImpl extends 
                 }
                 return this;
             }
+            public String toString() {
+                return "versionManager.restore("
+                    + absPath + ", version, " + removeExisting + ")";
+            }
         });
     }
 
@@ -339,6 +366,11 @@ public class VersionManagerImpl extends 
                         state, context.getQName(versionLabel), removeExisting);
                 return this;
             }
+            public String toString() {
+                return "versionManager.restoreByLabel("
+                    + absPath + ", " +  versionLabel + ", "
+                    + removeExisting + ")";
+            }
         });
     }
 
@@ -383,6 +415,11 @@ public class VersionManagerImpl extends 
                 mergeOrUpdate(state, srcWorkspaceName, failedIds, bestEffort, isShallow);
                 return new LazyItemIterator(session.getItemManager(), failedIds);
             }
+            public String toString() {
+                return "versionManager.merge("
+                    + absPath + ", " +  srcWorkspaceName + ", "
+                    + bestEffort + ", " +  isShallow + ")";
+            }
         });
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
Wed Sep  8 12:48:51 2010
@@ -131,6 +131,9 @@ public class QueryImpl extends AbstractQ
                             throws RepositoryException {
                         return query.execute(offset, limit);
                     }
+                    public String toString() {
+                        return "query.execute(" + statement + ")";
+                    }
                 });
         if (log.isDebugEnabled()) {
             time = System.currentTimeMillis() - time;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
Wed Sep  8 12:48:51 2010
@@ -39,7 +39,6 @@ import org.apache.jackrabbit.core.sessio
 import org.apache.jackrabbit.core.session.SessionOperation;
 import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelFactoryImpl;
 import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 
 /**
  * This class implements the {@link QueryManager} interface.
@@ -95,6 +94,9 @@ public class QueryManagerImpl implements
                 QueryFactory qf = new QueryFactoryImpl(language);
                 return qf.createQuery(statement, language);
             }
+            public String toString() {
+                return "node.createQuery(" + statement + ", " + language + ")";
+            }
         });
     }
 
@@ -117,6 +119,9 @@ public class QueryManagerImpl implements
                 QueryFactory qf = new QueryFactoryImpl(node, language);
                 return qf.createQuery(statement, language);
             }
+            public String toString() {
+                return "queryManager.getQuery(node)";
+            }
         });
     }
 
@@ -167,6 +172,9 @@ public class QueryManagerImpl implements
                 }
                 return nodes;
             }
+            public String toString() {
+                return "queryManager.getWeaklyReferringNodes(node)";
+            }
         });
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/AddNodeOperation.java
Wed Sep  8 12:48:51 2010
@@ -112,4 +112,14 @@ public class AddNodeOperation implements
         return parentNode.addNode(last.getName(), typeName, id);
     }
 
+
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "node.addNode(" + relPath + ", " + nodeTypeName + ", " + uuid  + ")";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionRefreshOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionRefreshOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionRefreshOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionRefreshOperation.java
Wed Sep  8 12:48:51 2010
@@ -72,4 +72,13 @@ public class SessionRefreshOperation imp
         return this;
     }
 
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "session.refresh(" + keepChanges + ")";
+    }
+
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionSaveOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionSaveOperation.java?rev=995032&r1=995031&r2=995032&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionSaveOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionSaveOperation.java
Wed Sep  8 12:48:51 2010
@@ -43,4 +43,13 @@ public class SessionSaveOperation implem
         return this;
     }
 
+    //--------------------------------------------------------------< Object >
+
+    /**
+     * Returns a string representation of this operation.
+     */
+    public String toString() {
+        return "session.save()";
+    }
+
 }
\ No newline at end of file



Mime
View raw message