Class RESTRootController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.web.controller.api.RESTRootController
-
@Controller public class RESTRootController extends java.lang.Object
A basis for clients to begin discovering other URLs in our API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
RESTRootController.ResponseVersion
A convenient class for returning the api version.
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,java.lang.Class<?>>
PUBLIC_CONTROLLERS
A collection of the controllers in our system accessible by all authenticated users.static java.util.Map<java.lang.String,java.lang.Class<?>>
RESTRICTED_CONTROLLERS
A collection of the controllers in our system accessible by users with `ROLE_ADMIN` or `ROLE_SEQUENCER` authorization.
-
Constructor Summary
Constructors Constructor Description RESTRootController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseResource<RootResource>
getLinks(javax.servlet.http.HttpServletRequest request)
Creates a response with a set of links used to discover the rest of the system.void
initLinks()
Initialize a collection of all controllers in the system.RESTRootController.ResponseVersion
version()
Creates a response with the current build version.
-
-
-
Field Detail
-
PUBLIC_CONTROLLERS
public static final java.util.Map<java.lang.String,java.lang.Class<?>> PUBLIC_CONTROLLERS
A collection of the controllers in our system accessible by all authenticated users.
-
RESTRICTED_CONTROLLERS
public static final java.util.Map<java.lang.String,java.lang.Class<?>> RESTRICTED_CONTROLLERS
A collection of the controllers in our system accessible by users with `ROLE_ADMIN` or `ROLE_SEQUENCER` authorization.
-
-
Method Detail
-
initLinks
@PostConstruct public void initLinks()
Initialize a collection of all controllers in the system.
-
getLinks
@RequestMapping(method=GET, value="/api") public ResponseResource<RootResource> getLinks(javax.servlet.http.HttpServletRequest request)
Creates a response with a set of links used to discover the rest of the system.- Parameters:
request
- Incoming HTTP request object to check the user's role.- Returns:
- a response to the client.
-
version
@RequestMapping(method=GET, value="/api/version") public RESTRootController.ResponseVersion version()
Creates a response with the current build version.- Returns:
- a response to the client
-
-