/** * Returns the node state from the time this root was created, that * is this root's base state. * * @return base node state */ @Nonnull NodeState getBaseState() { return builder.getBaseState(); }
/** * Returns the node state from the time this root was created, that * is this root's base state. * * @return base node state */ @NotNull NodeState getBaseState() { return builder.getBaseState(); }
/** * Returns the node state from the time this root was created, that * is this root's base state. * * @return base node state */ @NotNull NodeState getBaseState() { return builder.getBaseState(); }
@Override @NotNull public NodeState getBaseState() { return new SecureNodeState(builder.getBaseState(), getTreePermission()); }
@Override @NotNull public NodeState getBaseState() { return new SecureNodeState(builder.getBaseState(), getTreePermission()); }
private void assertNoChange(MountedNodeStore mountedNodeStore, NodeBuilder partialBuilder) throws CommitFailedException { NodeState baseState = partialBuilder.getBaseState(); NodeState nodeState = partialBuilder.getNodeState(); if (!nodeState.equals(baseState)) { Set<String> changedPaths = getModifiedPaths(baseState, nodeState); if (!changedPaths.isEmpty()) { throw new CommitFailedException("CompositeStore", 31, "Unable to perform changes on read-only mount " + mountedNodeStore.getMount().getName() + ". Failing paths: " + changedPaths.toString()); } } }
@Override public CompositeNodeState getBaseState() { return new CompositeNodeState(getPath(), nodeBuilders.getAndApply((mns, b) -> b.getBaseState()), ctx); }
@Test public void testGetBaseStateNonAccessible() { NodeState ns = secureNodeBuilder.getChildNode(NAME_NON_ACCESSIBLE).getBaseState(); assertTrue(ns instanceof SecureNodeState); }
private void commit() throws Exception { root = HOOK.processCommit(rootBuilder.getBaseState(), rootBuilder.getNodeState(), EMPTY); rootBuilder = root.builder(); }
public int clean(NodeBuilder builder, long lastIndexedTo) { int removalCount = 0; NodeState baseState = builder.getBaseState(); for (ChildNodeEntry e : baseState.getChildNodeEntries()) { long entryCreationTime = e.getNodeState().getLong(PROP_CREATED); if (entryCovered(entryCreationTime, lastIndexedTo)) { builder.child(e.getName()).remove(); removalCount++; } } return removalCount; }
@Test public void existingChildTest() { NodeBuilder rootBuilder = base.builder(); NodeBuilder x = rootBuilder.child("x"); assertTrue(x.exists()); assertTrue(x.getBaseState().exists()); }
@Test public void testGetBaseStateNonExisting() { NodeState ns = secureNodeBuilder.getChildNode(NAME_NON_EXISTING).getBaseState(); assertTrue(ns instanceof SecureNodeState); }
@Test public void testUnmodifiedEqualsBase() { NodeBuilder root = base.builder(); NodeBuilder x = root.child("x"); assertEquals(x.getBaseState(), x.getNodeState()); }
@Test public void addExistingChildTest() { NodeBuilder rootBuilder = base.builder(); NodeBuilder x = rootBuilder.setChildNode("x"); assertTrue(x.exists()); assertTrue(x.getBaseState().exists()); }
@Test public void rebaseInvariant() { NodeBuilder root = store.getRoot().builder(); NodeBuilder added = root.setChildNode("added"); NodeState base = root.getBaseState(); store.rebase(root); assertEquals(base, root.getBaseState()); }
public int clean(NodeBuilder builder, long lastIndexedTo) { int removalCount = 0; NodeState baseState = builder.getBaseState(); for (ChildNodeEntry e : baseState.getChildNodeEntries()) { long entryCreationTime = e.getNodeState().getLong(PROP_CREATED); if (entryCovered(entryCreationTime, lastIndexedTo)) { builder.child(e.getName()).remove(); removalCount++; } } return removalCount; }
private void commit() throws Exception { root = HOOK.processCommit(rootBuilder.getBaseState(), rootBuilder.getNodeState(), EMPTY); rootBuilder = root.builder(); }
private void commit() throws Exception { root = HOOK.processCommit(rootBuilder.getBaseState(), rootBuilder.getNodeState(), EMPTY); rootBuilder = root.builder(); }
private void commit() throws Exception { root = HOOK.processCommit(rootBuilder.getBaseState(), rootBuilder.getNodeState(), EMPTY); rootBuilder = root.builder(); }
@Test public void rebase() throws CommitFailedException { NodeBuilder root = store.getRoot().builder(); modify(store); store.rebase(root); assertEquals(store.getRoot(), root.getBaseState()); }