/** * Add a request to destroy an existing workspace. * * @param workspaceName the name of the workspace that is to be destroyed * @return this builder for method chaining; never null * @throws IllegalArgumentException if the workspace name is null */ public BatchRequestBuilder destroyWorkspace( String workspaceName ) { return add(new DestroyWorkspaceRequest(workspaceName)); }
/** * Add a request to read the branch at the supplied location, to a maximum depth of 2. * * @param at the location of the branch * @param workspaceName the name of the workspace containing the branch * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null or if the maximum depth is not positive */ public BatchRequestBuilder readBranch( Location at, String workspaceName ) { return add(new ReadBranchRequest(at, workspaceName)); }
/** * Add a request to read the children of a node at the supplied location in the designated workspace. * * @param of the location of the node whose children are to be read * @param workspaceName the name of the workspace * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder readAllChildren( Location of, String workspaceName ) { return add(new ReadAllChildrenRequest(of, workspaceName)); }
/** * Add a request to delete a branch. * * @param at the location of the top node in the existing branch that is to be deleted * @param workspaceName the name of the workspace containing the parent * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder deleteBranch( Location at, String workspaceName ) { return add(new DeleteBranchRequest(at, workspaceName)); }
/** * Submit any request to this batch. * * @param request the request to be batched; may not be null * @return this builder for method chaining; never null * @throws IllegalArgumentException if the request is null */ public BatchRequestBuilder submit( Request request ) { CheckArg.isNotNull(request, "request"); return add(request); }
/** * Add a request to verify the existance and location of a node at the supplied location. * * @param at the location of the node to be verified * @param workspaceName the name of the workspace containing the node * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder verifyNodeExists( Location at, String workspaceName ) { return add(new VerifyNodeExistsRequest(at, workspaceName)); }
/** * Add a request to create a new workspace, and specify the behavior should a workspace already exists with a name that * matches the desired name for the new workspace. * * @param desiredNameOfNewWorkspace the desired name of the new workspace * @param createConflictBehavior the behavior if a workspace already exists with the same name, or null if the default * behavior should be used * @return this builder for method chaining; never null */ public BatchRequestBuilder createWorkspace( String desiredNameOfNewWorkspace, CreateConflictBehavior createConflictBehavior ) { return add(new CreateWorkspaceRequest(desiredNameOfNewWorkspace, createConflictBehavior)); }
/** * Add a request to read the branch (of given depth) at the supplied location. * * @param at the location of the branch * @param workspaceName the name of the workspace containing the branch * @param maxDepth the maximum depth to read * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null or if the maximum depth is not positive */ public BatchRequestBuilder readBranch( Location at, String workspaceName, int maxDepth ) { return add(new ReadBranchRequest(at, workspaceName, maxDepth)); }
/** * Finish any pending request */ public void finishPendingRequest() { if (pendingRequest != null) { // There's a pending request, we need to build it ... add(pendingRequest.toRequest()); pendingRequest = null; } }
/** * Add a request to obtain the information about the available workspaces. * * @return this builder for method chaining; never null */ public BatchRequestBuilder getWorkspaces() { return add(new GetWorkspacesRequest()); }
/** * Add a request to verify the existance of the named workspace. * * @param workspaceName the desired name of the workspace, or null if the source's default workspace should be used * @return this builder for method chaining; never null */ public BatchRequestBuilder verifyWorkspace( String workspaceName ) { return add(new VerifyWorkspaceRequest(workspaceName)); }
/** * Add a request to read the properties and number of children of a node at the supplied location. * * @param at the location of the node to be read * @param workspaceName the name of the workspace containing the node * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder readNode( Location at, String workspaceName ) { return add(new ReadNodeRequest(at, workspaceName)); }
/** * Add a request to read the properties and number of children of a node at the supplied location. * * @param of the location of the node whose children are to be read * @param workspaceName the name of the workspace * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder readAllProperties( Location of, String workspaceName ) { return add(new ReadAllPropertiesRequest(of, workspaceName)); }
/** * Add a request to rename the node at the supplied location. * * @param at the location of the node to be read * @param workspaceName the name of the workspace containing the node * @param newName the new name for the node * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder renameNode( Location at, String workspaceName, Name newName ) { return add(new RenameNodeRequest(at, workspaceName, newName)); }
/** * Create a request to move a branch from one location into another. * * @param from the location of the top node in the existing branch that is to be moved * @param into the location of the existing node into which the branch should be moved * @param workspaceName the name of the workspace * @return this builder for method chaining; never null * @throws IllegalArgumentException if any of the parameters are null */ public BatchRequestBuilder moveBranch( Location from, Location into, String workspaceName ) { return add(new MoveBranchRequest(from, into, workspaceName, MoveBranchRequest.DEFAULT_CONFLICT_BEHAVIOR)); }
/** * Add a request to remove values from a property on an existing node * * @param workspaceName the name of the workspace containing the node; may not be null * @param on the location of the node; may not be null * @param property the name of the property; may not be null * @param values the new values to remove; may not be null * @return this builder for method chaining; never null */ public BatchRequestBuilder removeValues( String workspaceName, Location on, Name property, List<Object> values ) { return add(new UpdateValuesRequest(workspaceName, on, property, null, values)); }
/** * Add a request to read the properties and number of children of a node at the supplied location. * * @param of the location of the node whose children are to be read * @param workspaceName the name of the workspace * @param propertyName the name of the property to read * @return this builder for method chaining; never null * @throws IllegalArgumentException if the location or workspace name is null */ public BatchRequestBuilder readProperty( Location of, String workspaceName, Name propertyName ) { return add(new ReadPropertyRequest(of, workspaceName, propertyName)); }
/** * Create a request to unlock a branch or node * <p> * The lock on the node should be removed. If the lock was deep (i.e., locked the entire branch under the node, then all of * the descendants of the node affected by the lock should also be unlocked after this request is processed. * </p> * * @param workspaceName the name of the workspace containing the node; may not be null * @param target the location of the top node in the existing branch that is to be unlocked * @return this builder for method chaining; never null * @throws IllegalArgumentException if any of the parameters are null */ public BatchRequestBuilder unlockBranch( String workspaceName, Location target ) { return add(new UnlockBranchRequest(target, workspaceName)); }
/** * Add a request to read those children of a node that are immediately after a supplied sibling node. * * @param startingAfter the location of the previous sibling that was the last child of the previous block of children read * @param workspaceName the name of the workspace containing the node * @param count the maximum number of children that should be included in the block * @return this builder for method chaining; never null * @throws IllegalArgumentException if the workspace name or <code>startingAfter</code> location is null, or if * <code>count</count> is less than 1. */ public BatchRequestBuilder readNextBlockOfChildren( Location startingAfter, String workspaceName, int count ) { return add(new ReadNextBlockOfChildrenRequest(startingAfter, workspaceName, count)); }
/** * Add a request to add values to a property on an existing node * * @param workspaceName the name of the workspace containing the node; may not be null * @param on the location of the node; may not be null * @param property the name of the property; may not be null * @param values the new values to add; may not be null * @return this builder for method chaining; never null */ public BatchRequestBuilder addValues( String workspaceName, Location on, Name property, List<Object> values ) { return add(new UpdateValuesRequest(workspaceName, on, property, values, null)); }