jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r772128 - in /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ lock/ query/ state/ version/
Date Wed, 06 May 2009 10:12:21 GMT
Author: angela
Date: Wed May  6 10:12:20 2009
New Revision: 772128

URL: http://svn.apache.org/viewvc?rev=772128&view=rev
Log:
JCR-2003: JCR2SPI / SPI: Add support for JCR 2.0
JCR-1104: JSR 283 support

- move methods to the correct place
- add Javadoc and TODOs
- add trivial implementations on SessionImpl
- rename ManagerProvider#getLockManager to #getLockStateManager

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
Wed May  6 10:12:20 2009
@@ -48,13 +48,13 @@
     public AccessManager getAccessManager();
 
     /**
-     * Returns the <code>AccessManager</code> associated with this
+     * Returns the <code>LockStateManager</code> associated with this
      * <code>ManagerProvider</code>.
      *
-     * @return the <code>AccessManager</code> associated with this
+     * @return the <code>LockStateManager</code> associated with this
      * <code>ManagerProvider</code>
      */
-    public LockStateManager getLockManager();
+    public LockStateManager getLockStateManager();
 
     /**
      * Returns the <code>VersionManager</code> associated with this

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Wed May  6 10:12:20 2009
@@ -1105,7 +1105,7 @@
         checkIsLockable();
         checkHasPendingChanges();
 
-        return session.getLockManager().lock(getNodeState(), isDeep, isSessionScoped, timeoutHint,
ownerHint);
+        return session.getLockStateManager().lock(getNodeState(), isDeep, isSessionScoped,
timeoutHint, ownerHint);
     }
 
     /**
@@ -1114,7 +1114,7 @@
     public Lock getLock() throws UnsupportedRepositoryOperationException, LockException,
AccessDeniedException, RepositoryException {
         // lock can be inherited from a parent > do not check for node being lockable.
         checkStatus();
-        return session.getLockManager().getLock(getNodeState());
+        return session.getLockStateManager().getLock(getNodeState());
     }
 
     /**
@@ -1124,7 +1124,7 @@
         checkIsLockable();
         checkHasPendingChanges();
 
-        session.getLockManager().unlock(getNodeState());
+        session.getLockStateManager().unlock(getNodeState());
     }
 
     /**
@@ -1137,7 +1137,7 @@
             // a node that is new or not lockable never holds a lock
             return false;
         } else {
-            LockStateManager lMgr = session.getLockManager();
+            LockStateManager lMgr = session.getLockStateManager();
             return (lMgr.isLocked(getNodeState()) && lMgr.getLock(getNodeState()).getNode().isSame(this));
         }
     }
@@ -1148,7 +1148,119 @@
     public boolean isLocked() throws RepositoryException {
         // lock can be inherited from a parent > do not check for node being lockable.
         checkStatus();
-        return session.getLockManager().isLocked(getNodeState());
+        return session.getLockStateManager().isLocked(getNodeState());
+    }
+
+    /**
+     * @see javax.jcr.Node#followLifecycleTransition(String)
+     */
+    public void followLifecycleTransition(String transition) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#getAllowedLifecycleTransistions()
+     */
+    public String[] getAllowedLifecycleTransistions() throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#getNodes(String[])
+     */
+    public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * TODO: method name is wrong! should be getProperties (Issue 736 of the pfd)
+     * @see javax.jcr.Node#getProperty(String)
+     */
+    public PropertyIterator getProperty(String[] nameGlobs) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#getReferences(String)
+     */
+    public PropertyIterator getReferences(String name) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#getSharedSet()
+     */
+    public NodeIterator getSharedSet() throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#getWeakReferences()
+     */
+    public PropertyIterator getWeakReferences() throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#getWeakReferences()
+     */
+    public PropertyIterator getWeakReferences(String name) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * TODO: Issue 728 of the pfd... this method is a leftover and will be removed in the
final version.
+     */
+    public NodeIterator merge(String srcWorkspace, boolean bestEffort, boolean isShallow)
throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#removeShare()
+     */
+    public void removeShare() throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#removeSharedSet()
+     */
+    public void removeSharedSet() throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#setPrimaryType(String)
+     */
+    public void setPrimaryType(String nodeTypeName) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#setProperty(String, Binary)
+     */
+    public Property setProperty(String name, Binary value) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see javax.jcr.Node#setProperty(String, BigDecimal)
+     */
+    public Property setProperty(String name, BigDecimal value) throws RepositoryException
{
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
     }
 
     //--------------------------------------------------------< public impl >---
