private StringBuilder buildBeforeIdentifier(StringBuilder identifier) { String uuid = before.getString(JCR_UUID); if (uuid != null) { identifier.append(uuid); } else if (parent != null) { parent.buildBeforeIdentifier(identifier); identifier.append("/").append(name); } return identifier; }
public static Iterable<String> getStrings(NodeState node, String propertyName) { if (!node.hasProperty(propertyName)) { return null; } PropertyState s = node.getProperty(propertyName); if (s.isArray()) { return node.getStrings(propertyName); } return Collections.singleton(node.getString(propertyName)); }
AcEntry(@NotNull NodeState node, @NotNull String accessControlledPath, int index, boolean isAllow, @NotNull PrivilegeBits privilegeBits, @NotNull Set<Restriction> restrictions) { this.accessControlledPath = accessControlledPath; this.index = index; this.principalName = Text.escapeIllegalJcrChars(node.getString(REP_PRINCIPAL_NAME)); this.privilegeBits = privilegeBits; this.isAllow = isAllow; this.restrictions = restrictions; }
public static Iterable<String> getStrings(NodeState node, String propertyName) { if (!node.hasProperty(propertyName)) { return null; } PropertyState s = node.getProperty(propertyName); if (s.isArray()) { return node.getStrings(propertyName); } return Collections.singleton(node.getString(propertyName)); }
private StringBuilder buildBeforeIdentifier(StringBuilder identifier) { String uuid = before.getString(JCR_UUID); if (uuid != null) { identifier.append(uuid); } else if (parent != null) { parent.buildBeforeIdentifier(identifier); identifier.append("/").append(name); } return identifier; }
private StringBuilder buildAfterIdentifier(StringBuilder identifier) { String uuid = after.getString(JCR_UUID); if (uuid != null) { identifier.append(uuid); } else if (parent != null) { parent.buildAfterIdentifier(identifier); identifier.append("/").append(name); } return identifier; }
@Override public Editor childNodeAdded(String name, NodeState after) { String uuid = after.getString(JCR_UUID); if (!isReindex && uuid != null) { newIds.add(uuid); } return new ReferenceEditor(this, name); }
AcEntry(@NotNull NodeState node, @NotNull String accessControlledPath, int index, boolean isAllow, @NotNull PrivilegeBits privilegeBits, @NotNull Set<Restriction> restrictions) { this.accessControlledPath = accessControlledPath; this.index = index; this.principalName = Text.escapeIllegalJcrChars(node.getString(REP_PRINCIPAL_NAME)); this.privilegeBits = privilegeBits; this.isAllow = isAllow; this.restrictions = restrictions; }
private StringBuilder buildBeforeIdentifier(StringBuilder identifier) { String uuid = before.getString(JCR_UUID); if (uuid != null) { identifier.append(uuid); } else if (parent != null) { parent.buildBeforeIdentifier(identifier); identifier.append("/").append(name); } return identifier; }
private String getIndexType(String indexPath) { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); String type = idxState.getString(IndexConstants.TYPE_PROPERTY_NAME); if (type == null || "disabled".equals(type)){ return null; } return type; }
private String getIndexType(String indexPath) { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); String type = idxState.getString(IndexConstants.TYPE_PROPERTY_NAME); if (type == null || "disabled".equals(type)){ return null; } return type; }
public IdentifierTracker getChildTracker(String name, NodeState state) { String uuid = state.getString(JCR_UUID); if (uuid != null && !referenceable.apply(state)) { uuid = null; // discard jcr:uuid value of a non-referenceable node } return new IdentifierTracker(this, name, uuid); }
public IdentifierTracker(NodeState root) { this.referenceable = new TypePredicate(root, MIX_REFERENCEABLE); this.parent = null; this.name = null; String uuid = root.getString(JCR_UUID); if (uuid != null && referenceable.apply(root)) { this.identifier = uuid; } else { this.identifier = "/"; } }
@Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(PropertyIndexEditorProvider.TYPE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'property'", indexPath); PropertyIndexInfo info = new PropertyIndexInfo(indexPath); computeCountEstimate(info, idxState); return info; }
@Override public IndexInfo getInfo(String indexPath) throws IOException { NodeState idxState = NodeStateUtils.getNode(nodeStore.getRoot(), indexPath); checkArgument(LuceneIndexConstants.TYPE_LUCENE.equals(idxState.getString(IndexConstants.TYPE_PROPERTY_NAME)), "Index definition at [%s] is not of type 'lucene'", indexPath); LuceneIndexInfo info = new LuceneIndexInfo(indexPath); computeSize(idxState, info); computeIndexDefinitionChange(idxState, info); computeLastUpdatedTime(idxState, info); computeAsyncIndexInfo(idxState, indexPath, info); return info; }
private void verifyMetadata() { NodeState root = destination.getRoot(); assertTrue(root.hasProperty(PROP_REVISION)); assertTrue(root.hasProperty(PROP_LAST_REV)); RevisionVector.fromString(root.getString(PROP_REVISION)); Revision.fromString(root.getString(PROP_LAST_REV)); NodeState appsNode = destination.getRoot().getChildNode("apps"); assertTrue(appsNode.hasProperty(PROP_LAST_REV)); Revision.fromString(appsNode.getString(PROP_LAST_REV)); }
@Test public void testChangesAreLocalForSplitRepository() throws CommitFailedException { NodeBuilder builder = split.getRoot().builder(); builder.child("foo").child("bar").setProperty("version", "v2"); split.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); assertEquals("v1", base.getRoot().getChildNode("foo").getChildNode("bar").getString("version")); }