edu.jhu.tmaj.beans
Class SessionBean

java.lang.Object
  extended by edu.jhu.tmaj.beans.JBean
      extended by edu.jhu.tmaj.beans.SessionBean
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public final class SessionBean
extends JBean
implements java.io.Serializable

Represents the Sessions Table. A session represents one user scoring one scan (of an ArraySlide). In addition, a scoring-strategy is assigned to a session, which will control what fields will be displayed in the Image-Analysis application. A session that is finalized will ensure its data can not be changed. A session can be published, after which, it can be viewed by all users and can not be changed. A ScanID,UserID,ProjectID and SessionDescription uniquely identify a session. The SessionDescription was formally a sequential list for each unique ScanID,UserID, and ProjectID. So for example, if a user#51 creates a Session for ScanID#134 under ProjectID#10, and there is already a Session with those attributes, the SessionDescription would be 2. (The original SessionDescription with those attributes is 1.)

See Also:
Serialized Form

Field Summary
static DatabaseField CREATION_DATE_FIELD
           
static DatabaseField ID_FIELD
           
static DatabaseField IMAGE_ANALYSIS_SESSION_ID_FIELD
           
static DatabaseField IS_FINAL_FIELD
           
static DatabaseField IS_PUBLISHED_FIELD
           
static DatabaseField NOTES_FIELD
           
static DatabaseField OWNER_USER_ID_FIELD
           
static DatabaseField PROJECT_ID_FIELD
           
static DatabaseField SCAN_ID_FIELD
           
static DatabaseField SCORING_STRATEGY_ID_FIELD
           
static DatabaseField SESSION_DESCRIPTION_FIELD
           
 
Fields inherited from class edu.jhu.tmaj.beans.JBean
staticMetaData
 
Constructor Summary
SessionBean()
           
SessionBean(int projectID, int scanID, java.lang.String sessionDescription, int ownerUserID)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this Bean to another Bean by doing a case-insensitive compare using toString()
 void delete()
          Deletes this Bean from the database.
 java.util.Date getCreationDate()
          Returns the data this session was created.
 DatabaseField[] getFieldsArray()
          Returns an Array of TFields representing the columnnames of this bean.
 java.lang.Integer getIASessionID()
           
 JBean getNewInstance()
          Returns a new instance of this bean.
 java.lang.String getNotes()
           
 java.lang.Integer getOwnerUserID()
           
 java.lang.Integer getProjectID()
           
 java.lang.Integer getScanID()
          Returns the ScanID of the Scan this session was created on.
 java.lang.Integer getScoringStrategyID()
          Returns the scoringStrategyID of this session if the user has assigned one.
 java.lang.String getSessionDescription()
           
 java.lang.String getSQL(Search search)
          The sql statement sets some extra columns like SharedCount and HasForeignWritePermission.
 DatabaseTable getTable()
           
 boolean hasForeignWritePermission()
          Returns true if another user other than the owner may write data to this session.
 boolean hasGroupAdminAccess()
          Returns true if the current user can access this session because it belongs to someone with their group.
 void insert()
          Inserts the database row with the data in this Bean.
 boolean isFinal()
          Returns true if this has been marked as a final session.
 boolean isPublished()
          Returns true if the session has been published, meaning its data can not be changed and all users may view the data.
 boolean isSharedOut()
          Returns true if this session has been shared to other users.
 boolean isWritable(UserBean userBean)
           
 void setCreationDate(java.util.Date date)
           
 void setExtras(ArraySlideBean arraySlideBean, ScanBean scanBean, UserBean userBean)
           
 void setIASessionID(java.lang.Integer iaSessionID)
           
 void setIsFinal(boolean bool)
           
 void setIsPublished(boolean bool)
           
 void setNotes(java.lang.String notes)
           
 void setScoringStrategyID(java.lang.Integer scoringStrategyID)
           
 void setSessionDescription(java.lang.String sessionDescription)
           
 void setSharedOut(boolean bool)
           
 java.lang.String toString()
          Returns the primary key name of the bean's table, along with the bean's ID.
 void update()
          Updates the database row with the data in this Bean.
 
Methods inherited from class edu.jhu.tmaj.beans.JBean
createFromResultSet, createFromSwingMap, equals, getAllStaticColumnIdentifiers, getBaseSQL, getBeanInDatabase, getBeanList, getBeanList, getBooleanField, getClassForType, getColumnIdentifiers, getColumnNamesSet, getDateField, getDefaultBeanObjectForType, getDefaultSwingObjectForType, getDoubleField, getEnumerations, getFieldValue, getID_Bean_Map, getID, getIntegerField, getNonNullString, getPrimaryKeyField, getPrimaryKeyName, getSelectResponse, getStaticMetaData, getStringField, getSwingHash, getSwingToBeanObject, getTableName, getUserBean, getWantedColumnsString, getWantedStaticColumnIdentifiers, getWhereClause, hashCode, isEnumerated, setBooleanField, setDateField, setDoubleField, setID, setIntegerField, setStringField, setUserBean, verify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_FIELD

public static final DatabaseField ID_FIELD

OWNER_USER_ID_FIELD

public static final DatabaseField OWNER_USER_ID_FIELD

PROJECT_ID_FIELD

public static final DatabaseField PROJECT_ID_FIELD

SCAN_ID_FIELD

public static final DatabaseField SCAN_ID_FIELD

SESSION_DESCRIPTION_FIELD

public static final DatabaseField SESSION_DESCRIPTION_FIELD

SCORING_STRATEGY_ID_FIELD

public static final DatabaseField SCORING_STRATEGY_ID_FIELD

NOTES_FIELD

public static final DatabaseField NOTES_FIELD

CREATION_DATE_FIELD

public static final DatabaseField CREATION_DATE_FIELD

IS_PUBLISHED_FIELD

public static final DatabaseField IS_PUBLISHED_FIELD

IS_FINAL_FIELD

public static final DatabaseField IS_FINAL_FIELD

IMAGE_ANALYSIS_SESSION_ID_FIELD

public static final DatabaseField IMAGE_ANALYSIS_SESSION_ID_FIELD
Constructor Detail

SessionBean

public SessionBean()

SessionBean

public SessionBean(int projectID,
                   int scanID,
                   java.lang.String sessionDescription,
                   int ownerUserID)
Method Detail

delete

public void delete()
            throws java.sql.SQLException
Description copied from class: JBean
Deletes this Bean from the database.

Overrides:
delete in class JBean
Throws:
java.sql.SQLException

setSessionDescription

public void setSessionDescription(java.lang.String sessionDescription)

setNotes

public void setNotes(java.lang.String notes)

setIASessionID

public void setIASessionID(java.lang.Integer iaSessionID)

setCreationDate

public void setCreationDate(java.util.Date date)

setScoringStrategyID

public void setScoringStrategyID(java.lang.Integer scoringStrategyID)

setIsFinal

public void setIsFinal(boolean bool)

setIsPublished

public void setIsPublished(boolean bool)

setSharedOut

public void setSharedOut(boolean bool)

getOwnerUserID

public java.lang.Integer getOwnerUserID()

getProjectID

public java.lang.Integer getProjectID()

getScanID

public java.lang.Integer getScanID()
Returns the ScanID of the Scan this session was created on.


getScoringStrategyID

public java.lang.Integer getScoringStrategyID()
Returns the scoringStrategyID of this session if the user has assigned one.


getIASessionID

public java.lang.Integer getIASessionID()

getNotes

public java.lang.String getNotes()

getSessionDescription

public java.lang.String getSessionDescription()

isPublished

public boolean isPublished()
Returns true if the session has been published, meaning its data can not be changed and all users may view the data.


isFinal

public boolean isFinal()
Returns true if this has been marked as a final session.


isSharedOut

public boolean isSharedOut()
Returns true if this session has been shared to other users.


hasForeignWritePermission

public boolean hasForeignWritePermission()
Returns true if another user other than the owner may write data to this session.


hasGroupAdminAccess

public boolean hasGroupAdminAccess()
Returns true if the current user can access this session because it belongs to someone with their group.


getCreationDate

public java.util.Date getCreationDate()
Returns the data this session was created.


isWritable

public boolean isWritable(UserBean userBean)

setExtras

public void setExtras(ArraySlideBean arraySlideBean,
                      ScanBean scanBean,
                      UserBean userBean)

getNewInstance

public JBean getNewInstance()
Description copied from class: JBean
Returns a new instance of this bean.

Specified by:
getNewInstance in class JBean

getTable

public DatabaseTable getTable()
Specified by:
getTable in class JBean

getFieldsArray

public DatabaseField[] getFieldsArray()
Description copied from class: JBean
Returns an Array of TFields representing the columnnames of this bean.

Specified by:
getFieldsArray in class JBean

getSQL

public java.lang.String getSQL(Search search)
The sql statement sets some extra columns like SharedCount and HasForeignWritePermission.

Overrides:
getSQL in class JBean

insert

public void insert()
            throws java.sql.SQLException
Description copied from class: JBean
Inserts the database row with the data in this Bean. Summary: Bean->Database

Overrides:
insert in class JBean
Throws:
java.sql.SQLException

update

public void update()
            throws java.sql.SQLException
Description copied from class: JBean
Updates the database row with the data in this Bean. Summary: Bean->Database

Overrides:
update in class JBean
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
Description copied from class: JBean
Returns the primary key name of the bean's table, along with the bean's ID. Example: ProjectID#5

Overrides:
toString in class JBean

compareTo

public int compareTo(java.lang.Object o)
Description copied from class: JBean
Compares this Bean to another Bean by doing a case-insensitive compare using toString()

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class JBean