@RestController
@RequestMapping(value="/ome/import")
@Scope(value="request")
public class ImportController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ImportUrl |
Constructor and Description |
---|
ImportController() |
Modifier and Type | Method and Description |
---|---|
org.springframework.http.ResponseEntity<java.lang.Object> |
enqueue(ImportRequest[] data)
Adds the given requests to the import queue.
|
public static final java.lang.String ImportUrl
@RequestMapping(method=POST, consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<java.lang.Object> enqueue(@RequestBody ImportRequest[] data)
The requested imports will be queued and will be processed as soon as resources are available; this method returns immediately so that the client doesn't have to wait for the imports to complete.
An outcome notification will be sent to the email address specified in the requests. (For now we assume all requests have the same email address, but going forward this method should work even with possibly unrelated import requests.) This notification is just a one-liner success message when all the submitted data are imported successfully into OMERO. Otherwise, if some of the data failed to import, then a more detailed message is sent that specifies which imports failed and which succeeded.
Each request must contain a valid OMERO session key that the client has acquired before hand; the corresponding OMERO session will be used to import the data and then closed by the server. The same session key may be shared by any of the submitted requests.
This method returns a 200
HTTP message when:
null
or empty or only contains null
elements. In this case the body of the message is a JSON empty
array.
null
requests and each of
them is valid according to the fields specification of ImportRequest
. (This method filters out any null
element and
only processes non-null
objects.)
The body of the returned message is a JSON-serialised array of ImportResponse
s, one response for each (non-null
) request.
Note that the returned response objects may be in a different order
than the one of the requests passed into this method's input array.
This method returns a 400
HTTP message when:
null
requests but some
of them fails validation. In this case, the body of the message is
a JSON-serialised instance of Error
which details the detected
validation errors for each request that didn't pass validation.
data
- details what image data to import.Error
or an array of ImportResponse
s.