Class DeleteAuthorizableServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- org.apache.sling.api.servlets.SlingAllMethodsServlet
-
- org.apache.sling.jackrabbit.usermanager.impl.post.AbstractPostServlet
-
- org.apache.sling.jackrabbit.usermanager.impl.post.DeleteAuthorizableServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig,DeleteAuthorizables,DeleteGroup,DeleteUser
public class DeleteAuthorizableServlet extends AbstractPostServlet implements DeleteUser, DeleteGroup, DeleteAuthorizables
Rest Service Description
Deletes an Authorizable, currently a user or a group. Maps on to nodes of resourceType
sling/usersorsling/userslike/rep:system/rep:userManager/rep:usersor/rep:system/rep:userManager/rep:groupsmapped to a resource url/system/userManager/useror/system/userManager/group. This servlet responds at/system/userManager/user.delete.htmlor/system/userManager/group.delete.html. The servlet also responds to single delete requests eg/system/userManager/group/newGroup.delete.htmlMethods
- POST
Post Parameters
- :applyTo
- An array of relative resource references to Authorizables to be deleted, if this parameter is present, the url is ignored and all the Authorizables in the list are removed.
Response
- 200
- Success, no body.
- 404
- The resource was not found
- 500
- Failure
Example
curl -Fgo=1 http://localhost:8080/system/userManager/user/ieb.delete.html- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DeleteAuthorizableServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)Overridden since the @Reference annotation is not inherited from the super methodvoiddeleteAuthorizables(javax.jcr.Session jcrSession, org.apache.sling.api.resource.Resource baseResource, String[] paths, List<org.apache.sling.servlets.post.Modification> changes)Deletes one or more users or groups from the repositoryvoiddeleteGroup(javax.jcr.Session jcrSession, String name, List<org.apache.sling.servlets.post.Modification> changes)Deletes a group from the repositoryvoiddeleteUser(javax.jcr.Session jcrSession, String name, List<org.apache.sling.servlets.post.Modification> changes)Deletes a user from the repositoryprotected voidhandleOperation(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.servlets.post.PostResponse response, List<org.apache.sling.servlets.post.Modification> changes)Extending Servlet should implement this operation to do the workprotected voidunbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)Unbind a post response creator-
Methods inherited from class org.apache.sling.jackrabbit.usermanager.impl.post.AbstractPostServlet
createHtmlResponse, doPost, externalizePath, getItemPath, getRanking, getRedirectUrl, getRedirectUrl, handleOperation, isSetStatus
-
Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
-
-
-
-
Method Detail
-
bindPostResponseCreator
protected void bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)Overridden since the @Reference annotation is not inherited from the super method
-
unbindPostResponseCreator
protected void unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)Description copied from class:AbstractPostServletUnbind a post response creator- Overrides:
unbindPostResponseCreatorin classAbstractPostServlet
-
handleOperation
protected void handleOperation(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.servlets.post.PostResponse response, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryExceptionDescription copied from class:AbstractPostServletExtending Servlet should implement this operation to do the work- Specified by:
handleOperationin classAbstractPostServlet- Parameters:
request- the sling http request to processresponse- the responsechanges- the changes to report- Throws:
javax.jcr.RepositoryException- in case of exceptions during the operation
-
deleteUser
public void deleteUser(javax.jcr.Session jcrSession, String name, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryExceptionDescription copied from interface:DeleteUserDeletes a user from the repository- Specified by:
deleteUserin interfaceDeleteUser- Parameters:
jcrSession- the JCR session of the user creating the username- The name of the user to delete (required)changes- The list of changes for this operation (optional)- Throws:
javax.jcr.RepositoryException- if user can't be deleted
-
deleteGroup
public void deleteGroup(javax.jcr.Session jcrSession, String name, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryExceptionDescription copied from interface:DeleteGroupDeletes a group from the repository- Specified by:
deleteGroupin interfaceDeleteGroup- Parameters:
jcrSession- the JCR session of the user creating the username- The name of the group to delete (required)changes- The list of changes for this operation (optional)- Throws:
javax.jcr.RepositoryException- if group can't be deleted
-
deleteAuthorizables
public void deleteAuthorizables(javax.jcr.Session jcrSession, org.apache.sling.api.resource.Resource baseResource, String[] paths, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryExceptionDescription copied from interface:DeleteAuthorizablesDeletes one or more users or groups from the repository- Specified by:
deleteAuthorizablesin interfaceDeleteAuthorizables- Parameters:
jcrSession- the JCR session of the user creating the userbaseResource- the base resource to calculate the relative paths from (required)paths- An array of relative resource paths to Authorizables to be deleted (required)changes- The list of changes for this operation (optional)- Throws:
javax.jcr.RepositoryException- if authorizable (user or group) can't be deleted
-
-