Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/session SessionManager.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/session SessionManager.java

Author dlr
Full name Daniel Rall
Date 2000-11-06 17:18:35 PST
Message User: dlr
  Date: 00/11/06 17:18:35

  Modified: java/org/joist/session SessionManager.java
  Log:
  Added JavaDoc.
  
  Revision Changes Path
  1.20 +77 -92 joist/java/org/joist​/session/SessionMana​ger.java
  
  Index: SessionManager.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/session/Sessio​nManager.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SessionManager.java 2000/11/06 04:33:27 1.19
  +++ SessionManager.java 2000/11/07 01:18:34 1.20
  @@ -1,5 +1,5 @@
   /* ====================​====================​====================​====
  - * Copyright (c) 2000 Collab.Net. All rights reserved.
  + * Copyright (c) 2000 CollabNet. All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions are
  @@ -14,7 +14,7 @@
    *
    * 3. The end-user documentation included with the redistribution, if
    * any, must include the following acknowlegement: "This product includes
  - * software developed by Collab.Net (http://www.Collab.Net/)."
  + * software developed by CollabNet (http://www.CollabNet/)."
    * Alternately, this acknowlegement may appear in the software itself, if
    * and wherever such third-party acknowlegements normally appear.
    *
  @@ -24,7 +24,7 @@
    *
    * 5. Products derived from this software may not use the "Tigris" name
    * nor may "Tigris" appear in their names without prior written
  - * permission of Collab.Net.
  + * permission of CollabNet.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  @@ -41,7 +41,7 @@
    * ====================​====================​====================​========
    *
    * This software consists of voluntary contributions made by many
  - * individuals on behalf of Collab.Net.
  + * individuals on behalf of CollabNet.
    */
   
   package org.joist.session;
  @@ -66,55 +66,46 @@
   import org.joist.security.U​nsecureServlet;
   
   /**
  - * Manages information cached in the session.
  - *
  - * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.19 $
  - *
  - * Copyright (c) 1999 dataweb systems, inc.
  - * Copyright (c) 1999, 2000 Collab.Net, Inc.
  - */
  + * Manages information cached in the session.
  + *
  + * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  + * @version $Revision: 1.20 $
  + *
  + * Copyright (c) 1999 dataweb systems, inc.
  + * Copyright (c) 1999, 2000 CollabNet, Inc.
  + */
   
   public class SessionManager implements Serializable
   {
  - static private Log log = new Log("session", "Session Manager");
  - static private boolean debug = false;
  + private static Log log = new Log("session", "Session Manager");
  + private static final boolean debug = false;
   
       /**
  - * Construct with a session.
  - * @param session A variable of type HttpSession
  + * Creates a new instance.
  + *
  + * @param session A variable of type HttpSession
        */
       public SessionManager(HttpSession session)
       {
  - if (debug) log.debug("Creating a SessionManager for: " + session);
  - this.session = session;
  -
  - dataMgr = new DataManager();
  - permissions = new PermissionSet();
  + this(session, new DataManager());
       }
   
  -
       /**
  - * Construct with a session.
  + * Creates a new instance.
  + *
        * @param session A variable of type HttpSession
        * @param dataManager A variable of type DataManager
        */
       public SessionManager(HttpSession session, DataManager dataManager)
       {
  - if (debug)
  - {
  - log.debug("Creating a SessionManager with a supplied " +
  - "DataManager for: " + session);
  - }
  + if (debug) log.debug("Creating a SessionManager for: " + session);
           this.session = session;
  -
           dataMgr = dataManager;
           permissions = new PermissionSet();
       }
   
  -
       /**
  - * Resets the instance variables to initial state. Useful after logout.
  + * Resets the instance variables to initial state. Useful after logout.
        */
       public void reset()
       {
  @@ -130,52 +121,51 @@
           resetCancel();
       }
   
  -
       /**
        * The session object this manages.
        */
       private HttpSession session = null;
   
       /**
  - * Returns the current session
  - * @return A variable of type HttpSession
  + * Returns the current session.
  + *
  + * @return The managed session.
        */
       public HttpSession getSession()
       {
           return session;
       }
   
  -
       /**
  - * Returns the session ID
  - * @return A variable of type String
  + * Returns the session ID.
  + *
  + * @return The ID of the managed session.
        */
       public String getSessionID()
       {
           return session.getId();
       }
   
  -
       /**
  - * Returns the session creation time
  - * @return A variable of type String
  + * Returns the session creation time.
  + *
  + * @return The session creation time.
        */
       public String getCreationTime()
       {
           return new java.util.Date(sessi​on.getCreationTime()​).toString();
       }
   
  -
       /**
  - * Returns the session last access time
  - * @return A variable of type String
  + * Returns the session last access time.
  + *
  + * @return The session last access time.
        */
       public String getLastAccessedTime()
       {
           return new java.util.Date(sessi​on.getLastAccessedTi​me()).toString();
       }
   
  -
       /**
        * The data layer manager object for this session.
        */
  @@ -190,176 +180,171 @@
           return dataMgr;
       }
   
  -
       /**
  - * Registers a DataSet so it can be closed later.
  + * Registers a DataSet so it can be closed at a later time.
        *
  - * @param dataset a DataSet to be closed later
  + * @param dataSet The <code>DataSet​</code> to be closed later
        */
  - public void registerToClose(DataSet dataset)
  + public void registerToClose(DataSet dataSet)
       {
  - dataMgr.registerToCl​ose(dataset);
  + dataMgr.registerToCl​ose(dataSet);
       }
   
  -
       /**
  - * Does whatever cleanup is necessary.
  - * Asks the data layer manager to cleanup.
  + * Does whatever cleanup is necessary (delegating to the data layer
  + * manager).
        */
       public void cleanup()
       {
           dataMgr.cleanup();
       }
   
  -
       /**
  - * Is the session logged in?
  + * Whether the user associated with this session is logged in.
        */
       private Boolean isLoggedIn = Boolean.FALSE;
   
       /**
  - * Sets the isLoggedIn
  - * @param isLoggedIn A variable of type boolean
  + * Sets whether logged in.
  + *
  + * @param isLoggedIn Whether logged in.
        */
       public void isLoggedIn(boolean isLoggedIn)
       {
           this.isLoggedIn = new Boolean(isLoggedIn);
       }
   
  -
       /**
  - * Returns the isLoggedIn
  - * @return A variable of type Boolean
  + * Gets whether logged in.
  + *
  + * @return Whether logged in.
        */
       public Boolean isLoggedIn()
       {
           return isLoggedIn;
       }
   
  -
       /**
        * The user's loginID.
        */
       private String loginID = null;
   
       /**
  - * Sets the loginID
  - * @param loginID A variable of type String
  + * Sets the loginID.
  + *
  + * @param loginID The user's loginID.
        */
       public void setLoginID(String loginID)
       {
           this.loginID = loginID;
       }
   
  -
       /**
  - * Returns the loginID
  - * @return A variable of type String
  + * Returns the loginID.
  + *
  + * @return The user's loginID.
        */
       public String getLoginID()
       {
           return loginID;
       }
   
  -
       /**
        * The user's userID.
        */
       private String userID = null;
   
       /**
  - * Sets the userID
  - * @param userID A variable of type String
  + * Sets the userID.
  + *
  + * @param userID The user's database key.
        */
       public void setUserID(String userID)
       {
           this.userID = userID;
       }
   
  -
       /**
  - * Returns the userID
  - * @return A variable of type String
  + * Returns the user's database key.
  + *
  + * @return The user's database key.
        */
       public String getUserID()
       {
           return userID;
       }
   
  -
       /**
  - * Returns the userID as an Integer
  - * @return A variable of type Integer
  + * Returns the user's database key as an <code>Integer​</code>.
  + *
  + * @return The user's database key.
        */
       public Integer getIntegerUserID()
       {
           return Integer.valueOf(userID);
       }
   
  -
       /**
  - * Returns the userID as an int
  - * @return A variable of type int
  + * Returns user's database key as an <code>int</code>.
  + *
  + * @return The user's database key.
        */
       public int getIntUserID()
       {
           return Integer.parseInt(userID);
       }
   
  -
       /**
        * The user's name.
        */
       private String userName = null;
   
       /**
  - * Sets the userName
  - * @param userName A variable of type String
  + * Sets the user's name.
  + *
  + * @param userName The user's name.
        */
       public void setUserName(String userName)
       {
           this.userName = userName;
       }
   
  -
       /**
  - * Returns the userName
  - * @return A variable of type String
  + * Gets the user's name.
  + * @return The user's name.
        */
       public String getUserName()
       {
           return userName;
       }
   
  -
       /**
        * The user's email.
        */
       private String email = null;
   
       /**
  - * Sets the email
  - * @param email A variable of type String
  + * Sets the user's email.
  + * @param email The user's email.
        */
       public void setEmail(String email)
       {
           this.email = email;
       }
   
  -
       /**
  - * Returns the email
  - * @return A variable of type String
  + * Returns the user's email.
  + *
  + * @return The user's email.
        */
       public String getEmail()
       {
           return email;
       }
   
  -
       /**
  - * Checks that the loginID and password combination is valid.
  - * Retrieves User information and caches it in the session and context.
  + * Checks that the loginID and password combination is valid.
  + * Retrieves User information and caches it in the session and context.
        *
        * @param connection a JDBC connection
        * @param context the WebContext

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/session SessionManager.java dlr Daniel Rall 2000-11-06 17:18:35 PST
Messages per page: