lcanals.tc.model.file
Class FactoryFile

java.lang.Object
  |
  +--lcanals.tc.model.file.FactoryFile
All Implemented Interfaces:
Factory

public class FactoryFile
extends java.lang.Object
implements Factory

Factory of core elements with storage into a file. This version is prepared only for being used in non-clustered servers, due to the way to obtain the next id from file
There is no problem about creating a lot of different object of factories because all of them access to the same identificators.

Author:
www.lfcanals.es.org

Constructor Summary
FactoryFile()
           
 
Method Summary
 Plan createPlan(java.lang.String userName, java.lang.String description)
          Builds a new plan which will be stored automatically into a file for each access to each member function.
 PlanTask createPlanTask(Estimator estimator, int difficulty, int risk, java.lang.String description)
          Build a plan task setting time units to 1 minute
 Plan obtainCurrentPlan(java.lang.String userName)
          Takes the current plan for the given user name from file
 Estimator obtainEstimator(java.lang.String userName)
          Read the estimator for the user from file or creates if no file exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryFile

public FactoryFile()
Method Detail

createPlan

public Plan createPlan(java.lang.String userName,
                       java.lang.String description)
Builds a new plan which will be stored automatically into a file for each access to each member function. The name of the file is fixed at construction time of the factory (see constructor)
Specified by:
createPlan in interface Factory

createPlanTask

public PlanTask createPlanTask(Estimator estimator,
                               int difficulty,
                               int risk,
                               java.lang.String description)
Build a plan task setting time units to 1 minute
Specified by:
createPlanTask in interface Factory

obtainCurrentPlan

public Plan obtainCurrentPlan(java.lang.String userName)
                       throws java.lang.InstantiationException
Takes the current plan for the given user name from file
Specified by:
obtainCurrentPlan in interface Factory
Returns:
null if there was no file for the given user (i.e. there was no plan)

obtainEstimator

public Estimator obtainEstimator(java.lang.String userName)
                          throws java.lang.InstantiationException
Read the estimator for the user from file or creates if no file exists. The type of estimator isd FixedEstimator
Specified by:
obtainEstimator in interface Factory


Luis F. Canals. Supported by www.sourceforge.net