switch (request.conflictBehavior()) { case APPEND: node = txn.addChild(workspace, parentNode, request.named(), -1, uuid, propsToStore); break; case DO_NOT_REPLACE: node = txn.getFirstChild(workspace, parentNode, request.named()); if (node == null) { node = txn.addChild(workspace, parentNode, request.named(), -1, uuid, propsToStore); node = txn.getFirstChild(workspace, parentNode, request.named()); if (node != null) { List<NodeType> children = txn.getChildren(workspace, node); node = txn.addChild(workspace, parentNode, request.named(), -1, uuid, propsToStore); node = txn.getFirstChild(workspace, parentNode, request.named()); if (node == null) { node = txn.addChild(workspace, parentNode, request.named(), -1, uuid, propsToStore); } else {
protected void assertNextRequestIsCreate( Location parent, String child, Property... properties ) { Name name = context.getValueFactories().getNameFactory().create(child); Request request = executedRequests.poll(); assertThat(request, is(instanceOf(CreateNodeRequest.class))); CreateNodeRequest create = (CreateNodeRequest)request; assertThat(create.under(), is(parent)); assertThat(create.named(), is(name)); assertThat(create.properties(), hasItems(properties)); }
node = workspace.createNode(getExecutionContext(), parentNode, request.named(), uuid, propsToStore); break; case DO_NOT_REPLACE: for (MapNode child : parentNode.getChildren()) { if (request.named().equals(child.getName().getName())) { node = child; break; node = workspace.createNode(getExecutionContext(), parentNode, request.named(), uuid, propsToStore); node = getTargetNode(workspace, null, Location.create(pathFactory.create(parent, request.named()), uuid)); if (node != null) { workspace.removeNode(getExecutionContext(), node); node = workspace.createNode(getExecutionContext(), parentNode, request.named(), uuid, propsToStore); break; case UPDATE: node = getTargetNode(workspace, null, Location.create(pathFactory.create(parent, request.named()), uuid)); if (node == null) { node = workspace.createNode(getExecutionContext(), parentNode, request.named(), uuid, propsToStore);
Path parentPath = createNode.under().getPath(); assertThat(parentPath, is(expectedPath.getParent())); assertThat(createNode.named(), is(expectedPath.getLastSegment().getName()));
switch (conflictBehavior) { case APPEND: node = newWorkspace.createNode(getExecutionContext(), parentNode, request.named(), propsToStore, conflictBehavior); break; case DO_NOT_REPLACE: for (Segment childSegment : parentNode.getChildSegments()) { if (request.named().equals(childSegment.getName())) { Path childPath = pathFactory.create(parent, childSegment); node = newWorkspace.getNode(childPath); node = newWorkspace.createNode(getExecutionContext(), parentNode, request.named(), propsToStore, conflictBehavior); node = workspace.getNode(pathFactory.create(parent, request.named())); if (node != null) { newWorkspace.removeNode(getExecutionContext(), node.getPath()); node = newWorkspace.createNode(getExecutionContext(), parentNode, request.named(), propsToStore, conflictBehavior); break; case UPDATE: node = newWorkspace.getNode(pathFactory.create(parent, request.named())); if (node == null) { node = newWorkspace.createNode(getExecutionContext(), parentNode, request.named(),
Path parentPath = request.under().getPath(); assertThat(parentPath, is(expectedPath.getParent())); assertThat(request.named(), is(expectedPath.getLastSegment().getName()));
Path parentPath = propertyRequest.under().getPath(); assertThat(parentPath, is(expectedPath.getParent())); assertThat(propertyRequest.named(), is(expectedPath.getLastSegment().getName()));
@Override public void process( CreateNodeRequest request ) { // Just update the actual location ... Location parent = actualLocationOf(request.under()); // just make sure it has a path ... Name name = request.named(); Path childPath = context.getValueFactories().getPathFactory().create(parent.getPath(), name); request.setActualLocationOfNode(Location.create(childPath)); }
request.named(), request.conflictBehavior(), request.properties()); federatedRequest.add(pushDownRequest, proxy.isSameLocationAsOriginal(), false, proxy.projection()); if (parent.hasPath()) { PathFactory pathFactory = getExecutionContext().getValueFactories().getPathFactory(); Path childPath = pathFactory.create(parent.getPath(), request.named()); Location childLocation = Location.create(childPath); projectedNode = project(childLocation, request.inWorkspace(), request, true); String msg = GraphI18n.unableToCreateNodeUnderPlaceholder.text(readable(request.named()), readable(request.under()), request.inWorkspace(),