Class RootWebService


  • @Service
    @Path("/")
    public class RootWebService
    extends Object
    Handles calls to the root API url and user info api
    Author:
    tesarst
    • Constructor Detail

      • RootWebService

        public RootWebService()
    • Method Detail

      • getApiInfo

        @GET
        @Produces("application/json")
        public ResponseDataObject<RootWebService.ApiInfoValueObject> getApiInfo​(@Context
                                                                                javax.servlet.http.HttpServletRequest request,
                                                                                @Context
                                                                                javax.servlet.ServletConfig servletConfig)
        Returns an object with API information.
      • getUser

        @GET
        @Path("/users/{username}")
        @Produces("application/json")
        @PreAuthorize("(isAuthenticated() && principal.username == #username) || hasAuthority(\'GROUP_ADMIN\')")
        public ResponseDataObject<RootWebService.UserValueObject> getUser​(@PathParam("username")
                                                                          String username)
        Retrieve user information.

        This method only works for authenticated users (via basic HTTP auth or their JSESSIONID cookie as specified by the SecurityScheme annotation on this class. If the current authenticated user is an administrator, any user can be retrieved with this endpoint, otherwise only the current user is accessible.

        Parameters:
        username - the username