/** * {@inheritDoc} * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals( Object obj ) { if (obj == this) return true; if (this.getClass().isInstance(obj)) { ReadAllChildrenRequest that = (ReadAllChildrenRequest)obj; if (!this.of().isSame(that.of())) return false; if (!this.inWorkspace().equals(that.inWorkspace())) return false; return true; } return false; }
@Test public void shouldCreateValidRequestWithValidLocation() { request = new ReadAllChildrenRequest(validPathLocation1, workspace1); assertThat(request.of(), is(sameInstance(validPathLocation1))); assertThat(request.inWorkspace(), is(sameInstance(workspace1))); assertThat(request.hasError(), is(false)); assertThat(request.getError(), is(nullValue())); }
public void process( ReadAllChildrenRequest request ) { ProjectedNode projectedNode = project(request.of(), request.inWorkspace(), request, false); request.inWorkspace()); placeholderRequest.addChildren(children); if (firstRequest) { request.inWorkspace()); placeholderRequest.addChildren(children); if (firstRequest) {
/** * {@inheritDoc} * * @see org.modeshape.graph.request.processor.RequestProcessor#process(org.modeshape.graph.request.ReadAllChildrenRequest) */ @Override public void process( ReadAllChildrenRequest request ) { MapWorkspace workspace = getWorkspace(request, request.inWorkspace()); MapNode node = getTargetNode(workspace, request, request.of()); if (node == null) { assert request.hasError(); return; } Location actualLocation = getActualLocation(request.of(), node); assert actualLocation != null; Path path = actualLocation.getPath(); // Get the names of the children ... List<MapNode> children = node.getChildren(); for (MapNode child : children) { Segment childName = child.getName(); Path childPath = pathFactory.create(path, childName); request.addChild(childPath, propertyFactory.create(ModeShapeLexicon.UUID, child.getUuid())); } request.setActualLocationOfNode(actualLocation); setCacheableInfo(request); }
@Override public void process( ReadAllChildrenRequest request ) { PathWorkspace workspace = getWorkspace(request, request.inWorkspace()); if (workspace == null) return; PathNode node = getTargetNode(workspace, request, request.of()); if (node == null) { request.setError(new PathNotFoundException(request.of(), workspace.getLowestExistingPath(request.of().getPath()))); return; } List<Path.Segment> childSegments = node.getChildSegments(); for (Path.Segment childSegment : childSegments) { request.addChild(Location.create(pathFactory.create(node.getPath(), childSegment))); } request.setActualLocationOfNode(Location.create(node.getPath(), node.getUuid())); setCacheableInfo(request); }
WorkspaceType workspace = getWorkspace(request, request.inWorkspace()); NodeType node = getTargetNode(workspace, request, request.of()); if (node == null) {