@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())); }
/** * 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); }
process(readProperties); if (readProperties.hasError()) { request.setError(readProperties.getError()); return;