@@ -1253,7 +1365,7 @@
             return;
         }
         // perform check
-        session.getLockManager().checkLock(getNodeState());
+        session.getLockStateManager().checkLock(getNodeState());
     }
 
     /**
@@ -1640,72 +1752,4 @@
             throws ConstraintViolationException, RepositoryException {
         return session.getItemDefinitionProvider().getQPropertyDefinition(getNodeState().getAllNodeTypeNames(),
propertyName, type, multiValued);
     }
-
-    public void followLifecycleTransition(String transition)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public String[] getAllowedLifecycleTransistions()
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public NodeIterator getNodes(String[] nameGlobs)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public PropertyIterator getProperty(String[] nameGlobs)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public PropertyIterator getReferences(String name)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public NodeIterator getSharedSet() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public PropertyIterator getWeakReferences() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public PropertyIterator getWeakReferences(String name)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public NodeIterator merge(
-            String srcWorkspace, boolean bestEffort, boolean isShallow)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public void removeShare() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public void removeSharedSet() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public void setPrimaryType(String nodeTypeName)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public Property setProperty(String name, Binary value)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public Property setProperty(String name, BigDecimal value)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
 }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Wed May  6 10:12:20 2009
@@ -39,6 +39,7 @@
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ValueFactory;
 import javax.jcr.Workspace;
+import javax.jcr.Property;
 import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.retention.RetentionManager;
@@ -295,7 +296,7 @@
         checkIsAlive();
         Path qPath = getQPath(absPath).getNormalizedPath();
         ItemManager itemMgr = getItemManager();
-        return (itemMgr.nodeExists(qPath)) ? true : itemMgr.propertyExists(qPath);
+        return itemMgr.nodeExists(qPath) || itemMgr.propertyExists(qPath);
     }
 
     /**
@@ -476,7 +477,7 @@
      */
     public void addLockToken(String lt) {
         try {
-            getLockManager().addLockToken(lt);
+            getLockStateManager().addLockToken(lt);
         } catch (RepositoryException e) {
             log.warn("Unable to add lock token '" +lt+ "' to this session.", e);
         }
@@ -486,7 +487,7 @@
      * @see javax.jcr.Session#getLockTokens()
      */
     public String[] getLockTokens() {
-        return getLockManager().getLockTokens();
+        return getLockStateManager().getLockTokens();
     }
 
     /**
@@ -494,13 +495,112 @@
      */
     public void removeLockToken(String lt) {
         try {
-            getLockManager().removeLockToken(lt);
+            getLockStateManager().removeLockToken(lt);
         } catch (RepositoryException e) {
             log.warn("Unable to remove lock token '" +lt+ "' from this session. (" + e.getMessage()
+ ")");
         }
     }
 
-    //-------------------------------------------------< NamespaceResolver >--
+    /**
+     * @see Session#getAccessControlManager()
+     */
+    public AccessControlManager getAccessControlManager()
+            throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see Session#getNode(String) 
+     */
+    public Node getNode(String absPath) throws RepositoryException {
+        checkIsAlive();
+        try {
+            Path qPath = getQPath(absPath).getNormalizedPath();
+            ItemManager itemMgr = getItemManager();
+            return itemMgr.getNode(qPath);
+        } catch (AccessDeniedException ade) {
+            throw new PathNotFoundException(absPath);
+        }
+    }
+
+    /**
+     * @see Session#getNodeByIdentifier(String)
+     */
+    public Node getNodeByIdentifier(String id) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see Session#getProperty(String)
+     */
+    public Property getProperty(String absPath) throws RepositoryException {
+        checkIsAlive();
+        try {
+            Path qPath = getQPath(absPath).getNormalizedPath();
+            ItemManager itemMgr = getItemManager();
+            return itemMgr.getProperty(qPath);
+        } catch (AccessDeniedException ade) {
+            throw new PathNotFoundException(absPath);
+        }
+    }
+
+    /**
+     * @see Session#getRetentionManager()
+     */
+    public RetentionManager getRetentionManager()
+            throws UnsupportedRepositoryOperationException, RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see Session#hasCapability(String, Object, Map)
+     */
+    public boolean hasCapability(String methodName, Object target, Map arguments)
+            throws RepositoryException {
+        // TODO: implementation missing
+        return true;
+    }
+
+    /**
+     * @see Session#hasPermission(String, String)
+     */
+    public boolean hasPermission(String absPath, String actions)
+            throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see Session#nodeExists(String)
+     */
+    public boolean nodeExists(String absPath) throws RepositoryException {
+        checkIsAlive();
+        Path qPath = getQPath(absPath).getNormalizedPath();
+        ItemManager itemMgr = getItemManager();
+        return itemMgr.nodeExists(qPath);
+    }
+
+    /**
+     * @see Session#propertyExists(String)
+     */
+    public boolean propertyExists(String absPath) throws RepositoryException {
+        checkIsAlive();
+        Path qPath = getQPath(absPath).getNormalizedPath();
+        ItemManager itemMgr = getItemManager();
+        return itemMgr.propertyExists(qPath);
+    }
+
+    /**
+     * @see Session#removeItem(String)
+     */
+    public void removeItem(String absPath) throws RepositoryException {
+        Item item = getItem(absPath);
+        item.remove();
+    }
+
+    //--------------------------------------------------< NamespaceResolver >---
 
     public String getPrefix(String uri) throws NamespaceException {
         try {
@@ -584,8 +684,10 @@
         return imgr;
     }
 
-    //---------------------------------------------------< ManagerProvider > ---
-
+    //----------------------------------------------------< ManagerProvider >---
+    /**
+     * @see ManagerProvider#getNamePathResolver()
+     */
     public NamePathResolver getNamePathResolver() {
         return npResolver;
     }
@@ -619,10 +721,10 @@
     }
 
     /**
-     * @see ManagerProvider#getLockManager()
+     * @see ManagerProvider#getLockStateManager()
      */
-    public LockStateManager getLockManager() {
-        return workspace.getLockManager();
+    public LockStateManager getLockStateManager() {
+        return workspace.getLockStateManager();
     }
 
     /**
@@ -865,29 +967,4 @@
             throw new NoSuchWorkspaceException("Unknown workspace: '" + workspaceName + "'.");
         }
     }
-
-    public AccessControlManager getAccessControlManager()
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public Node getNodeByIdentifier(String id) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public RetentionManager getRetentionManager()
-            throws UnsupportedRepositoryOperationException, RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public boolean hasCapability(String methodName, Object target, Map arguments)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public boolean hasPermission(String absPath, String actions)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
 }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
Wed May  6 10:12:20 2009
@@ -68,6 +68,7 @@
 import javax.jcr.ValueFactory;
 import javax.jcr.Workspace;
 import javax.jcr.lock.LockException;
+import javax.jcr.lock.LockManager;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.observation.ObservationManager;
@@ -344,6 +345,52 @@
         wspManager.execute(WorkspaceImport.create(parentState, in, uuidBehavior));
     }
 
+    /**
+     * @see javax.jcr.Workspace#createWorkspace(String)
+     */
+    public void createWorkspace(String name) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+
+    /**
+     * @see javax.jcr.Workspace#createWorkspace(String, String)
+     */
+    public void createWorkspace(String name, String srcWorkspace)
+            throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+
+    /**
+     * @see javax.jcr.Workspace#deleteWorkspace(String)
+     */
+    public void deleteWorkspace(String name) throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+
+    /**
+     * @see javax.jcr.Workspace#getLockManager()
+     */
+    public LockManager getLockManager() throws RepositoryException {
+        session.checkIsAlive();
+        session.checkSupportedOption(Repository.OPTION_LOCKING_SUPPORTED);
+        return getLockStateManager();
+    }
+
+    /**
+     * @see javax.jcr.Workspace#getVersionManager()
+     */
+    public javax.jcr.version.VersionManager getVersionManager()
+            throws RepositoryException {
+        // TODO: implementation missing
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
     //----------------------------------------------------< ManagerProvider >---
     /**
      * @see ManagerProvider#getNamePathResolver()
@@ -388,9 +435,9 @@
     }
 
     /**
-     * @see ManagerProvider#getLockManager()
+     * @see ManagerProvider#getLockStateManager()
      */
-    public LockStateManager getLockManager() {
+    public LockStateManager getLockStateManager() {
         if (lockManager == null) {
             lockManager = createLockManager(wspManager, session.getItemManager());
         }
@@ -494,7 +541,7 @@
      */
     protected LockStateManager createLockManager(WorkspaceManager wspManager, ItemManager
itemManager) {
         LockManagerImpl lMgr = new LockManagerImpl(wspManager, itemManager, session.getCacheBehaviour(),
getPathResolver());
-        session.addListener((LockManagerImpl) lMgr);
+        session.addListener(lMgr);
         return lMgr;
     }
 
@@ -516,22 +563,4 @@
     protected ObservationManager createObservationManager(NamePathResolver resolver, NodeTypeRegistry
ntRegistry) {
         return new ObservationManagerImpl(wspManager, resolver, ntRegistry);
     }
-
-    public void createWorkspace(String name) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public void createWorkspace(String name, String srcWorkspace)
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public void deleteWorkspace(String name) throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public javax.jcr.version.VersionManager getVersionManager()
-            throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Wed May  6 10:12:20 2009
@@ -552,6 +552,7 @@
         }
         ntRegistry.dispose();
     }
+
     //------------------------------------------------------< AccessManager >---
     /**
      * @see AccessManager#isGranted(NodeState, Path, String[])

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
Wed May  6 10:12:20 2009
@@ -73,8 +73,8 @@
 
     /**
      * Map holding all locks that where created by this <code>Session</code>
upon
-     * calls to {@link LockManager#lock(NodeState,boolean,boolean)} or to
-     * {@link LockManager#getLock(NodeState)}. The map entries are removed
+     * calls to {@link LockStateManager#lock(NodeState,boolean,boolean)} or to
+     * {@link LockStateManager#getLock(NodeState)}. The map entries are removed
      * only if a lock ends his life by {@link Node#unlock()} or by implicit
      * unlock upon {@link Session#logout()}.
      */
@@ -132,16 +132,74 @@
         n.unlock();
     }
 
-    //---------------------< org.apache.jackrabbit.jcr2spi.lock.LockManager >---
     /**
-     * @see LockManager#lock(NodeState,boolean,boolean)
+     * Returns the lock tokens present on the <code>SessionInfo</code> this
+     * manager has been created with.
+     *
+     * @see javax.jcr.lock.LockManager#getLockTokens()
+     */
+    public String[] getLockTokens() {
+        return wspManager.getLockTokens();
+    }
+
+    /**
+     * Delegates this call to {@link WorkspaceManager#addLockToken(String)}.
+     * If this succeeds this method will inform all locks stored in the local
+     * map in order to give them the chance to update their lock information.
+     *
+     * @see javax.jcr.lock.LockManager#addLockToken(String)
+     */
+    public void addLockToken(String lt) throws LockException, RepositoryException {
+        wspManager.addLockToken(lt);
+        notifyTokenAdded(lt);
+    }
+
+    /**
+     * If the lock addressed by the token is session-scoped, this method will
+     * throw a LockException, such as defined by JSR170 v.1.0.1 for
+     * {@link Session#removeLockToken(String)}.<br>Otherwise the call is
+     * delegated to {@link WorkspaceManager#removeLockToken(String)}.
+     * All locks stored in the local lock map are notified by the removed
+     * token in order have them updated their lock information.
+     *
+     * @see javax.jcr.lock.LockManager#removeLockToken(String)
+     */
+    public void removeLockToken(String lt) throws LockException, RepositoryException {
+        // JSR170 v. 1.0.1 defines that the token of a session-scoped lock may
+        // not be moved over to another session. thus removal ist not possible
+        // and the lock is always present in the lock map.
+        Iterator it = lockMap.values().iterator();
+        boolean found = false;
+        // loop over cached locks to determine if the token belongs to a session
+        // scoped lock, in which case the removal must fail immediately.
+        while (it.hasNext() && !found) {
+            LockImpl l = (LockImpl) it.next();
+            if (lt.equals(l.getLockToken())) {
+                // break as soon as the lock associated with the given token was found.
+                found = true;
+                if (l.isSessionScoped()) {
+                    throw new LockException("Cannot remove lock token associated with a session
scoped lock.");
+                }
+            }
+        }
+
+        // remove lock token from sessionInfo. call will fail, if the session
+        // is not lock holder.
+        wspManager.removeLockToken(lt);
+        // inform about this lt being removed from this session
+        notifyTokenRemoved(lt);
+    }
+
+    //----------------< org.apache.jackrabbit.jcr2spi.lock.LockStateManager >---
+    /**
+     * @see LockStateManager#lock(NodeState,boolean,boolean)
      */
     public Lock lock(NodeState nodeState, boolean isDeep, boolean isSessionScoped) throws
LockException, RepositoryException {
         return lock(nodeState, isDeep, isSessionScoped, Long.MAX_VALUE, null);
     }
 
     /**
-     * @see LockManager#lock(NodeState,boolean,boolean,long,String)
+     * @see LockStateManager#lock(NodeState,boolean,boolean,long,String)
      */
     public Lock lock(NodeState nodeState, boolean isDeep, boolean isSessionScoped, long timeoutHint,
String ownerHint) throws RepositoryException {
         // retrieve node first
@@ -164,8 +222,7 @@
     }
 
     /**
-     * @see LockManager#unlock(NodeState)
-     * @param nodeState
+     * @see LockStateManager#unlock(NodeState)
      */
     public void unlock(NodeState nodeState) throws LockException, RepositoryException {
         // execute the operation. Note, that its possible that the session is
@@ -190,7 +247,7 @@
      * Note, that the flag indicating session-scoped lock cannot be retrieved
      * unless the current session is the lock holder.
      *
-     * @see LockManager#getLock(NodeState)
+     * @see LockStateManager#getLock(NodeState)
      * @param nodeState
      */
     public Lock getLock(NodeState nodeState) throws LockException, RepositoryException {
@@ -206,8 +263,7 @@
     }
 
     /**
-     * @see LockManager#isLocked(NodeState)
-     * @param nodeState
+     * @see LockStateManager#isLocked(NodeState)
      */
     public boolean isLocked(NodeState nodeState) throws RepositoryException {
         LockImpl l = getLockImpl(nodeState, false);
@@ -215,8 +271,7 @@
     }
 
     /**
-     * @see LockManager#checkLock(NodeState)
-     * @param nodeState
+     * @see LockStateManager#checkLock(NodeState)
      */
     public void checkLock(NodeState nodeState) throws LockException, RepositoryException
{
         // shortcut: new status indicates that a new state was already added
@@ -232,69 +287,8 @@
         } // else: state is not locked at all || session is lock-holder
     }
 
-    //--------< LockManager, org.apache.jackrabbit.jcr2spi.lock.LockManager >---
-    /**
-     * Returns the lock tokens present on the <code>SessionInfo</code> this
-     * manager has been created with.
-     *
-     * @see LockManager#getLockTokens()
-     */
-    public String[] getLockTokens() {
-        return wspManager.getLockTokens();
-    }
-
-    /**
-     * Delegates this call to {@link WorkspaceManager#addLockToken(String)}.
-     * If this succeeds this method will inform all locks stored in the local
-     * map in order to give them the chance to update their lock information.
-     *
-     * @see LockManager#addLockToken(String)
-     */
-    public void addLockToken(String lt) throws LockException, RepositoryException {
-        wspManager.addLockToken(lt);
-        notifyTokenAdded(lt);
-    }
-
-    /**
-     * If the lock addressed by the token is session-scoped, this method will
-     * throw a LockException, such as defined by JSR170 v.1.0.1 for
-     * {@link Session#removeLockToken(String)}.<br>Otherwise the call is
-     * delegated to {@link WorkspaceManager#removeLockToken(String)}.
-     * All locks stored in the local lock map are notified by the removed
-     * token in order have them updated their lock information.
-     *
-     * @see LockManager#removeLockToken(String)
-     */
-    public void removeLockToken(String lt) throws LockException, RepositoryException {
-        // JSR170 v. 1.0.1 defines that the token of a session-scoped lock may
-        // not be moved over to another session. thus removal ist not possible
-        // and the lock is always present in the lock map.
-        Iterator it = lockMap.values().iterator();
-        boolean found = false;
-        // loop over cached locks to determine if the token belongs to a session
-        // scoped lock, in which case the removal must fail immediately.
-        while (it.hasNext() && !found) {
-            LockImpl l = (LockImpl) it.next();
-            if (lt.equals(l.getLockToken())) {
-                // break as soon as the lock associated with the given token was found.
-                found = true;
-                if (l.isSessionScoped()) {
-                    throw new LockException("Cannot remove lock token associated with a session
scoped lock.");
-                }
-            }
-        }
-
-        // remove lock token from sessionInfo. call will fail, if the session
-        // is not lock holder.
-        wspManager.removeLockToken(lt);
-        // inform about this lt being removed from this session
-        notifyTokenRemoved(lt);
-    }
-
     //----------------------------------------------------< SessionListener >---
     /**
-     *
-     * @param session
      * @see SessionListener#loggingOut(Session)
      */
     public void loggingOut(Session session) {
@@ -316,8 +310,6 @@
     }
 
     /**
-     *
-     * @param session
      * @see SessionListener#loggedOut(Session)
      */
     public void loggedOut(Session session) {

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
Wed May  6 10:12:20 2009
@@ -225,17 +225,27 @@
         }
     }
 
-    public void bindValue(String varName, Value value)
-            throws RepositoryException {
+    /**
+     * @see Query#bindValue(String, Value)
+     */
+    public void bindValue(String varName, Value value) throws RepositoryException {
+        //TODO
         throw new UnsupportedRepositoryOperationException("JCR-1104");
     }
 
+    /**
+     * @see Query#setLimit(long)
+     */
     public void setLimit(long limit) {
+        // TODO
         throw new UnsupportedOperationException("JCR-1104");
     }
 
+    /**
+     * @see Query#setOffset(long)
+     */
     public void setOffset(long offset) {
+        // TODO
         throw new UnsupportedOperationException("JCR-1104");
     }
-
 }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
Wed May  6 10:12:20 2009
@@ -264,27 +264,51 @@
             }
         }
 
+        /**
+         * @see Row#getNode()
+         */
         public Node getNode() throws RepositoryException {
+            // TODO
             throw new UnsupportedRepositoryOperationException("JCR-1104");
         }
 
+        /**
+         * @see Row#getNode(String)
+         */
         public Node getNode(String selectorName) throws RepositoryException {
+            // TODO
             throw new UnsupportedRepositoryOperationException("JCR-1104");
         }
 
+        /**
+         * @see Row#getPath()
+         */
         public String getPath() throws RepositoryException {
+            // TODO
             throw new UnsupportedRepositoryOperationException("JCR-1104");
         }
 
+        /**
+         * @see Row#getPath(String)
+         */
         public String getPath(String selectorName) throws RepositoryException {
+            // TODO
             throw new UnsupportedRepositoryOperationException("JCR-1104");
         }
 
+        /**
+         * @see Row#getScore()
+         */
         public double getScore() throws RepositoryException {
+            // TODO
             throw new UnsupportedRepositoryOperationException("JCR-1104");
         }
 
+        /**
+         * @see Row#getScore(String)
+         */
         public double getScore(String selectorName) throws RepositoryException {
+            // TODO
             throw new UnsupportedRepositoryOperationException("JCR-1104");
         }
 

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
Wed May  6 10:12:20 2009
@@ -483,7 +483,7 @@
         // make sure there's no foreign lock present the node (or the parent node
         // in case the state represents a PropertyState).
         NodeState nodeState = (itemState.isNode()) ? ((NodeState)itemState) : itemState.getParent();
-        mgrProvider.getLockManager().checkLock(nodeState);
+        mgrProvider.getLockStateManager().checkLock(nodeState);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
Wed May  6 10:12:20 2009
@@ -75,9 +75,6 @@
 
     //-----------------------------------------------------< VersionHistory >---
     /**
-     *
-     * @return
-     * @throws RepositoryException
      * @see VersionHistory#getVersionableUUID()
      */
     public String getVersionableUUID() throws RepositoryException {
@@ -86,9 +83,6 @@
     }
 
     /**
-     *
-     * @return
-     * @throws RepositoryException
      * @see VersionHistory#getRootVersion()
      */
     public Version getRootVersion() throws RepositoryException {
@@ -103,9 +97,6 @@
     }
 
     /**
-     *
-     * @return
-     * @throws RepositoryException
      * @see VersionHistory#getAllVersions()
      */
     public VersionIterator getAllVersions() throws RepositoryException {
@@ -124,11 +115,6 @@
     }
 
     /**
-     *
-     * @param versionName
-     * @return
-     * @throws VersionException
-     * @throws RepositoryException
      * @see VersionHistory#getVersion(String)
      */
     public Version getVersion(String versionName) throws VersionException, RepositoryException
{
@@ -138,10 +124,6 @@
     }
 
     /**
-     *
-     * @param label
-     * @return
-     * @throws RepositoryException
      * @see VersionHistory#getVersionByLabel(String)
      */
     public Version getVersionByLabel(String label) throws RepositoryException {
@@ -150,12 +132,6 @@
     }
 
     /**
-     *
-     * @param versionName
-     * @param label
-     * @param moveLabel
-     * @throws VersionException
-     * @throws RepositoryException
      * @see VersionHistory#addVersionLabel(String, String, boolean)
      */
     public void addVersionLabel(String versionName, String label, boolean moveLabel) throws
VersionException, RepositoryException {
@@ -167,10 +143,6 @@
     }
 
     /**
-     *
-     * @param label
-     * @throws VersionException
-     * @throws RepositoryException
      * @see VersionHistory#removeVersionLabel(String)
      */
     public void removeVersionLabel(String label) throws VersionException, RepositoryException
{
@@ -183,10 +155,6 @@
     }
 
     /**
-     *
-     * @param label
-     * @return
-     * @throws RepositoryException
      * @see VersionHistory#hasVersionLabel(String)
      */
     public boolean hasVersionLabel(String label) throws RepositoryException {
@@ -202,11 +170,6 @@
     }
 
     /**
-     * @param version
-     * @param label
-     * @return
-     * @throws VersionException
-     * @throws RepositoryException
      * @see VersionHistory#hasVersionLabel(Version, String)
      */
     public boolean hasVersionLabel(Version version, String label) throws VersionException,
RepositoryException {
@@ -226,9 +189,6 @@
     }
 
     /**
-     *
-     * @return
-     * @throws RepositoryException
      * @see VersionHistory#getVersionLabels()
      */
     public String[] getVersionLabels() throws RepositoryException {
@@ -243,11 +203,6 @@
     }
 
     /**
-     *
-     * @param version
-     * @return
-     * @throws VersionException
-     * @throws RepositoryException
      * @see VersionHistory#getVersionLabels(Version)
      */
     public String[] getVersionLabels(Version version) throws VersionException, RepositoryException
{
@@ -267,13 +222,6 @@
     }
 
     /**
-     *
-     * @param versionName
-     * @throws ReferentialIntegrityException
-     * @throws AccessDeniedException
-     * @throws UnsupportedRepositoryOperationException
-     * @throws VersionException
-     * @throws RepositoryException
      * @see VersionHistory#removeVersion(String)
      */
     public void removeVersion(String versionName) throws ReferentialIntegrityException,
@@ -284,6 +232,39 @@
         session.getVersionStateManager().removeVersion((NodeState) getItemState(), vState);
     }
 
+
+    /**
+     * @see VersionHistory#getAllFrozenNodes()
+     */
+    public NodeIterator getAllFrozenNodes() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see VersionHistory#getAllLinearFrozenNodes()
+     */
+    public NodeIterator getAllLinearFrozenNodes() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see VersionHistory#getAllLinearVersions()
+     */
+    public VersionIterator getAllLinearVersions() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see VersionHistory#getVersionableIdentifier()
+     */
+    public String getVersionableIdentifier() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+    
     //---------------------------------------------------------------< Item >---
     /**
      *
@@ -422,21 +403,4 @@
         // TODO: check again.. is this correct? or should NodeEntry be altered
         entry.getNodeState();
     }
-
-    public NodeIterator getAllFrozenNodes() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public NodeIterator getAllLinearFrozenNodes() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public VersionIterator getAllLinearVersions() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public String getVersionableIdentifier() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java?rev=772128&r1=772127&r2=772128&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
Wed May  6 10:12:20 2009
@@ -88,6 +88,30 @@
         return getVersions(NameConstants.JCR_PREDECESSORS);
     }
 
+    /**
+     * @see Version#getFrozenNode()
+     */
+    public Node getFrozenNode() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see Version#getLinearPredecessor()
+     */
+    public Version getLinearPredecessor() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
+    /**
+     * @see Version#getLinearSuccessor()
+     */
+    public Version getLinearSuccessor() throws RepositoryException {
+        // TODO
+        throw new UnsupportedRepositoryOperationException("JCR-1104");
+    }
+
     //---------------------------------------------------------------< Item >---
     /**
      *
@@ -159,17 +183,4 @@
         }
         return versions;
     }
-
-    public Node getFrozenNode() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public Version getLinearPredecessor() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
-    public Version getLinearSuccessor() throws RepositoryException {
-        throw new UnsupportedRepositoryOperationException("JCR-1104");
-    }
-
 }
\ No newline at end of file



Mime
View raw message