Index: oak-mongomk-api/src/main/java/org/apache/jackrabbit/mongomk/api/command/AbstractCommand.java
===================================================================
--- oak-mongomk-api/src/main/java/org/apache/jackrabbit/mongomk/api/command/AbstractCommand.java (revision 1387935)
+++ oak-mongomk-api/src/main/java/org/apache/jackrabbit/mongomk/api/command/AbstractCommand.java (working copy)
@@ -1,42 +0,0 @@
-/*
- * 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.mongomk.api.command;
-
-/**
- * Base implementation of {@link Command}.
- *
- * @param
- * Since binary storage and node storage most likely use different backend technologies two separate interfaces for
- * these operations are provided.
- *
- * This interface is not only a partly {@code MicroKernel} but also provides a different layer of abstraction by
- * converting the {@link String} parameters into higher level objects to ease the development for implementors of the
- * {@code MicroKernel}.
- *
- * The implementation of this class contains the business logic to execute a command. - *
- * - * @see Command Pattern - * @see Command - * - * @author JSOP diff of this commit. - * - * @return The {@link String} representing the diff. - */ - String getDiff(); - - /** - * Returns the {@link List} of {@link Instruction}s which were created from the diff. - * - * @see #getDiff() - * - * @return The {@link List} of {@link Instruction}s. - */ - List- * Each operation is a concrete subinterface of {@code Instruction} and extending it by the specific properties of the - * operation. There is no exact 1 : 1 mapping between a {@code JSOP} operation and a subinterface, i.e. in {@code JSOP} - * there is one add operation for adding nodes and properties whereas there are two specific subinterfaces; one for - * adding a node and one for adding a property. - *
- * - * @author "+" STRING ":" (ATOM | ARRAY) - */ - public interface AddPropertyInstruction extends Instruction { - - /** - * Returns the key of the property to add. - * - * @return The key. - */ - String getKey(); - - /** - * Returns the value of the property to add. - * - * @return The value. - */ - Object getValue(); - } - - /** - * The copy node operation => "*" STRING ":" STRING - */ - public interface CopyNodeInstruction extends Instruction { - - /** - * Returns the destination path. - * - * @return the destination path. - */ - String getDestPath(); - - /** - * Returns the source path. - * - * @return the source path. - */ - String getSourcePath(); - } - - /** - * The move node operation => ">" STRING ":" STRING - */ - public interface MoveNodeInstruction extends Instruction { - - /** - * Returns the destination path. - * - * @return the destination path. - */ - String getDestPath(); - - /** - * Returns the source path. - * - * @return the source path. - */ - String getSourcePath(); - } - - /** - * The remove node operation => "-" STRING - */ - public interface RemoveNodeInstruction extends Instruction { - } - - /** - * The set property operation => "^" STRING ":" ATOM | ARRAY - */ - public interface SetPropertyInstruction extends Instruction { - - /** - * Returns the key of the property to set. - * - * @return The key. - */ - String getKey(); - - /** - * Returns the value of the property to set. - * - * @return The value. - */ - Object getValue(); - } -} \ No newline at end of file Index: oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java =================================================================== --- oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java (revision 1387935) +++ oak-mongomk-impl/src/test/java/org/apache/jackrabbit/mongomk/impl/InstructionAssert.java (working copy) @@ -1,74 +0,0 @@ -/* - * 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.mongomk.impl; - -import static junit.framework.Assert.assertEquals; - -import org.apache.jackrabbit.mongomk.api.model.Instruction.AddNodeInstruction; -import org.apache.jackrabbit.mongomk.api.model.Instruction.AddPropertyInstruction; -import org.apache.jackrabbit.mongomk.api.model.Instruction.CopyNodeInstruction; -import org.apache.jackrabbit.mongomk.api.model.Instruction.MoveNodeInstruction; -import org.apache.jackrabbit.mongomk.api.model.Instruction.RemoveNodeInstruction; -import org.apache.jackrabbit.mongomk.api.model.Instruction.SetPropertyInstruction; - - -/** - * @author Visitor to iterate through a list of - * {@code Instruction}s without the need to use {@code instanceof} on each item. - */ -public interface InstructionVisitor { - - /** - * Visits a {@code AddNodeInstruction}. - * - * @param instruction - * The instruction. - */ - void visit(AddNodeInstruction instruction); - - /** - * Visits a {@code AddPropertyInstruction}. - * - * @param instruction The instruction. - */ - void visit(AddPropertyInstruction instruction); - - /** - * Visits a {@code CopyNodeInstruction}. - * - * @param instruction The instruction. - */ - void visit(CopyNodeInstruction instruction); - - /** - * Visits a {@code MoveNodeInstruction}. - * - * @param instruction The instruction. - */ - void visit(MoveNodeInstruction instruction); - - /** - * Visits a {@code RemoveNodeInstruction}. - * - * @param instruction The instruction. - */ - void visit(RemoveNodeInstruction instruction); - - /** - * Visits a {@code SetPropertyInstruction}. - * - * @param instruction The instruction. - */ - void visit(SetPropertyInstruction instruction); -} \ No newline at end of file Index: oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java =================================================================== --- oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java (revision 1387935) +++ oak-mongomk-impl/src/main/java/org/apache/jackrabbit/mongomk/impl/json/JsonUtil.java (working copy) @@ -1,141 +0,0 @@ -/* - * 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.mongomk.impl.json; - -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.apache.jackrabbit.mk.json.JsopBuilder; -import org.apache.jackrabbit.mongomk.api.model.Node; -import org.apache.jackrabbit.mongomk.impl.NodeFilter; -import org.json.JSONArray; -import org.json.JSONObject; - - -/** - * FIXME - [Mete] This should really merge with MicroKernelImpl#toJson. - * - * JSON related utility classes. - * - * @author properties = node.getProperties(); - if (properties != null) { - for (Map.Entry