Page 1 of 1

Java:Gateway connection from uuid

PostPosted: Thu Jun 23, 2016 7:33 am
by FrankT
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.)

Re: Java:Gateway connection from uuid

PostPosted: Thu Jun 23, 2016 8:02 am
by mtbc
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

Re: Java:Gateway connection from uuid

PostPosted: Thu Jun 23, 2016 8:21 am
by FrankT
Thanks Mark. That worked.