org.experlog.base
Class ESStore

java.lang.Object
  extended by org.experlog.base.ESStore
All Implemented Interfaces:
ESTimer, Store

public class ESStore
extends java.lang.Object
implements Store, ESTimer

Author:
spengler An online store. this object contains all the client from a store

Field Summary
 ConnectionPool connectionPool_
           
 
Constructor Summary
ESStore(javax.servlet.ServletConfig cfg)
           
 
Method Summary
 void endClient(java.lang.String cid)
          Drop a specified client: releases all resources allocated for that client (database connection, etc...)
 OpenClient findClient(java.lang.String clientId)
          get an ESClient object from the clientPool pool
 OpenClient getClient(java.lang.String id, javax.servlet.http.HttpServletRequest req)
          get an client id from the servlet request if the client already exists, returns it or creates a new one, creates a new jdbc connection and store it in the clientPool object if the client exists, just set the cookie Called by ESServlet (upon HTTP request)
 int getClientPool()
           
 java.util.Hashtable getClientPoolTable()
           
 ConnectionPool getConnectionPool()
           
 java.lang.String getConPool()
           
static ESStore getInstance()
           
static ESStore getInstance(javax.servlet.ServletConfig cfg)
           
 java.lang.String getLevel()
           
 java.lang.String getLogRequest()
           
 int getMaxClients()
           
 java.lang.String getOutput()
           
 AppConfiguration getShopConfig()
           
 AppConfiguration getShopConfiguration()
          returns the shop configuration for the current shop
 java.lang.String getShopName()
           
 java.util.Properties getShopProps()
           
 int getState()
           
 java.util.Enumeration listClients()
          get all the ESClient objects from the clientPool pool
static java.lang.String makeId(java.lang.String name, boolean unique)
           
protected static boolean onWindows()
           
 void setClientPoolTable(java.util.Hashtable table)
           
 void setConnectionPool(ConnectionPool conn)
           
 void setLevel(java.lang.String newLevel)
           
 void setShopConfig(AppConfiguration conf)
           
 void setShopName(java.lang.String shop)
           
 void setShopProps(java.util.Properties shopProps)
           
 void setState(int state)
           
 void tick(java.lang.Object info)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectionPool_

public ConnectionPool connectionPool_
Constructor Detail

ESStore

public ESStore(javax.servlet.ServletConfig cfg)
Method Detail

getInstance

public static ESStore getInstance()

getInstance

public static ESStore getInstance(javax.servlet.ServletConfig cfg)

onWindows

protected static boolean onWindows()

makeId

public static java.lang.String makeId(java.lang.String name,
                                      boolean unique)

getClient

public OpenClient getClient(java.lang.String id,
                            javax.servlet.http.HttpServletRequest req)
                     throws java.lang.Exception
get an client id from the servlet request if the client already exists, returns it or creates a new one, creates a new jdbc connection and store it in the clientPool object if the client exists, just set the cookie Called by ESServlet (upon HTTP request)

Throws:
java.lang.Exception

findClient

public OpenClient findClient(java.lang.String clientId)
get an ESClient object from the clientPool pool


listClients

public java.util.Enumeration listClients()
get all the ESClient objects from the clientPool pool


endClient

public void endClient(java.lang.String cid)
Drop a specified client: releases all resources allocated for that client (database connection, etc...)

Specified by:
endClient in interface Store
Parameters:
cid - the ID of the client to drop

getShopConfiguration

public AppConfiguration getShopConfiguration()
returns the shop configuration for the current shop

Specified by:
getShopConfiguration in interface Store

getClientPool

public int getClientPool()

getConPool

public java.lang.String getConPool()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setShopName

public void setShopName(java.lang.String shop)

setClientPoolTable

public void setClientPoolTable(java.util.Hashtable table)

setConnectionPool

public void setConnectionPool(ConnectionPool conn)

setShopConfig

public void setShopConfig(AppConfiguration conf)

setShopProps

public void setShopProps(java.util.Properties shopProps)

getShopName

public java.lang.String getShopName()
Specified by:
getShopName in interface Store

getClientPoolTable

public java.util.Hashtable getClientPoolTable()

getConnectionPool

public ConnectionPool getConnectionPool()

getShopConfig

public AppConfiguration getShopConfig()

getShopProps

public java.util.Properties getShopProps()

getState

public int getState()

setState

public void setState(int state)

getMaxClients

public int getMaxClients()

setLevel

public void setLevel(java.lang.String newLevel)

getLevel

public java.lang.String getLevel()

getOutput

public java.lang.String getOutput()

getLogRequest

public java.lang.String getLogRequest()
Specified by:
getLogRequest in interface Store

tick

public void tick(java.lang.Object info)
Specified by:
tick in interface ESTimer