assertNotExecuted(); return new At<BatchConjunction>() { public BatchConjunction at( Location location ) {
assertNotExecuted(); return new On<BatchConjunction>() { public BatchConjunction on( Location location ) {
assertNotExecuted(); return new Of<BatchConjunction>() { public BatchConjunction of( String path ) {
assertNotExecuted(); return new On<BatchConjunction>() { public BatchConjunction on( String path ) {
/** * Begin the request to copy a node at the specified location into a parent node at a different location, which is * specified via the <code>into(...)</code> method on the returned {@link Copy} object. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param from the location of the node that is to be copied. * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( Location from ) { assertNotExecuted(); return new CopyAction<BatchConjunction>(this.nextRequests, from) { @Override protected BatchConjunction submit( String fromWorkspaceName, Locations from, Location into, Name copyName ) { String intoWorkspaceName = getCurrentWorkspaceName(); if (fromWorkspaceName == null) fromWorkspaceName = intoWorkspaceName; do { requestQueue.copyBranch(from.getLocation(), fromWorkspaceName, into, intoWorkspaceName, copyName, null); } while ((from = from.next()) != null); return and(); } }; }
/** * Begin the request to move a node at the specified location into a parent node at a different location, which is * specified via the <code>into(...)</code> method on the returned {@link Move} object. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param from the location of the node that is to be moved. * @return the object that can be used to specify addition nodes to be moved or the location of the node where the node is * to be moved */ public final Move<BatchConjunction> move( Location from ) { assertNotExecuted(); return new MoveAction<BatchConjunction>(this.nextRequests, from) { @Override protected BatchConjunction submit( Locations from, Location into, Location before, Name newName ) { String workspaceName = getCurrentWorkspaceName(); do { requestQueue.moveBranch(from.getLocation(), into, before, workspaceName, newName); } while ((from = from.next()) != null); return and(); } }; }
assertNotExecuted(); return new CloneAction<BatchConjunction>(this.nextRequests, from) { @Override
/** * Request to lock the node at the given location. This request is submitted to the repository immediately. * * @param at the location of the node that is to be locked * @return an object that allows the scope of the lock to be defined */ public LockScope<LockTimeout<BatchConjunction>> lock( Location at ) { assertNotExecuted(); return new LockAction<BatchConjunction>(this.nextRequests, at) { @Override protected BatchConjunction submit( Location target, org.modeshape.graph.request.LockBranchRequest.LockScope lockScope, long lockTimeoutInMillis ) { String workspaceName = getCurrentWorkspaceName(); requestQueue.lockBranch(workspaceName, target, lockScope, lockTimeoutInMillis); return and(); } }; }
/** * Request that the property with the given name be read on the node defined via the <code>on(...)</code> method on the * returned {@link On} object. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param propertyName the name of the property that is to be read * @return the object that is used to specified the node whose property is to be read */ public On<BatchConjunction> readProperty( String propertyName ) { assertNotExecuted(); Name name = Graph.this.getContext().getValueFactories().getNameFactory().create(propertyName); return readProperty(name); }
/** * Begin the request to create a node located at the supplied path. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param at the path to the node that is to be created. * @return the object that can be used to specify addition properties for the new node to be copied or the location of the * node where the node is to be created */ public final Create<Batch> create( Path at ) { assertNotExecuted(); CheckArg.isNotNull(at, "at"); Path parent = at.getParent(); Name name = at.getLastSegment().getName(); return create(Location.create(parent), name); }
/** * Request to read the node at the supplied location. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param location the location of the node that is to be read * @return the interface that can either execute the batched requests or continue to add additional requests to the batch */ public BatchConjunction read( Location location ) { assertNotExecuted(); requestQueue.readNode(location, getCurrentWorkspaceName()); return nextRequests; }
/** * Request to delete the node at the given location. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param at the location of the node that is to be deleted * @return an object that may be used to start another request */ public BatchConjunction delete( Location at ) { assertNotExecuted(); this.requestQueue.deleteBranch(at, getCurrentWorkspaceName()); return nextRequests; }
/** * Request to unlock the node at the given location. This request is submitted to the repository immediately. * * @param at the location of the node that is to be unlocked * @return the interface that can either execute the batched requests or continue to add additional requests to the batch */ public BatchConjunction unlock( Location at ) { assertNotExecuted(); requestQueue.unlockBranch(workspaceName, at); return this.nextRequests; }