Search in sources :

Example 1 with DefaultOMEROService

use of net.imagej.omero.DefaultOMEROService in project imagej-omero by imagej.

the class SaveTableToOMERO method run.

@Override
public void run() {
    final OMEROCredentials credentials = new OMEROCredentials();
    credentials.setServer(getServer());
    credentials.setPort(getPort());
    credentials.setUser(getUser());
    credentials.setPassword(getPassword());
    final Table<?, ?> table = tableDisplay.get(0);
    try {
        ((DefaultOMEROService) omeroService).uploadTable(credentials, name, table, imageID);
    } catch (ServerError exc) {
        log.error(exc);
        cancel("Error talking to OMERO: " + exc.message);
    } catch (PermissionDeniedException exc) {
        log.error(exc);
        cancel("Error talking to OMERO: " + exc.getMessage());
    } catch (CannotCreateSessionException exc) {
        log.error(exc);
        cancel("Error talking to OMERO: " + exc.getMessage());
    } catch (ExecutionException exc) {
        log.error(exc);
        cancel("Error attaching table to OMERO image: " + exc.getMessage());
    } catch (DSOutOfServiceException exc) {
        log.error(exc);
        cancel("Error attaching table to OMERO image: " + exc.getMessage());
    } catch (DSAccessException exc) {
        log.error(exc);
        cancel("Error attaching table to OMERO image: " + exc.getMessage());
    }
}
Also used : CannotCreateSessionException(Glacier2.CannotCreateSessionException) DefaultOMEROService(net.imagej.omero.DefaultOMEROService) ServerError(omero.ServerError) DSOutOfServiceException(omero.gateway.exception.DSOutOfServiceException) PermissionDeniedException(Glacier2.PermissionDeniedException) ExecutionException(java.util.concurrent.ExecutionException) OMEROCredentials(net.imagej.omero.OMEROCredentials) DSAccessException(omero.gateway.exception.DSAccessException)

Aggregations

CannotCreateSessionException (Glacier2.CannotCreateSessionException)1 PermissionDeniedException (Glacier2.PermissionDeniedException)1 ExecutionException (java.util.concurrent.ExecutionException)1 DefaultOMEROService (net.imagej.omero.DefaultOMEROService)1 OMEROCredentials (net.imagej.omero.OMEROCredentials)1 ServerError (omero.ServerError)1 DSAccessException (omero.gateway.exception.DSAccessException)1 DSOutOfServiceException (omero.gateway.exception.DSOutOfServiceException)1