Rakesh API

biz.wedoit4u
Class PartnerSession

java.lang.Object
  extended by biz.wedoit4u.Session
      extended by biz.wedoit4u.CMASession
          extended by biz.wedoit4u.PartnerSession

public final class PartnerSession
extends CMASession

A class that is used to store sessional information for a partner CMA user. This class also contains utility methods that are used to abstract business logic away from the presentation layer.

Copyright 2004, Rakesh Vidyadharan and wedoit4u.biz

Version:
$Id: PartnerSession.java,v 1.2 2004/05/26 11:42:30 rakesh Exp $
Author:
Rakesh Vidyadharan 22nd February 2004

Field Summary
private  javax.servlet.http.HttpSession httpSession
          The web session for the user using the CMA.
private  boolean loggedOn
          A flag used to indicate that a login session is valid.
private  int partnerId
          The partners.partner_id column value.
 
Constructor Summary
PartnerSession()
          The default constructor.
 
Method Summary
 CustomerTypeBean editCustomerType(javax.servlet.http.HttpServletRequest request)
          Create/edit a customer_types record.
 javax.servlet.http.HttpSession getHttpSession()
          Returns httpSession.
 boolean getLoggedOn()
          Returns loggedOn.
 int getPartnerId()
          Returns partnerId.
 PartnerStyleBean[] getPartnerStyleList()
          Return an Array of java bean instances of type PartnerStyleBean that are associated with the specified partner_id.
 void login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session)
          Log the partner in to the CMA.
 void logout()
          Log the partner out of the CMA.
 void setHttpSession(javax.servlet.http.HttpSession httpSession)
          Set httpSession.
 
Methods inherited from class biz.wedoit4u.CMASession
deleteCategory, deleteContent, deleteCustomer, deleteCustomerStyle, deleteCustomerType, deleteSiteProperty, deleteStyleClass, editCategory, editContent, editCustomer, editCustomerStyle, editCustomerType, editPartnerStyle, editSiteProperty, editStyleClass, getCustomerList, getCustomerList, getCustomerStyleList, getCustomerTypeList, getFormattedDate, getSitePropertyList, getStyleClassList
 
Methods inherited from class biz.wedoit4u.Session
getCategoryBeans, getCategoryList, getContentList, getContentList, getUniqueNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggedOn

private boolean loggedOn
A flag used to indicate that a login session is valid.


partnerId

private int partnerId
The partners.partner_id column value. This is used to store and provide access to the partnerId for the currently logged in user.


httpSession

private javax.servlet.http.HttpSession httpSession
The web session for the user using the CMA.

Constructor Detail

PartnerSession

public PartnerSession()
The default constructor. Does nothing special.

Method Detail

login

public void login(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpSession session)
           throws CMAException
Log the partner in to the CMA.

Parameters:
request - - The request from the client that contains the partner username and password information from the form POST.
session - - The httpSession instance to set.
Throws:
CMAException - - If system errors are encountered while attempting to log the user on, or if the username/password combination are invalid.

logout

public void logout()
Log the partner out of the CMA.


getPartnerStyleList

public PartnerStyleBean[] getPartnerStyleList()
                                       throws CMAException
Return an Array of java bean instances of type PartnerStyleBean that are associated with the specified partner_id.

Returns:
PartnerStyleBean[] - The array of java bean instances.
Throws:
CMAException - - If Naming or Finder exceptions are encountered while fetching the collection of java beans.
See Also:
PartnerStyleBean.findByPartner( int )

editCustomerType

public CustomerTypeBean editCustomerType(javax.servlet.http.HttpServletRequest request)
                                  throws CMAException
Create/edit a customer_types record. If the specified customer_type_id is 0 then a new record is created. The the specified customer_type_id exists in the database, then the associated record is updated, otherwise, a new record is created with the specified value.

Parameters:
request - - The request from the client that contains the form elements with all the value for the database fields.
Returns:
CustomerTypeBean - The appropriate instance of the java bean that represents a record in the table.
Throws:
CMAException - - If database errors are encountered while creating/editing the database record.

getLoggedOn

public final boolean getLoggedOn()
Returns loggedOn.

Returns:
boolean - The value/reference of/to loggedOn.

getPartnerId

public final int getPartnerId()
Returns partnerId.

Returns:
int - The value/reference of/to partnerId.

getHttpSession

public final javax.servlet.http.HttpSession getHttpSession()
Returns httpSession.

Returns:
HttpSession - The value/reference of/to httpSession.

setHttpSession

public final void setHttpSession(javax.servlet.http.HttpSession httpSession)
Set httpSession.

Parameters:
httpSession - - The value to set.

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan