User Story #771 (closed)
Opened 17 years ago
Closed 16 years ago
Need a loginTest() method added to ServiceFactory
Reported by: | bwzloranger | Owned by: | jamoore |
---|---|---|---|
Priority: | minor | Milestone: | 3.0-Beta3 |
Component: | Services | Keywords: | n.a. |
Cc: | cxallan, jamoore | Story Points: | n.a. |
Sprint: | n.a. | Importance: | n.a. |
Total Remaining Time: | n.a. | Estimated Remaining Time: | n.a. |
Description
The current problem is this: Once you have created a connection to the service factory, the only way to find out if your connection URL is correct is by doing something like this:
exp = iQuery.findByString(Experimenter.class, "omeName", username);
which returns a reflected undeclairedThrowableException like this:
java.lang.reflect.UndeclaredThrowableException Caused by: javax.naming.CommunicationException:
My current work around is to catch all errors and look for:
e.getCause() instanceof communicationException
...but this is messy. What I would really like is to have a method like loginTest() which can throw a communicationException correctly.
Change History (3)
comment:1 Changed 17 years ago by jmoore
- Status changed from new to assigned
- Version changed from 3.0-M1 to 3.0-Beta1
comment:2 Changed 17 years ago by bwzloranger
All good.. thanks Josh :)
comment:3 Changed 16 years ago by jmoore
- Resolution set to fixed
- Status changed from assigned to closed
Merged into #864
This stems mostly from the fact that the JavaEE security mechanism doesn't allow me to do ANYTHING, without a proper login (well, as we're currently using it). The upcoming OmeroSessions bits will allow something like this. Basically the method signature will be:
The ServiceFactory will call this for you automatically, but if you'd rather check the exceptions, you can force the call with a createSession() call.