org.activemath.tutor.coursegen.learnerModel
Class LearnerModelManager

java.lang.Object
  extended by org.activemath.tutor.coursegen.learnerModel.LearnerModelManager

public class LearnerModelManager
extends Object

Here we manage all the learnermodels, internal ones and external ones. Internal learner models are identified by predefined identifiers.


Field Summary
static String LM_ACTIVEMATH_ID
           
static String LM_TEMP_ID
           
protected static Category log
           
 
Method Summary
protected  String addInternalLearnerModel(AbstractLearnerModel lm)
          Add a internel Lernermodel to this manager.
protected  boolean addLearnerModel(String learnerModelAdressURL)
          Add a LearnerModel with its URL, which could be used to call the services of that LearnerModel (getProperty()).
static LearnerModelManager getInstance()
          Singeton constructor
protected  AbstractLearnerModel getLearnerModel(String learnerModelId)
          Return the LearnerModel Instance to the given Id, or null if not found.
protected  boolean hasLearnerModel(String id)
          Check if the given Id of a LearnerModel could be found in this Manager.
protected  boolean removeLearnerModel(String learnerModelId)
          Remove a LearnerModel from this Manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Category log

LM_ACTIVEMATH_ID

public static final String LM_ACTIVEMATH_ID
See Also:
Constant Field Values

LM_TEMP_ID

public static final String LM_TEMP_ID
See Also:
Constant Field Values
Method Detail

getInstance

public static LearnerModelManager getInstance()
Singeton constructor

Returns:
the unique instance of this class

addInternalLearnerModel

protected String addInternalLearnerModel(AbstractLearnerModel lm)
                                  throws UnknownLearnerModelException
Add a internel Lernermodel to this manager.

Parameters:
lm - (any kind of LernerModel, which extends the AbstractLearnerModel)
Returns:
a String as the local Id of the added LernerModel for this Manager.
Throws:
UnknownLearnerModelException

addLearnerModel

protected boolean addLearnerModel(String learnerModelAdressURL)
Add a LearnerModel with its URL, which could be used to call the services of that LearnerModel (getProperty()). Currently only learnermodels that offer a Webservice interface can be registered. An unique URL (given as the bindingURL by the client) identifies the corresponding learnermodel. This URL will be used as identifier in the map learnerModels that contains all internal and external learnermodels.

Parameters:
learnerModelAdressURL -
Returns:
true, if the given URL of the LearnerModel is valid and can be used for calling services. Otherwise false.

removeLearnerModel

protected boolean removeLearnerModel(String learnerModelId)
Remove a LearnerModel from this Manager.

Parameters:
learnerModelId -
Returns:
true, if the given Id is valid and then the learnerModel be successful removed, otherwise false.

getLearnerModel

protected AbstractLearnerModel getLearnerModel(String learnerModelId)
Return the LearnerModel Instance to the given Id, or null if not found.

Parameters:
learnerModelId -
Returns:
LearnerModel instance or null

hasLearnerModel

protected boolean hasLearnerModel(String id)
Check if the given Id of a LearnerModel could be found in this Manager.

Parameters:
id -
Returns: