We're Hiring!

Retrieving client from session

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.

Retrieving client from session

Postby icaoberg » Thu Aug 25, 2011 2:22 pm

If I have a session, is it possible to retrieve the client object from the session. I am passing the session as an argument to a function and I need the client object. My code is

Code: Select all
#list of commands
commands = []
commands.append(omero.api.delete.DeleteCommand("/ImageAnnotationLink", link.id.val, None))
commands.append(omero.api.delete.DeleteCommand("/Annotation", annotation.id.val, None))

deleteHandlePrx = deleteService.queueDelete(commands)
callback = omero.callbacks.DeleteCallbackI(client, deleteHandlePrx)
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Retrieving client from session

Postby jmoore » Thu Aug 25, 2011 2:41 pm

Ivan,

it's not possible to retrieve a client from the session. The session is a remote object (ending in *Prx) and so there's no way to get a local object (the omero.client) from it. Can you pass the client instance to your function?

~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Retrieving client from session

Postby icaoberg » Thu Aug 25, 2011 2:56 pm

yes dont worry. i will need to change some function calls. that is all. we will need to update some other calls but it is ok.

ivan
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA


Return to Developer Discussion

Who is online

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