@Test public void shouldCreateValidRequestWithValidLocation() { request = new ReadAllPropertiesRequest(validPathLocation1, workspace1); assertThat(request.at(), is(sameInstance(validPathLocation1))); assertThat(request.hasError(), is(false)); assertThat(request.getError(), is(nullValue())); }
@Override public void process( ReadAllPropertiesRequest request ) { WorkspaceType workspace = getWorkspace(request, request.inWorkspace()); NodeType node = getTargetNode(workspace, request, request.at()); if (node == null) { assert request.hasError(); return; } // Get the properties of the node ... Location actualLocation = getActualLocation(workspace, request.at(), node); request.addProperty(propertyFactory.create(ModeShapeLexicon.UUID, node.getUuid())); request.addProperties(node.getProperties().values()); assert actualLocation != null; request.setActualLocationOfNode(actualLocation); setCacheableInfo(request); }
@Override public void process( ReadAllPropertiesRequest request ) { MapWorkspace workspace = getWorkspace(request, request.inWorkspace()); MapNode node = getTargetNode(workspace, request, request.at()); if (node == null) { assert request.hasError(); return; } // Get the properties of the node ... Location actualLocation = getActualLocation(request.at(), node); request.addProperty(propertyFactory.create(ModeShapeLexicon.UUID, node.getUuid())); for (Property property : node.getProperties().values()) { request.addProperty(property); } assert actualLocation != null; request.setActualLocationOfNode(actualLocation); setCacheableInfo(request); }
/** * Process a request to read a single property of a node at the supplied location. * <p> * This method does nothing if the request is null. Unless overridden, this method converts the request that * {@link ReadAllPropertiesRequest reads the node} and simply returns the one property. * </p> * * @param request the read request */ public void process( ReadPropertyRequest request ) { if (request == null) return; ReadAllPropertiesRequest readNode = new ReadAllPropertiesRequest(request.on(), request.inWorkspace()); process(readNode); if (readNode.hasError()) { request.setError(readNode.getError()); return; } Property property = readNode.getPropertiesByName().get(request.named()); request.setProperty(property); // Set the actual location ... request.setActualLocationOfNode(readNode.getActualLocationOfNode()); setCacheableInfo(request); }
/** * Process a request to verify that a node exists at the supplied location. * <p> * This method does nothing if the request is null. Unless overridden, this method converts the request that * {@link ReadAllPropertiesRequest reads the node} and uses the result to determine if the node exists. * </p> * * @param request the read request */ public void process( VerifyNodeExistsRequest request ) { if (request == null) return; ReadAllPropertiesRequest readNode = new ReadAllPropertiesRequest(request.at(), request.inWorkspace()); process(readNode); if (readNode.hasError()) { request.setError(readNode.getError()); return; } // Set the actual location ... request.setActualLocationOfNode(readNode.getActualLocationOfNode()); setCacheableInfo(request); }
while (projectedRequest != null) { ReadAllPropertiesRequest readFromSource = (ReadAllPropertiesRequest)projectedRequest.getRequest(); if (readFromSource.hasError()) { projectedRequest = projectedRequest.next(); continue;
if (readProperties.hasError()) { request.setError(readProperties.getError()); return;