Class AbstractAuthorizablePostServlet

All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AbstractGroupPostServlet, ChangeUserPasswordServlet, CreateUserServlet, UpdateUserServlet

public abstract class AbstractAuthorizablePostServlet extends AbstractPostServlet
Base class for all the POST servlets for the UserManager operations
See Also:
  • Field Details

    • RP_NODE_NAME_VALUE_FROM

      protected static final String RP_NODE_NAME_VALUE_FROM
    • RP_NODE_NAME_HINT_VALUE_FROM

      protected static final String RP_NODE_NAME_HINT_VALUE_FROM
    • PROP_DATE_FORMAT

      public static final String PROP_DATE_FORMAT
      See Also:
    • systemUserManagerPaths

      protected transient SystemUserManagerPaths systemUserManagerPaths
    • principalNameGenerators

      protected transient LinkedList<org.apache.sling.jackrabbit.usermanager.impl.post.AbstractAuthorizablePostServlet.PrincipalNameGeneratorHolder> principalNameGenerators
      The principal name generators
    • principalNameFilter

      protected transient PrincipalNameFilter principalNameFilter
      The optional principal name filter
  • Constructor Details

    • AbstractAuthorizablePostServlet

      public AbstractAuthorizablePostServlet()
  • Method Details

    • bindSystemUserManagerPaths

      protected void bindSystemUserManagerPaths(SystemUserManagerPaths sump)
    • bindPrincipalNameGenerator

      protected void bindPrincipalNameGenerator(PrincipalNameGenerator generator, Map<String,Object> properties)
      Bind a new principal name generator
    • unbindPrincipalNameGenerator

      protected void unbindPrincipalNameGenerator(PrincipalNameGenerator generator)
    • bindPrincipalNameFilter

      protected void bindPrincipalNameFilter(PrincipalNameFilter filter)
      Bind a new principal name filter
    • unbindPrincipalNameFilter

      protected void unbindPrincipalNameFilter(PrincipalNameFilter filter)
    • getOrGeneratePrincipalName

      protected String getOrGeneratePrincipalName(javax.jcr.Session jcrSession, Map<String,?> properties, org.apache.jackrabbit.oak.spi.security.user.AuthorizableType type) throws javax.jcr.RepositoryException
      Get or generate the name of the principal being created
      Parameters:
      jcrSession - the JCR session
      properties - the properties to consider when generating a name
      type - the type of authorizable
      Returns:
      the principal name
      Throws:
      javax.jcr.RepositoryException
    • activate

      protected void activate(Map<String,Object> props)
    • deactivate

      protected void deactivate()
    • collectContent

      @Deprecated protected Collection<RequestProperty> collectContent(Map<String,?> properties)
      Deprecated.
      use collectContentMap(Map) instead since 2.2.18
      Collects the properties that form the content to be written back to the repository.
      Parameters:
      properties - the properties out of which to generate the RequestPropertys
      Returns:
      the list of RequestPropertys
    • collectContentMap

      protected Map<String,RequestProperty> collectContentMap(Map<String,?> properties)
      Collects the properties that form the content to be written back to the repository.
      Parameters:
      properties - the properties out of which to generate the RequestPropertys
      Returns:
      the list of RequestPropertys
    • processDeletes

      protected void processDeletes(org.apache.jackrabbit.api.security.user.Authorizable authorizable, Collection<RequestProperty> reqProperties, List<Modification> changes) throws javax.jcr.RepositoryException
      Removes all properties listed as RequestProperty.isDelete() from the authorizable.
      Parameters:
      authorizable - The org.apache.jackrabbit.api.security.user.Authorizable that should have properties deleted.
      reqProperties - The collection of request properties to check for properties to be removed.
      changes - The List to be updated with information on deleted properties.
      Throws:
      javax.jcr.RepositoryException - Is thrown if an error occurrs checking or removing properties.
    • concatPath

      protected String concatPath(@NotNull @NotNull String parentPath, @NotNull @NotNull String other)
      Helper utility to join a path with a descandant subpath
      Parameters:
      parentPath - the parent path
      other - the descendant path
      Returns:
      the joined path
    • processCreate

      protected void processCreate(javax.jcr.Session session, org.apache.jackrabbit.api.security.user.Authorizable authorizable, Map<String,RequestProperty> reqProperties, List<Modification> changes) throws javax.jcr.RepositoryException
      Create resource(s) according to current request
      Parameters:
      session - the sessioin to write the authorizable properties
      authorizable - The org.apache.jackrabbit.api.security.user.Authorizable that should have properties deleted.
      reqProperties - The collection of request properties to check for properties to be removed.
      changes - The List to be updated with information on deleted properties.
      Throws:
      javax.jcr.RepositoryException - Is thrown if an error occurrs checking or removing properties.
    • writeContent

      protected void writeContent(javax.jcr.Session session, org.apache.jackrabbit.api.security.user.Authorizable authorizable, Collection<RequestProperty> reqProperties, List<Modification> changes) throws javax.jcr.RepositoryException
      Writes back the content
      Parameters:
      session - the sessioin to write the authorizable properties
      authorizable - the authorizable to modify
      reqProperties - the properties to write
      changes - the list of changes which is supposed to be extended
      Throws:
      javax.jcr.RepositoryException - if a repository error occurs
    • hasItemPathPrefix

      protected boolean hasItemPathPrefix(String name)
      Parameters:
      name - the name
      Returns:
      true if the name starts with either of the prefixes SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT, SlingPostConstants.ITEM_PREFIX_RELATIVE_PARENT and SlingPostConstants.ITEM_PREFIX_ABSOLUTE
    • requireItemPathPrefix

      protected final boolean requireItemPathPrefix(Map<String,?> properties)
      Parameters:
      properties - the request parameters
      Returns:
      true if any of the request parameters starts with SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT. In this case only parameters starting with either of the prefixes SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT, SlingPostConstants.ITEM_PREFIX_RELATIVE_PARENT and SlingPostConstants.ITEM_PREFIX_ABSOLUTE are considered as providing content to be stored. Otherwise all parameters not starting with the command prefix : are considered as parameters to be stored.
    • convertToString

      protected String convertToString(Object obj)
    • convertToStringArray

      @NotNull protected @NotNull String[] convertToStringArray(Object obj)
    • convertToRequestParameterArray

      @NotNull protected @NotNull RequestParameter[] convertToRequestParameterArray(Object obj)