Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Client constructors public #34

Closed
Rdornier opened this issue Jun 30, 2022 · 3 comments
Closed

Get Client constructors public #34

Rdornier opened this issue Jun 30, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Rdornier
Copy link
Contributor

Hello @ppouchin,

We are trying to create an instance of the Client object without asking the user his credentials.
In our project, the user logged-in and the gateway is kept active while his credentials are lost. At some point, we need to create a Client object from the simple-omero-client API. For convienance, we do not want to ask the user to log-in twice.

I saw that Client object has 2 constructors but the interested one is private. For now, we use java reflection methods to get access to the private constructor (you can see how here).

In order to make a cleaner code, I was thinking to put this constructor public.

Client(Gateway gateway, SecurityContext ctx, ExperimenterWrapper user) {
       super(gateway, ctx, user);
   }

What do you think about that ? Is it possible ?

Thanks,
Rémy.

ping @lacan, @romainGuiet, @NicoKiaru

@ppouchin
Copy link
Member

Ok. Why did I make that private? I wonder...
I added this when I split the Client in "GatewayWrapper" and "Client" classes.

I don't think there's a reason why it should remain private. I'll add it to the 5.9.2 to-do.
Alternatively, it is possible to connect to an existing session with the session ID, but I think there are limitations (group switching for example).

@ppouchin ppouchin self-assigned this Jun 30, 2022
@ppouchin ppouchin added the enhancement New feature or request label Jun 30, 2022
@ppouchin ppouchin added this to the 5.9.2 milestone Jun 30, 2022
@Rdornier
Copy link
Contributor Author

Ok, great !
Thank you very much !

I just tried the connection with the session ID and it also works.

ppouchin added a commit that referenced this issue Aug 31, 2022
* Switch to pom-scijava 32.0.0
* Switch to JUnit5
* Send output from tests to target/logs
* Change setup to JDK 8
* Add methods to create a screen and refactor code to import images to screens
* Add method addAndReplaceTable (#32)
* Add test for addAndReplaceTable
* Make Client constructor with arguments public (#34)
* Add methods to retrieve well, plate and screen from an image (#35)
* Add LibraryChecker utility class to check if required libraries are available (#36)
* Make specific tests for LibraryChecker
* Add time increment to ImagePlus and set the position to the first slice
* Use float coordinates for IJ ROI conversion
* Split ImageTest
* Simplify key/value tests in ImageTest
* Prevent GatewayWrapper from containing null fields
* Override toString method in GatewayWrapper and add server information to context
* Change disconnect method so that a sudo client does not disconnect the gateway
* Replace System.err.println with logger
* Add tests
* Add serialVersionUID to classes that require it
* Fix and improve Javadoc
* Rename some variables
* Minor code improvements
@ppouchin
Copy link
Member

Should be solved in 5.9.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants