jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r421270 [12/23] - in /jackrabbit/trunk/contrib/spi: ./ commons/ commons/src/ commons/src/main/ commons/src/main/java/ commons/src/main/java/org/ commons/src/main/java/org/apache/ commons/src/main/java/org/apache/jackrabbit/ commons/src/main...
Date Wed, 12 Jul 2006 13:33:27 GMT
Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>Checkin</code>...
+ */
+public class Checkin extends AbstractOperation {
+
+    private final NodeId nodeId;
+
+    private Checkin(NodeId nodeId) {
+        this.nodeId = nodeId;
+        addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    public static Operation create(NodeId nodeId) {
+        return new Checkin(nodeId);
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>Checkout</code>...
+ */
+public class Checkout extends AbstractOperation {
+
+    private final NodeId nodeId;
+
+    private Checkout(NodeId nodeId) {
+        this.nodeId = nodeId;
+        addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+    
+    //------------------------------------------------------------< Factory >---
+    public static Operation create(NodeId nodeId) {
+        return new Checkout(nodeId);
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
+import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.name.Path;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.lock.LockException;
+import javax.jcr.version.VersionException;
+
+/**
+ * <code>Clone</code>...
+ */
+public class Clone extends AbstractCopy {
+
+    private final boolean removeExisting;
+
+    private Clone(Path srcPath, Path destPath, String srcWorkspaceName,
+                  boolean removeExisting, ManagerProvider srcMgrProvider,
+                  ItemStateValidator validator)
+        throws RepositoryException {
+        super(srcPath, destPath, srcWorkspaceName, srcMgrProvider, validator);
+        this.removeExisting = removeExisting;
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws NoSuchWorkspaceException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public boolean isRemoveExisting() {
+        return removeExisting;
+    }
+
+    //------------------------------------------------------------< Factory >---
+
+    public static Operation create(Path srcPath, Path destPath,
+                                   String srcWorkspaceName, boolean removeExisting,
+                                   ManagerProvider srcMgrProvider,
+                                   ItemStateValidator validator)
+        throws RepositoryException, ConstraintViolationException, AccessDeniedException,
+        ItemExistsException, VersionException {
+
+        Clone cl = new Clone(srcPath, destPath, srcWorkspaceName, removeExisting, srcMgrProvider, validator);
+        return cl;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
+import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.name.Path;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.lock.LockException;
+import javax.jcr.version.VersionException;
+
+/**
+ * <code>Copy</code>...
+ */
+public class Copy extends AbstractCopy  {
+
+    private Copy(Path srcPath, Path destPath, String srcWorkspaceName, ManagerProvider srcMgrProvider, ItemStateValidator validator) throws RepositoryException {
+        super(srcPath, destPath, srcWorkspaceName, srcMgrProvider, validator);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws NoSuchWorkspaceException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //------------------------------------------------------------< Factory >---
+    public static Operation create(Path srcPath, Path destPath,
+                                   ManagerProvider mgrProvider,
+                                   ItemStateValidator validator)
+        throws RepositoryException, ConstraintViolationException, AccessDeniedException,
+        ItemExistsException, VersionException {
+        return create(srcPath, destPath, null, mgrProvider, validator);
+    }
+
+    public static Operation create(Path srcPath, Path destPath,
+                                   String srcWorkspaceName,
+                                   ManagerProvider srcMgrProvider,
+                                   ItemStateValidator validator)
+        throws RepositoryException, ConstraintViolationException, AccessDeniedException,
+        ItemExistsException, VersionException {
+        Copy cp = new Copy(srcPath, destPath, srcWorkspaceName, srcMgrProvider, validator);
+        return cp;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>LockOperation</code>...
+ */
+public class LockOperation extends AbstractOperation {
+
+    private final NodeId nodeId;
+    private final boolean isDeep;
+    private final boolean isSessionScoped;
+
+    private LockOperation(NodeId nodeId, boolean isDeep, boolean isSessionScoped) {
+        this.nodeId = nodeId;
+        this.isDeep = isDeep;
+        this.isSessionScoped = isSessionScoped;
+
+        this.addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    public boolean isDeep() {
+        return isDeep;
+    }
+
+    public boolean isSessionScoped() {
+        return isSessionScoped;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @param isDeep
+     * @return
+     */
+    public static Operation create(NodeId nodeId, boolean isDeep, boolean isSessionScoped) {
+        Operation lck = new LockOperation(nodeId, isDeep, isSessionScoped);
+        return lck;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockOperation.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import org.apache.jackrabbit.spi.NodeId;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>LockRefresh</code>...
+ */
+public class LockRefresh extends AbstractOperation {
+
+    private final NodeId nodeId;
+
+    private LockRefresh(NodeId nodeId) {
+        this.nodeId = nodeId;
+
+        this.addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @return
+     */
+    public static Operation create(NodeId nodeId) {
+        Operation lck = new LockRefresh(nodeId);
+        return lck;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRefresh.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>LockRelease</code>...
+ */
+public class LockRelease extends AbstractOperation {
+
+    private final NodeId nodeId;
+
+    private LockRelease(NodeId nodeId) {
+        this.nodeId = nodeId;
+
+        this.addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @return
+     */
+    public static Operation create(NodeId nodeId) {
+        Operation lck = new LockRelease(nodeId);
+        return lck;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/LockRelease.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.observation.InternalEventListener;
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>Update</code>...
+ */
+public class Merge extends AbstractOperation {
+
+    private final NodeId nodeId;
+    private final String srcWorkspaceName;
+    private final boolean bestEffort;
+    private final InternalEventListener eventListener;
+
+    private Merge(NodeId nodeId, String srcWorkspaceName, boolean bestEffort, InternalEventListener eventListener) {
+        this.nodeId = nodeId;
+        this.srcWorkspaceName = srcWorkspaceName;
+        this.bestEffort = bestEffort;
+        this.eventListener = eventListener;
+
+        this.addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    public String getSourceWorkspaceName() {
+        return srcWorkspaceName;
+    }
+
+    public boolean bestEffort() {
+        return bestEffort;
+    }
+
+    public InternalEventListener getEventListener() {
+        return eventListener;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @param srcWorkspaceName
+     * @return
+     */
+    public static Operation create(NodeId nodeId, String srcWorkspaceName, boolean bestEffort, InternalEventListener eventListener) {
+        return new Merge(nodeId, srcWorkspaceName, bestEffort, eventListener);
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
+import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.MalformedPathException;
+import org.apache.jackrabbit.spi.NodeId;
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.lock.LockException;
+
+/**
+ * <code>Move</code>...
+ */
+public class Move extends AbstractOperation {
+
+    private static Logger log = LoggerFactory.getLogger(Move.class);
+
+    private final NodeId srcId;
+    private final NodeId srcParentId;
+    private final NodeId destParentId;
+    private final QName destName;
+
+    private Move(NodeId srcNodeId, NodeId srcParentId, NodeId destParentId, QName destName) {
+        srcId = srcNodeId;
+        this.srcParentId = srcParentId;
+        this.destParentId = destParentId;
+        this.destName = destName;
+        addAffectedItemId(srcNodeId);
+        addAffectedItemId(srcParentId);
+        addAffectedItemId(destParentId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return srcId;
+    }
+
+    public NodeId getSourceParentId() {
+        return srcParentId;
+    }
+
+    public NodeId getDestinationParentId() {
+        return destParentId;
+    }
+
+    public QName getDestinationName() {
+        return destName;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    public static Operation create(Path srcPath, Path destPath, ItemStateValidator validator) throws RepositoryException , NoSuchNodeTypeException {
+        // src must not be ancestor of destination
+        try {
+            if (srcPath.isAncestorOf(destPath)) {
+                String msg = "Invalid destination path: cannot be descendant of source path (" +validator.safeGetJCRPath(destPath) + "," + validator.safeGetJCRPath(srcPath) + ")";
+                log.debug(msg);
+                throw new RepositoryException(msg);
+            }
+        } catch (MalformedPathException e) {
+            String msg = "Invalid destination path: cannot be descendant of source path (" +validator.safeGetJCRPath(destPath) + "," + validator.safeGetJCRPath(srcPath) + ")";
+            log.debug(msg);
+            throw new RepositoryException(msg, e);
+        }
+        Path.PathElement destElement = destPath.getNameElement();
+        // destination must not contain an index
+        int index = destElement.getIndex();
+        if (index > org.apache.jackrabbit.name.Path.INDEX_UNDEFINED) {
+            // subscript in name element
+            String msg = "Invalid destination path: subscript in name element is not allowed (" + validator.safeGetJCRPath(destPath) + ")";
+            log.debug(msg);
+            throw new RepositoryException(msg);
+        }
+        // root node cannot be moved:
+        if (Path.ROOT.equals(srcPath) || Path.ROOT.equals(destPath)) {
+            String msg = "Cannot move the root node.";
+            log.debug(msg);
+            throw new RepositoryException(msg);
+        }
+
+        NodeId srcId = validator.getNodeId(srcPath);
+        NodeId srcParentId = validator.getNodeId(srcPath.getAncestor(1));
+        NodeId destParentId = validator.getNodeId(destPath.getAncestor(1));
+        Move move = new Move(srcId, srcParentId, destParentId, destElement.getName());
+        return move;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.RepositoryException;
+import org.apache.jackrabbit.spi.ItemId;
+import javax.jcr.version.VersionException;
+import java.util.Collection;
+
+/**
+ * <code>Operation</code>...
+ */
+public interface Operation {
+
+    /**
+     * Returns the name of <code>this</code> operation.
+     *
+     * @return the name of <code>this</code> operation.
+     */
+    public String getName();
+
+    /**
+     * Calls the appropriate <code>visit</code> method on <code>visitor</code>
+     * based on the type of this operation.
+     *
+     * @param visitor the visitor to call back.
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException;
+
+    /**
+     * A collection of {@link ItemId}s that are
+     * affected by this operation.
+     *
+     * @return collection of affected <code>ItemId</code>s.
+     */
+    public Collection getAffectedItemIds();
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/OperationVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/OperationVisitor.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/OperationVisitor.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/OperationVisitor.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.RepositoryException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.MergeException;
+import javax.jcr.version.VersionException;
+
+/**
+ * <code>OperationVisitor</code>...
+ */
+public interface OperationVisitor {
+
+    public void visit(AddNode operation) throws RepositoryException;
+
+    public void visit(AddProperty operation) throws RepositoryException;
+
+    public void visit(Remove operation) throws RepositoryException;
+
+    public void visit(SetMixin operation) throws RepositoryException;
+
+    public void visit(SetPropertyValue operation) throws RepositoryException;
+
+    public void visit(ReorderNodes operation) throws RepositoryException;
+
+    public void visit(Clone operation) throws NoSuchWorkspaceException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException;
+
+    public void visit(Copy operation) throws NoSuchWorkspaceException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException;
+
+    public void visit(Move operation) throws LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException;
+
+    public void visit(Update operation) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException;
+
+    public void visit(Checkout operation) throws RepositoryException, UnsupportedRepositoryOperationException;
+
+    public void visit(Checkin operation) throws UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException;
+
+    public void visit(Restore operation) throws VersionException, PathNotFoundException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException;
+
+    public void visit(Merge operation) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException;
+
+    public void visit(ResolveMergeConflict operation) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException;
+
+    public void visit(LockOperation operation) throws AccessDeniedException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException;
+
+    public void visit(LockRefresh operation) throws AccessDeniedException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException;
+
+    public void visit(LockRelease operation) throws AccessDeniedException, InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException;
+
+    public void visit(AddLabel operation) throws VersionException, RepositoryException;
+
+    public void visit(RemoveLabel operation) throws VersionException, RepositoryException;
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/OperationVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/OperationVisitor.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.state.ItemState;
+import org.apache.jackrabbit.spi.ItemId;
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+
+/**
+ * <code>Remove</code>...
+ */
+public class Remove extends AbstractOperation {
+
+    private ItemId removeId;
+    private NodeId parentId;
+
+    private Remove(ItemId removeId, NodeId parentId) {
+        this.removeId = removeId;
+        this.parentId = parentId;
+        addAffectedItemId(removeId);
+        addAffectedItemId(parentId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+
+    public ItemId getRemoveId() {
+        return removeId;
+    }
+
+    public NodeId getParentId() {
+        return parentId;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    public static Operation create(ItemState state) {
+        Remove rm = new Remove(state.getId(), state.getParentId());
+        return rm;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.name.QName;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>AddLabel</code>...
+ */
+public class RemoveLabel extends AbstractOperation {
+
+    private static Logger log = LoggerFactory.getLogger(RemoveLabel.class);
+
+    private final NodeId versionHistoryId;
+    private final NodeId versionId;
+    private final QName label;
+
+    private RemoveLabel(NodeId versionHistoryId, NodeId versionId, QName label) {
+        this.versionHistoryId = versionHistoryId;
+        this.versionId = versionId;
+        this.label = label;
+    }
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     * @throws RepositoryException
+     * @throws ConstraintViolationException
+     * @throws AccessDeniedException
+     * @throws ItemExistsException
+     * @throws NoSuchNodeTypeException
+     * @throws UnsupportedRepositoryOperationException
+     * @throws VersionException
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getVersionHistoryId() {
+        return versionHistoryId;
+    }
+
+    public NodeId getVersionId() {
+        return versionId;
+    }
+
+    public QName getLabel() {
+        return label;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param versionHistoryId
+     * @param versionId
+     * @param label
+     * @param moveLabel
+     * @return
+     */
+    public static Operation create(NodeId versionHistoryId, NodeId versionId, QName label) {
+        return new RemoveLabel(versionHistoryId, versionId, label);
+    }
+}

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.state.NodeState;
+import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.name.Path;
+
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.RepositoryException;
+import javax.jcr.version.VersionException;
+
+/**
+ * <code>ReorderNodes</code>...
+ */
+public class ReorderNodes extends AbstractOperation {
+
+    private final NodeId parentId;
+    private final NodeId insertId;
+    private final NodeId beforeId;
+
+    private ReorderNodes(NodeId parentId, NodeId insertId, NodeId beforeId) {
+        this.parentId = parentId;
+        this.insertId = insertId;
+        this.beforeId = beforeId;
+        addAffectedItemId(parentId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getParentId() {
+        return parentId;
+    }
+
+    public NodeId getInsertNodeId() {
+        return insertId;
+    }
+
+    public NodeId getBeforeNodeId() {
+        return beforeId;
+    }
+
+    //------------------------------------------------------------< Factory >---
+
+    public static Operation create(NodeState parentState, Path.PathElement srcName,
+                                   Path.PathElement beforeName) {
+        NodeId insertId = parentState.getChildNodeEntry(srcName.getName(), srcName.getNormalizedIndex()).getId();
+        NodeId beforeId = (beforeName == null) ? null : parentState.getChildNodeEntry(beforeName.getName(), beforeName.getNormalizedIndex()).getId();
+        Operation op = new ReorderNodes(parentState.getNodeId(), insertId, beforeId);
+        return op;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>ResolveMergeConflict</code>...
+ */
+public class ResolveMergeConflict extends AbstractOperation {
+
+    private final NodeId nodeId;
+    private final NodeId versionId;
+    private final boolean resolveDone;
+
+    private ResolveMergeConflict(NodeId nodeId, NodeId versionId, boolean resolveDone) {
+        this.nodeId = nodeId;
+        this.versionId = versionId;
+        this.resolveDone = resolveDone;
+
+        addAffectedItemId(nodeId);
+        addAffectedItemId(versionId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    public NodeId getVersionId() {
+        return versionId;
+    }
+
+    public boolean resolveDone() {
+        return resolveDone;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @param versionId
+     * @param resolveDone
+     */
+    public static Operation create(NodeId nodeId, NodeId versionId, boolean resolveDone) {
+        ResolveMergeConflict up = new ResolveMergeConflict(nodeId, versionId, resolveDone);
+        return up;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.lock.LockException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+
+/**
+ * <code>Update</code>...
+ */
+public class Restore extends AbstractOperation {
+
+    private final NodeId nodeId;
+    private final NodeId[] versionIds;
+    private final boolean removeExisting;
+
+    private Restore(NodeId nodeId, NodeId[] versionIds, boolean removeExisting) {
+        this.nodeId = nodeId;
+        this.versionIds = versionIds;
+        this.removeExisting = removeExisting;
+
+        addAffectedItemId(nodeId);
+        for (int i = 0; i < versionIds.length; i++) {
+            addAffectedItemId(versionIds[i]);
+        }
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    public NodeId[] getVersionIds() {
+        return versionIds;
+    }
+
+    public boolean removeExisting() {
+        return removeExisting;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @param versionId
+     * @return
+     */
+    public static Operation create(NodeId nodeId, NodeId versionId, boolean removeExisting) {
+        if (nodeId == null || versionId == null) {
+            throw new IllegalArgumentException("Neither nodeId nor versionId must be null.");
+        }
+        Restore up = new Restore(nodeId, new NodeId[] {versionId}, removeExisting);
+        return up;
+    }
+
+    /**
+     *
+     * @param versionIds
+     * @return
+     */
+    public static Operation create(NodeId[] versionIds, boolean removeExisting) {
+        if (versionIds == null) {
+            throw new IllegalArgumentException("Neither versionIds must not be null.");
+        }
+        Restore up = new Restore(null, versionIds, removeExisting);
+        return up;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.PropertyId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>SetMixin</code>...
+ */
+public class SetMixin extends AbstractOperation {
+
+    private final NodeId nodeId;
+    private final QName[] mixinNames;
+
+    private SetMixin(PropertyId propertyId, QName[] mixinNames) {
+        this.nodeId = propertyId.getParentId();
+        this.mixinNames = mixinNames;
+        addAffectedItemId(nodeId);
+        addAffectedItemId(propertyId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws AccessDeniedException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    public QName[] getMixinNames() {
+        return mixinNames;
+    }
+
+    //------------------------------------------------------------< Factory >---
+
+    public static Operation create(PropertyId mixinPropertyId, QName[] mixinNames) {
+        SetMixin sm = new SetMixin(mixinPropertyId, mixinNames);
+        return sm;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.jcr2spi.state.PropertyState;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.ValueFormatException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.value.QValue;
+
+import javax.jcr.version.VersionException;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+
+/**
+ * <code>SetPropertyValue</code>...
+ */
+public class SetPropertyValue extends AbstractOperation {
+
+    private final PropertyId propertyId;
+    private final QValue[] values;
+    private final int propertyType;
+    private final boolean isMultiValued;
+
+    private SetPropertyValue(PropertyId propertyId, int propertyType, QValue[] values, boolean isMultiValued) {
+        this.propertyId = propertyId;
+        this.propertyType = propertyType;
+        this.values = values;
+        this.isMultiValued = isMultiValued;
+        addAffectedItemId(propertyId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     *
+     * @param visitor
+     */
+    public void accept(OperationVisitor visitor) throws ValueFormatException, LockException, ConstraintViolationException, AccessDeniedException, ItemExistsException, UnsupportedRepositoryOperationException, VersionException, RepositoryException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public PropertyId getPropertyId() {
+        return propertyId;
+    }
+
+    public int getPropertyType() {
+        return propertyType;
+    }
+
+    public QValue[] getValues() {
+        return values;
+    }
+
+    public boolean isMultiValued() {
+        return isMultiValued;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    public static Operation create(PropertyState propState, QValue[] iva,
+                                   int valueType) {
+        SetPropertyValue sv = new SetPropertyValue(propState.getPropertyId(), valueType, iva, propState.isMultiValued());
+        return sv;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetPropertyValue.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.operation;
+
+import org.apache.jackrabbit.spi.NodeId;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ItemExistsException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.version.VersionException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+
+/**
+ * <code>Update</code>...
+ */
+public class Update extends AbstractOperation {
+
+    private final NodeId nodeId;
+    private final String srcWorkspaceName;
+
+    private Update(NodeId nodeId, String srcWorkspaceName) {
+        this.nodeId = nodeId;
+        this.srcWorkspaceName = srcWorkspaceName;
+
+        this.addAffectedItemId(nodeId);
+    }
+
+    //----------------------------------------------------------< Operation >---
+    /**
+     * @see Operation#accept(OperationVisitor)
+     */
+    public void accept(OperationVisitor visitor) throws RepositoryException, ConstraintViolationException, AccessDeniedException, ItemExistsException, NoSuchNodeTypeException, UnsupportedRepositoryOperationException, VersionException {
+        visitor.visit(this);
+    }
+
+    //----------------------------------------< Access Operation Parameters >---
+    public NodeId getNodeId() {
+        return nodeId;
+    }
+
+    public String getSourceWorkspaceName() {
+        return srcWorkspaceName;
+    }
+
+    //------------------------------------------------------------< Factory >---
+    /**
+     *
+     * @param nodeId
+     * @param srcWorkspaceName
+     * @return
+     */
+    public static Operation create(NodeId nodeId, String srcWorkspaceName) {
+        Update up = new Update(nodeId, srcWorkspaceName);
+        return up;
+    }
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Update.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Added: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/NodeIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/NodeIteratorImpl.java?rev=421270&view=auto
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/NodeIteratorImpl.java (added)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/NodeIteratorImpl.java Wed Jul 12 06:33:19 2006
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.jcr2spi.query;
+
+import org.apache.jackrabbit.jcr2spi.ItemManager;
+import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.IdIterator;
+import org.apache.jackrabbit.spi.ItemId;
+import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.spi.QueryInfo;
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Item;
+
+import java.util.NoSuchElementException;
+
+// DIFF JR: this class uses a different package than the jackrabbit original
+/**
+ * Implements a {@link javax.jcr.NodeIterator} returned by
+ * {@link javax.jcr.query.QueryResult#getNodes()}.
+ */
+class NodeIteratorImpl implements ScoreNodeIterator {
+
+    /** Logger instance for this class */
+    private static final Logger log = LoggerFactory.getLogger(NodeIteratorImpl.class);
+
+    /** ItemManager to turn Ids into Node instances */
+    protected final ItemManager itemMgr;
+
+    /** The namespace resolver */
+    protected final NamespaceResolver resolver;
+
+    /** The query result info */
+    protected final QueryInfo queryInfo;
+
+    /** The ItemId's of the result nodes */
+    protected final IdIterator ids;
+
+    /** Index of the jcr:score column. */
+    protected final int scoreIndex;
+
+    /** Current position of this node iterator */
+    protected int pos = -1;
+
+    /** Number of invalid nodes */
+    protected int invalid = 0;
+
+    /** Id of the next Node */
+    private NodeId nextId;
+
+    /** Reference to the next node instance */
+    private Node next;
+
+    /**
+     * Creates a new <code>NodeIteratorImpl</code> instance.
+     *
+     * @param itemMgr   the <code>ItemManager</code> to turn Id's into
+     *                  <code>Node</code> instances.
+     * @param resolver  the namespace resolver.
+     * @param queryInfo the query result.
+     * @throws RepositoryException if an error occurs while creating a node
+     *                             iterator.
+     */
+    // DIFF JR: use QueryInfo instead of UUID String[]
+    NodeIteratorImpl(ItemManager itemMgr,
+                     NamespaceResolver resolver,
+                     QueryInfo queryInfo) throws RepositoryException {
+        this.itemMgr = itemMgr;
+        this.resolver = resolver;
+        this.queryInfo = queryInfo;
+        this.ids = queryInfo.getNodeIds();
+        QName[] columnNames = queryInfo.getColumnNames();
+        int idx = -1;
+        for (int i = 0; i < columnNames.length; i++) {
+            if (columnNames[i].getNamespaceURI().equals(QName.NS_JCR_URI)
+                    && columnNames[i].getLocalName().startsWith(QName.JCR_SCORE.getLocalName())) {
+                idx = i;
+                break;
+            }
+        }
+        if (idx == -1) {
+            throw new RepositoryException("no jcr:score column in query result");
+        }
+        this.scoreIndex = idx;
+        fetchNext();
+    }
+
+    /**
+     * Returns the next <code>Node</code> in the result set.
+     *
+     * @return the next <code>Node</code> in the result set.
+     * @throws NoSuchElementException if iteration has no more
+     *   <code>Node</code>s.
+     */
+    public Node nextNode() throws NoSuchElementException {
+        if (next == null) {
+            throw new NoSuchElementException();
+        }
+        Node n = next;
+        fetchNext();
+        return n;
+    }
+
+    /**
+     * Returns the next <code>Node</code> in the result set.
+     *
+     * @return the next <code>Node</code> in the result set.
+     * @throws NoSuchElementException if iteration has no more
+     *   <code>Node</code>s.
+     */
+    public Object next() throws NoSuchElementException {
+        return nextNode();
+    }
+
+    /**
+     * Skip a number of <code>Node</code>s in this iterator.
+     *
+     * @param skipNum the non-negative number of <code>Node</code>s to skip
+     * @throws NoSuchElementException
+     *          if skipped past the last <code>Node</code> in this iterator.
+     */
+    public void skip(long skipNum) throws NoSuchElementException {
+        if (skipNum < 0) {
+            throw new IllegalArgumentException("skipNum must not be negative");
+        }
+        if (skipNum == 0) {
+            // do nothing
+        } else {
+            ids.skip(skipNum - 1);
+            pos += skipNum - 1;
+            fetchNext();
+        }
+    }
+
+    /**
+     * Returns the number of nodes in this iterator.
+     * </p>
+     * Note: The number returned by this method may differ from the number
+     * of nodes actually returned by calls to hasNext() / getNextNode()! This
+     * is because this iterator works on a lazy instantiation basis and while
+     * iterating over the nodes some of them might have been deleted in the
+     * meantime. Those will not be returned by getNextNode(). As soon as an
+     * invalid node is detected, the size of this iterator is adjusted.
+     *
+     * @return the number of node in this iterator.
+     */
+    public long getSize() {
+        if (ids.getSize() != -1) {
+            return ids.getSize() - invalid;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * Returns the current position in this <code>NodeIterator</code>.
+     *
+     * @return the current position in this <code>NodeIterator</code>.
+     */
+    public long getPosition() {
+        return pos - invalid;
+    }
+
+    /**
+     * Returns <code>true</code> if there is another <code>Node</code>
+     * available; <code>false</code> otherwise.
+     *
+     * @return <code>true</code> if there is another <code>Node</code>
+     *  available; <code>false</code> otherwise.
+     */
+    public boolean hasNext() {
+        return next != null;
+    }
+
+    /**
+     * @throws UnsupportedOperationException always.
+     */
+    public void remove() {
+        throw new UnsupportedOperationException("remove");
+    }
+
+    /**
+     * Returns the score of the node returned by {@link #nextNode()}. In other
+     * words, this method returns the score value of the next <code>Node</code>.
+     * 
+     * @return the score of the node returned by {@link #nextNode()}.
+     * @throws NoSuchElementException if there is no next node.
+     */
+    public float getScore() throws NoSuchElementException {
+        if (!hasNext()) {
+            throw new NoSuchElementException();
+        }
+        String scoreString = queryInfo.getValues(nextId)[scoreIndex];
+        try {
+            return Float.parseFloat(scoreString);
+        } catch (NumberFormatException e) {
+            throw new NoSuchElementException();
+        }
+    }
+
+    /**
+     * Clears {@link #next} and tries to fetch the next Node instance.
+     * When this method returns {@link #next} refers to the next available
+     * node instance in this iterator. If {@link #next} is null when this
+     * method returns, then there are no more valid element in this iterator.
+     */
+    private void fetchNext() {
+        // reset
+        next = null;
+        while (next == null && ids.hasNext()) {
+            try {
+                ItemId id = ids.nextId();
+                if (!id.denotesNode()) {
+                    log.error("NodeId expected. Found PropertyId: " + id);
+                    continue;
+                }
+                nextId = (NodeId)id;
+                Item tmp = itemMgr.getItem(nextId);
+
+                if (tmp.isNode()) {
+                    next = (Node) tmp;
+                } else {
+                    log.warn("Item with Id is not a Node: " + nextId);
+                    // try next
+                    invalid++;
+                    pos++;
+                }
+            } catch (Exception e) {
+                log.error("Exception retrieving Node with Id: " + nextId);
+                // try next
+                invalid++;
+                pos++;
+            }
+        }
+        pos++;
+    }
+}

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/NodeIteratorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/NodeIteratorImpl.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url



Mime
View raw message