コード例 #1
0
  @Override
  public void run() {
    OMEROCredentials credentials = new OMEROCredentials();
    credentials.setUser(name);
    credentials.setPassword(psw);
    credentials.setServer(host);
    credentials.setPort(port);
    OMEROSession session = null;
    try {
      session = new OMEROSession(credentials);
    } catch (omero.ServerError e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (PermissionDeniedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (CannotCreateSessionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (session == null) return;
    try {
      session.getClient().createClient(true);
    } catch (omero.ServerError e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (CannotCreateSessionException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (PermissionDeniedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (session.getClient() == null) return;

    // for(Long id : ids) {
    try {
      dataset = ome.downloadImage(session.getClient(), id);
    } catch (omero.ServerError ex) {
      // TODO Auto-generated catch block
      ex.printStackTrace();
    } catch (IOException ex) {
      // TODO Auto-generated catch block
      ex.printStackTrace();
    }

    //		if(show && dataset != null)
    //			ui.show(dataset);
    // }
    session.close();
  }
コード例 #2
0
 private void hasSystemPrivileges(Experimenter e) {
   try {
     ServiceFactoryPrx sf = c.createSession(e.getOmeName().getValue(), "");
     sf.getAdminService().synchronizeLoginCache();
   } catch (ServerError e1) {
     // TODO Auto-generated catch block
     e1.printStackTrace();
     throw new RuntimeException("Unimplemented exception.");
   } catch (CannotCreateSessionException e2) {
     // TODO Auto-generated catch block
     e2.printStackTrace();
     throw new RuntimeException("Unimplemented exception.");
   } catch (PermissionDeniedException e3) {
     // TODO Auto-generated catch block
     e3.printStackTrace();
     throw new RuntimeException("Unimplemented exception.");
   }
 }