uk.ac.ebi.intact.application.search2.business
Class IntactUserImpl

java.lang.Object
  |
  +--uk.ac.ebi.intact.application.search2.business.IntactUserImpl
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionBindingListener, IntactUserI, IntactUserIF

public class IntactUserImpl
extends java.lang.Object
implements IntactUserIF, javax.servlet.http.HttpSessionBindingListener

This class stores information about an Intact Web user session. Instead of binding multiple objects, only an object of this class is bound to a session, thus serving a single access point for multiple information.

This class implements the ttpSessionBindingListener interface for it can be notified of session time outs.

Version:
$Id: IntactUserImpl.java,v 1.4 2004/01/31 11:41:33 skerrien Exp $
Author:
Chris Lewington, Sugath Mudali (smudali@ebi.ac.uk)

Constructor Summary
IntactUserImpl(java.lang.String mapping, java.lang.String dsClass)
          Constructs an instance of this class with given mapping file and the name of the data source class.
 
Method Summary
 java.lang.String getDatabaseName()
          The name of the database connected to.
 java.lang.String getHelpLink()
           
 java.lang.String getSearchClass()
           
 java.lang.String getSearchValue()
           
 int getSelectedChunk()
           
 java.lang.String getUserName()
          Returns the Intact user.
 java.util.Collection search(java.lang.String objectType, java.lang.String searchParam, java.lang.String searchValue)
          This method provides a means of searching intact objects, within the constraints provided by the parameters to the method.
 void setHelpLink(java.lang.String link)
           
 void setSearchClass(java.lang.String searchClass)
           
 void setSearchValue(java.lang.String searchValue)
           
 void setSelectedChunk(int selectedChunk)
           
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
          Will call this method when an object is bound to a session.
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
          Will call this method when an object is unbound from a session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntactUserImpl

public IntactUserImpl(java.lang.String mapping,
                      java.lang.String dsClass)
               throws DataSourceException,
                      IntactException
Constructs an instance of this class with given mapping file and the name of the data source class. Side-effects of this constructor are that the User instance also has an IntactHelper and an XmlBuilder created for use during a user session.

Parameters:
mapping - the name of the mapping file.
dsClass - the class name of the Data Source.
Throws:
DataSourceException - for error in getting the data source; this could be due to the errors in repository files or the underlying persistent mechanism rejected user and password combination.
IntactException - thrown for any error in creating an IntactHelper, XmlBuilder etc
Method Detail

getSelectedChunk

public int getSelectedChunk()
Specified by:
getSelectedChunk in interface IntactUserIF

setSelectedChunk

public void setSelectedChunk(int selectedChunk)
Specified by:
setSelectedChunk in interface IntactUserIF

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Will call this method when an object is bound to a session. Not doing anything.

Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Will call this method when an object is unbound from a session.

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

getUserName

public java.lang.String getUserName()
Description copied from interface: IntactUserI
Returns the Intact user.

Specified by:
getUserName in interface IntactUserI
Returns:
the Intact user currently logged in. This methods could return null if there is no user associated with the current session (e.g., Editor) or for errors in retrieving user information from the database.

getDatabaseName

public java.lang.String getDatabaseName()
Description copied from interface: IntactUserI
The name of the database connected to.

Specified by:
getDatabaseName in interface IntactUserI
Returns:
the name of the database. Could be null for an error in getting the information from the database.

search

public java.util.Collection search(java.lang.String objectType,
                                   java.lang.String searchParam,
                                   java.lang.String searchValue)
                            throws IntactException
Description copied from interface: IntactUserI
This method provides a means of searching intact objects, within the constraints provided by the parameters to the method.

Specified by:
search in interface IntactUserI
Parameters:
objectType - the object type to be searched
searchParam - the parameter to search on (eg field)
searchValue - the search value to match with the parameter
Returns:
the results of the search (empty if no matches were found).
Throws:
IntactException - thrown if problems are encountered during the search process.

getSearchClass

public java.lang.String getSearchClass()
Specified by:
getSearchClass in interface IntactUserIF

setSearchClass

public void setSearchClass(java.lang.String searchClass)
Specified by:
setSearchClass in interface IntactUserIF

getSearchValue

public java.lang.String getSearchValue()
Specified by:
getSearchValue in interface IntactUserIF

setSearchValue

public void setSearchValue(java.lang.String searchValue)
Specified by:
setSearchValue in interface IntactUserIF

setHelpLink

public void setHelpLink(java.lang.String link)
Specified by:
setHelpLink in interface IntactUserIF

getHelpLink

public java.lang.String getHelpLink()
Specified by:
getHelpLink in interface IntactUserIF


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk