Class RemoteAPIController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.BaseController
-
- ca.corefacility.bioinformatics.irida.ria.web.oauth.RemoteAPIController
-
@Controller @RequestMapping("/remote_api") public class RemoteAPIController extends BaseController
Controller handling basic operations for listing, viewing, adding, and removingRemoteAPI
s
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENTS_PAGE
static java.lang.String
PARENT_FRAME_RELOAD_PAGE
-
Fields inherited from class ca.corefacility.bioinformatics.irida.ria.web.BaseController
MODEL_ERROR_ATTR
-
-
Constructor Summary
Constructors Constructor Description RemoteAPIController(RemoteAPIService remoteAPIService, ProjectRemoteService projectRemoteService, OltuAuthorizationController authController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
connectToAPI(java.lang.Long apiId, org.springframework.ui.Model model)
Initiate a token request on a remote api if one does not yet exist.java.lang.String
handleOAuthException(javax.servlet.http.HttpServletRequest request, IridaOAuthException ex)
Handle anIridaOAuthException
by launching an authentication flowjava.lang.String
list()
Get the remote apis listing page-
Methods inherited from class ca.corefacility.bioinformatics.irida.ria.web.BaseController
getErrorsFromDataIntegrityViolationException, getErrorsFromViolationException
-
-
-
-
Field Detail
-
CLIENTS_PAGE
public static final java.lang.String CLIENTS_PAGE
- See Also:
- Constant Field Values
-
PARENT_FRAME_RELOAD_PAGE
public static final java.lang.String PARENT_FRAME_RELOAD_PAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteAPIController
@Autowired public RemoteAPIController(RemoteAPIService remoteAPIService, ProjectRemoteService projectRemoteService, OltuAuthorizationController authController)
-
-
Method Detail
-
list
@RequestMapping public java.lang.String list()
Get the remote apis listing page- Returns:
- The view name of the remote apis listing page
-
connectToAPI
@RequestMapping("/connect/{apiId}") public java.lang.String connectToAPI(@PathVariable java.lang.Long apiId, org.springframework.ui.Model model)
Initiate a token request on a remote api if one does not yet exist. Works withhandleOAuthException(HttpServletRequest, IridaOAuthException)
to initiate the request.- Parameters:
apiId
- the ID of the api to connect tomodel
- the model to add attributes to.- Returns:
- The name of the PARENT_FRAME_RELOAD_PAGE view
-
handleOAuthException
@ExceptionHandler(IridaOAuthException.class) public java.lang.String handleOAuthException(javax.servlet.http.HttpServletRequest request, IridaOAuthException ex) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException
Handle anIridaOAuthException
by launching an authentication flow- Parameters:
request
- The incoming request methodex
- The thrown exception- Returns:
- A redirect to the
OltuAuthorizationController
's authentication - Throws:
org.apache.oltu.oauth2.common.exception.OAuthSystemException
- if the request cannot be authenticated.
-
-