ome.system
Class Login

java.lang.Object
  extended by ome.system.Login

public class Login
extends Object

Provides simplified handling of login properties when creating a ServiceFactory. For more complicated uses, Properties can also be used. In which case, the constant strings provided in this class can be used as the keys to the properties instance passed to ServiceFactory.ServiceFactory(Properties).

Since:
1.0
Version:
1.0
Author:
Josh Moore      josh.moore@gmx.de
See Also:
(Internal version: $Rev$ $Date$)

Field Summary
static Login GUEST
          CopyOfLogin constant which has username and password values set to null and other values set to their default.
static String OMERO_EVENT
          Java property name for use in configuration of client login.
static String OMERO_GROUP
          Java property name for use in configuration of client login.
static String OMERO_PASS
          Java property name for use in configuration of client login.
static String OMERO_USER
          Java property name for use in configuration of client login.
 
Constructor Summary
Login(String user, String password)
          standard constructor which leaves OMERO_GROUP and OMERO_EVENT null.
Login(String user, String password, String group, String event)
          extended constructor.
 
Method Summary
 Properties asProperties()
          produces a copy of the internal fields as a Properties instance.
 String getEvent()
          simple getter for the event type passed into the constructor
 String getGroup()
          simple getter for the group name passed into the constructor
 String getName()
          simple getter for the user name passed into the constructor
 String getPassword()
          simple getter for the password passed into the constructor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OMERO_USER

public static final String OMERO_USER
Java property name for use in configuration of client login.

See Also:
Constant Field Values

OMERO_GROUP

public static final String OMERO_GROUP
Java property name for use in configuration of client login.

See Also:
Constant Field Values

OMERO_PASS

public static final String OMERO_PASS
Java property name for use in configuration of client login.

See Also:
Constant Field Values

OMERO_EVENT

public static final String OMERO_EVENT
Java property name for use in configuration of client login.

See Also:
Constant Field Values

GUEST

public static final Login GUEST
CopyOfLogin constant which has username and password values set to null and other values set to their default. This will permit logging in as an anonymous user.

Constructor Detail

Login

public Login(String user,
             String password)
standard constructor which leaves OMERO_GROUP and OMERO_EVENT null.

Parameters:
user - Experimenter.getOmeName(). Not null.
password - Cleartext password. Not null.

Login

public Login(String user,
             String password,
             String group,
             String event)
extended constructor. As with Login(String, String), user and password may not be null.

Parameters:
user - Experimenter.getOmeName(). Not null.
password - Cleartext password. Not null.
group - Group name. May be null.
event - Enumeration value of the EventType. May be null.
Method Detail

asProperties

public Properties asProperties()
produces a copy of the internal fields as a Properties instance. Only those keys are present for which a field is non-null.

Returns:
Properties. Not null.

getName

public String getName()
simple getter for the user name passed into the constructor

Returns:
user name. Not null unless Login == GUEST.

getPassword

public String getPassword()
simple getter for the password passed into the constructor

Returns:
password. Not null unless Login == GUEST

getGroup

public String getGroup()
simple getter for the group name passed into the constructor

Returns:
group name. May be null.

getEvent

public String getEvent()
simple getter for the event type passed into the constructor

Returns:
event type. May be null.


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.