Package org.apache.wiki.auth

# Class DefaultUserManager.JSONUserModule

java.lang.Object
org.apache.wiki.auth.DefaultUserManager.JSONUserModule

All Implemented Interfaces:
  `WikiAjaxServlet`

Enclosing class:
  DefaultUserManager

public static final class DefaultUserManager.JSONUserModule extends Object implements WikiAjaxServlet
Implements the JSON API for usermanager.

Even though this gets serialized whenever container shuts down/restarts, this gets reinstalled to the session when JSPWiki starts. This means that it's not actually necessary to save anything.

## Constructor Summary

Constructors
Constructor
Description
`JSONUserModule(DefaultUserManager mgr)`
Create a new JSONUserModule.

## Method Summary

Modifier and Type
Method
Description
`String`
`getServletMapping()`
`UserProfile`
`getUserInfo(String uid)`
Directly returns the UserProfile object attached to an uid.
`void`
`service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String actionName, List<String> params)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JSONUserModule

public JSONUserModule(DefaultUserManager mgr)
Create a new JSONUserModule.

Parameters:
  `mgr` - Manager

## Method Details

### getServletMapping

public String getServletMapping()

Specified by:
  `getServletMapping` in interface `WikiAjaxServlet`

### service

public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String actionName, List<String> params) throws javax.servlet.ServletException, IOException

Specified by:
  `service` in interface `WikiAjaxServlet`
Throws:
  `javax.servlet.ServletException`
  `IOException`

### getUserInfo

public UserProfile getUserInfo(String uid) throws NoSuchPrincipalException
Directly returns the UserProfile object attached to an uid.

Parameters:
  `uid` - The user id (e.g. WikiName)
Returns:
  A UserProfile object
Throws:
  `NoSuchPrincipalException` - If such a name does not exist.