Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

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

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:

  Session connection.createSession(String name, String password)
    throws AuthenticationException, CommunicationException;

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.

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

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.68197 sec.)

We're Hiring!