Examples of execute()


Examples of org.apache.jackrabbit.mongomk.api.command.CommandExecutor.execute()

            Runnable runnable = new Runnable() {

                @Override
                public void run() {
                    try {
                        String revisionId = commandExecutor.execute(command);
                        revisionIds.add(revisionId);
                    } catch (Exception e) {
                        revisionIds.add(null);
                    }
                }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.command.CommitCommandMongo.execute()

        Commit commit = new CommitImpl("/",
                "+a : { \"int\" : 1 , \"b\" : { \"string\" : \"foo\" } , \"c\" : { \"bool\" : true } } }",
                "This is the simple node scenario with nodes /, /a, /a/b, /a/c", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();

        return revisionId;
    }

    public String addChildrenToA(int count) throws Exception {
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.command.GetBlobLengthCommandMongo.execute()

    public void testGetBlobLength() throws Exception {
        int blobLength = 100;
        String blobId = createAndWriteBlob(blobLength);

        GetBlobLengthCommandMongo command = new GetBlobLengthCommandMongo(mongoConnection, blobId);
        long length = command.execute();
        assertEquals(blobLength, length);
    }

    @Test
    public void testNonExistantBlobLength() throws Exception {
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.command.GetHeadRevisionCommandMongo.execute()

    public void testGeadHeadRevisionSimple() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
        String revisionId = scenario.create();

        GetHeadRevisionCommandMongo command = new GetHeadRevisionCommandMongo(mongoConnection);
        String revisionId2 = command.execute();
        assertTrue(revisionId.equals(revisionId2));

        scenario.delete_A();
        String revisionId3 = command.execute();
        assertFalse(revisionId3.equals(revisionId2));
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.command.ReadBlobCommandMongo.execute()

    @Test
    public void testReadBlobComplete() throws Exception {
        byte[] buffer = new byte[blob.length];
        ReadBlobCommandMongo command = new ReadBlobCommandMongo(mongoConnection, blobId, 0, buffer, 0, blob.length);
        int totalBytes = command.execute();

        Assert.assertEquals(blob.length, totalBytes);
        Assert.assertTrue(Arrays.equals(blob, buffer));
    }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.command.WriteBlobCommandMongo.execute()

        int blobLength = 100;
        byte[] blob = createBlob(blobLength);

        WriteBlobCommandMongo command = new WriteBlobCommandMongo(mongoConnection,
                new ByteArrayInputStream(blob));
        String blobId = command.execute();
        assertNotNull(blobId);

        byte[] readBlob = new byte[blobLength];
        readBlob(blobId, readBlob);
        assertTrue(Arrays.equals(blob, readBlob));
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.action.FetchCommitAction.execute()

        if (baseRevisionId == null) {
            return;
        }

        FetchCommitAction action = new FetchCommitAction(nodeStore, baseRevisionId);
        MongoCommit commit = action.execute();
        branchId = commit.getBranchId();
    }

    private void createMongoNodes() throws Exception {
        CommitCommandInstructionVisitor visitor = new CommitCommandInstructionVisitor(
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.action.FetchCommitsAction.execute()

     * @param branchId
     * @return
     */
    private String getNonConflictingCommitsDiff(long currentHead, long branchRootId, String branchId) {
        FetchCommitsAction action = new FetchCommitsAction(nodeStore, branchRootId + 1, currentHead);
        List<MongoCommit> commits = action.execute();

        Set<String> affectedPathsBranch = new HashSet<String>();
        Set<String> affectedPathsTrunk = new HashSet<String>();
        StringBuilder diff = new StringBuilder();

View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.action.FetchHeadRevisionIdAction.execute()

        }
    }

    private long getHeadRevision() throws Exception {
        FetchHeadRevisionIdAction query = new FetchHeadRevisionIdAction(nodeStore);
        return query.execute();
    }
}
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.action.FetchNodesAction.execute()

    private void readNodesByPath() {
        FetchNodesAction query = new FetchNodesAction(nodeStore, path, revisionId);
        query.setBranchId(branchId);
        query.setValidCommits(lastCommits);
        query.setDepth(depth);
        pathAndNodeMap = query.execute();
    }

    private boolean verifyNodeHierarchy() {
        boolean verified = verifyNodeHierarchyRec(path, 0);
        if (!verified) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.