/** * {@inheritDoc} * <p> * This method does not clone the results. * </p> * * @see org.modeshape.graph.request.ChangeRequest#clone() */ @Override public LockBranchRequest clone() { LockBranchRequest request = new LockBranchRequest(actualLocation != null ? actualLocation : at, workspaceName, isDeep, lockTimeoutInMillis); request.setActualLocation(actualLocation); return request; }
/** * {@inheritDoc} * * @see org.modeshape.graph.request.processor.RequestProcessor#process(org.modeshape.graph.request.LockBranchRequest) */ @Override public void process( LockBranchRequest request ) { LockBranchRequest source = (LockBranchRequest)federatedRequest.getFirstProjectedRequest().getRequest(); if (checkErrorOrCancel(request, source)) return; request.setActualLocation(source.getActualLocation()); }
@Override public void process( LockBranchRequest request ) { // Just update the actual location request.setActualLocation(actualLocationOf(request.at())); }
/** * {@inheritDoc} * * @see org.modeshape.graph.request.processor.RequestProcessor#process(org.modeshape.graph.request.LockBranchRequest) */ @Override public void process( LockBranchRequest request ) { ProjectedRequest projected = federatedRequest.getFirstProjectedRequest(); // Check the projection first ... if (checkErrorOrCancel(request, federatedRequest)) return; LockBranchRequest source = (LockBranchRequest)projected.getRequest(); if (checkErrorOrCancel(request, source)) return; Location sourceLocation = source.getActualLocation(); request.setActualLocation(projectToFederated(request.at(), projected.getProjection(), sourceLocation, request)); }
@Override public void process( LockBranchRequest request ) { WorkspaceType workspace = getWorkspace(request, request.inWorkspace()); NodeType node = getTargetNode(workspace, request, request.at()); if (node == null) return; txn.lockNode(workspace, node, request.lockScope(), request.lockTimeoutInMillis()); Location actualLocation = getActualLocation(workspace, request.at(), node); request.setActualLocation(actualLocation); recordChange(request); }
@Override public void process( LockBranchRequest request ) { MapWorkspace workspace = getWorkspace(request, request.inWorkspace()); MapNode node = getTargetNode(workspace, request, request.at()); if (node == null) return; workspace.lockNode(node, request.lockScope(), request.lockTimeoutInMillis()); Location actualLocation = getActualLocation(request.at(), node); request.setActualLocation(actualLocation); recordChange(request); }
@Override public void process( LockBranchRequest request ) { PathWorkspace workspace = getWorkspace(request, request.inWorkspace()); PathNode node = getTargetNode(workspace, request, request.at()); if (node == null) return; workspace.lockNode(node, request.lockScope(), request.lockTimeoutInMillis()); request.setActualLocation(Location.create(node.getPath(), node.getUuid())); recordChange(request); }
/** * Process a request to lock a node or branch within a workspace * <p> * The default implementation of this method does nothing, as most connectors will not support locking. Any implementation of * this method should do nothing if the request is null. * </p> * <p> * Implementations that do support locking should throw a {@link LockFailedException} if the request could not be fulfilled. * </p> * * @param request the request */ public void process( LockBranchRequest request ) { Location actualLocation = request.at(); if (!actualLocation.hasPath()) { VerifyNodeExistsRequest nodeExists = new VerifyNodeExistsRequest(request.at(), request.inWorkspace()); process(nodeExists); if (nodeExists.hasError()) { request.setError(nodeExists.getError()); return; } actualLocation = nodeExists.getActualLocationOfNode(); } request.setActualLocation(actualLocation); }