We're Hiring!

Java:Gateway connection from uuid

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Java:Gateway connection from uuid

Postby FrankT » Thu Jun 23, 2016 7:33 am

Hi all,

I want to write a little java console application to get a few things from my Omero server.
To connect I would usually use:

Code: Select all
gateway.connect(new LoginCredentials(User, Password, host, port))


Since I will be calling this application from a script I don’t necessarily have that information. I have however the session uuid. How do I connect using that?
I found the omero.client class, which has a joinSession function, but I do not know, how the gateway and that client class are connected.

(As far as I know I can’t use the CLI-Client for this, since that would require me to install ICE on the machine that is running this program.)
FrankT
 
Posts: 3
Joined: Fri Feb 26, 2016 11:42 am

Re: Java:Gateway connection from uuid

Postby mtbc » Thu Jun 23, 2016 8:02 am

Dear Frank,

With your existing code snippet if you pass the session UUID as the username then that should work. In that case a null password seems okay. We should probably improve the documentation to make that possibility clearer.

Cheers,
Mark
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland

Re: Java:Gateway connection from uuid

Postby FrankT » Thu Jun 23, 2016 8:21 am

Thanks Mark. That worked.
FrankT
 
Posts: 3
Joined: Fri Feb 26, 2016 11:42 am


Return to Developer Discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron