@NotNull public Oak with(@NotNull ThreeWayConflictHandler conflictHandler) { checkNotNull(conflictHandler); withEditorHook(); if (this.conflictHandler == null) { if (conflictHandler instanceof CompositeConflictHandler) { this.conflictHandler = (CompositeConflictHandler) conflictHandler; } else { this.conflictHandler = new CompositeConflictHandler(); this.conflictHandler.addHandler(conflictHandler); } commitHooks.add(new ConflictHook(conflictHandler)); } else { this.conflictHandler.addHandler(conflictHandler); } return this; }
/** * The conflict handler is a composite of * {@link JcrLastModifiedConflictHandler}, {@link ChildOrderConflictHandler} * and {@link AnnotatingConflictHandler}. */ public static CompositeConflictHandler createJcrConflictHandler() { return new CompositeConflictHandler(ImmutableList.of( new JcrLastModifiedConflictHandler(), ConflictHandlers.wrap(new ChildOrderConflictHandler()), new AnnotatingConflictHandler())); }
@Nonnull public final Jcr with(@Nonnull ThreeWayConflictHandler conflictHandler) { ensureRepositoryIsNotCreated(); this.conflictHandler.addHandler(checkNotNull(conflictHandler)); return this; }
/** * The conflict handler is a composite of * {@link JcrLastModifiedConflictHandler}, {@link ChildOrderConflictHandler} * and {@link AnnotatingConflictHandler}. */ public static CompositeConflictHandler createJcrConflictHandler() { return new CompositeConflictHandler(ImmutableList.of( new JcrLastModifiedConflictHandler(), ConflictHandlers.wrap(new ChildOrderConflictHandler()), new AnnotatingConflictHandler())); }
@NotNull public final Jcr with(@NotNull ThreeWayConflictHandler conflictHandler) { ensureRepositoryIsNotCreated(); this.conflictHandler.addHandler(checkNotNull(conflictHandler)); return this; }
@Nonnull public Oak with(@Nonnull ThreeWayConflictHandler conflictHandler) { checkNotNull(conflictHandler); withEditorHook(); if (this.conflictHandler == null) { if (conflictHandler instanceof CompositeConflictHandler) { this.conflictHandler = (CompositeConflictHandler) conflictHandler; } else { this.conflictHandler = new CompositeConflictHandler(); this.conflictHandler.addHandler(conflictHandler); } commitHooks.add(new ConflictHook(conflictHandler)); } else { this.conflictHandler.addHandler(conflictHandler); } return this; }
/** * The conflict handler is a composite of * {@link JcrLastModifiedConflictHandler}, {@link ChildOrderConflictHandler} * and {@link AnnotatingConflictHandler}. */ public static CompositeConflictHandler createJcrConflictHandler() { return new CompositeConflictHandler(ImmutableList.of( new JcrLastModifiedConflictHandler(), ConflictHandlers.wrap(new ChildOrderConflictHandler()), new AnnotatingConflictHandler())); }
@NotNull public final Jcr with(@NotNull ThreeWayConflictHandler conflictHandler) { ensureRepositoryIsNotCreated(); this.conflictHandler.addHandler(checkNotNull(conflictHandler)); return this; }
@NotNull public Oak with(@NotNull ThreeWayConflictHandler conflictHandler) { checkNotNull(conflictHandler); withEditorHook(); if (this.conflictHandler == null) { if (conflictHandler instanceof CompositeConflictHandler) { this.conflictHandler = (CompositeConflictHandler) conflictHandler; } else { this.conflictHandler = new CompositeConflictHandler(); this.conflictHandler.addHandler(conflictHandler); } commitHooks.add(new ConflictHook(conflictHandler)); } else { this.conflictHandler.addHandler(conflictHandler); } return this; }
@Before public void setUp() { repository = new Oak(store) .with(new OpenSecurityProvider()) .with(new CompositeConflictHandler(ImmutableList.of( ConflictHandlers.wrap(new ChildOrderConflictHandler() { /** * Allow deleting changed node. * See {@link TreeTest#removeWithConcurrentOrderBefore()} */ @Override public Resolution deleteChangedNode(NodeBuilder parent, String name, NodeState theirs) { return Resolution.OURS; } }), new AnnotatingConflictHandler() ))) .with(new ConflictValidatorProvider()) .createContentRepository(); }