com.bits.client.general.logic
Class Comm

java.lang.Object
  extended by com.bits.client.general.logic.Comm

public final class Comm
extends java.lang.Object

provides communication with the server

Author:
sophirha

Constructor Summary
Comm()
           
 
Method Summary
static boolean addTaskToExperiment(java.lang.String expName, java.lang.String taskName)
           
static boolean assignSessiontoUser(UserInfo user, RecommendedSession rs, boolean overide)
           
static boolean createExperiment(java.lang.String expName)
           
static boolean createTask(java.lang.String taskName, java.lang.String script)
           
static void deleteExperiment(java.lang.String name)
           
static void deleteTask(java.lang.String name)
           
static boolean deleteTaskFromExperiment(java.lang.String expName, java.lang.String taskName)
           
static Advisor.AdviceResult getAdviceForUser(java.lang.String userName, java.util.LinkedList<GameResult> resultList)
           
static TrainingProgram getCurrentTrainingProgram(UserInfo user)
           
static RecommendedSession getDoctorRecommendedSession(UserInfo patient)
           
static java.util.ArrayList<Task> getExperiment(java.lang.String expName)
           
static java.util.ArrayList<Experiment> getExperimentsList()
           
static java.lang.String getGame(standards3.games.game.GameProperties gameInfo)
          download game from server
static java.util.LinkedList<standards3.games.game.GameProperties> getGamePropertiesByFilter(java.lang.String filterExpression)
           
static java.util.LinkedList<GameResult> getGameResultArray(java.lang.String userID, java.util.UUID gameID)
           
static java.util.LinkedList<UserInfo> getPatients(UserInfo user)
           
static RecommendedSession getRecommendedSession(UserInfo user)
           
static java.util.HashMap<standards3.games.game.GameProperties,java.util.LinkedList<GameResult>> getResultsForUser(UserInfo ui)
           
static java.util.HashMap<java.lang.String,java.lang.String[][]> getServerConfigurationData()
           
static java.util.LinkedList<Session> getSessionList()
          getter
static java.lang.String getTask(java.lang.String taskName)
           
static java.util.ArrayList<Task> getTasksList()
           
static java.lang.Boolean initClientRemoting()
          initialization
static boolean isDBConnected()
           
static boolean isUserExist(java.lang.String username)
           
static java.lang.String loadRecordedTask()
          Deprecated. 
static java.lang.String loadScript()
          Deprecated. 
static UserInfo login(java.lang.String userID, java.lang.String password)
          perform login
static void refreshGamesServer()
           
static void saveRecordedTask(java.lang.String task)
          Deprecated. 
static boolean saveScript(java.lang.String script)
          Deprecated. 
static void setDBConnected(boolean isDBConnected)
           
static void setServerConfigurationData(java.lang.String fileName, java.lang.String[][] configMatrix)
           
static java.lang.Boolean setUserInfo(UserInfo user)
          setter
static boolean setUserTrainingProgram(UserInfo ui, TrainingProgram tp)
           
static java.lang.Boolean updateResults(UserInfo user, standards3.games.interfaces.IGameResult result, standards3.games.game.GameProperties gp, java.util.UUID tpid)
           
static boolean validatePassword(UserInfo ui, java.lang.String oldPassword, java.lang.String newPassword, java.lang.String newPassword2)
          validate password
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Comm

public Comm()
Method Detail

initClientRemoting

public static java.lang.Boolean initClientRemoting()
initialization

Returns:
status

isUserExist

public static boolean isUserExist(java.lang.String username)

getSessionList

public static java.util.LinkedList<Session> getSessionList()
getter

Returns:
list of sessions

getGame

public static java.lang.String getGame(standards3.games.game.GameProperties gameInfo)
download game from server

Parameters:
gameInfo - game to download
Returns:
file name of the downloaded game

login

public static UserInfo login(java.lang.String userID,
                             java.lang.String password)
perform login

Parameters:
userID -
password -
Returns:
details of user

setUserInfo

public static java.lang.Boolean setUserInfo(UserInfo user)
setter

Parameters:
user -
Returns:
status

validatePassword

public static boolean validatePassword(UserInfo ui,
                                       java.lang.String oldPassword,
                                       java.lang.String newPassword,
                                       java.lang.String newPassword2)
                                throws java.lang.Exception
validate password

Parameters:
ui -
oldPassword -
newPassword -
newPassword2 -
Returns:
true if all validations ok
Throws:
java.lang.Exception

updateResults

public static java.lang.Boolean updateResults(UserInfo user,
                                              standards3.games.interfaces.IGameResult result,
                                              standards3.games.game.GameProperties gp,
                                              java.util.UUID tpid)
Parameters:
user -
result -
gp -
tpid -
Returns:

getCurrentTrainingProgram

public static TrainingProgram getCurrentTrainingProgram(UserInfo user)
Parameters:
user -
Returns:

setUserTrainingProgram

public static boolean setUserTrainingProgram(UserInfo ui,
                                             TrainingProgram tp)
Parameters:
ui -
tp -
Returns:

getRecommendedSession

public static RecommendedSession getRecommendedSession(UserInfo user)
Parameters:
user -
Returns:

saveRecordedTask

@Deprecated
public static void saveRecordedTask(java.lang.String task)
Deprecated. 


saveScript

@Deprecated
public static boolean saveScript(java.lang.String script)
Deprecated. 


loadScript

@Deprecated
public static java.lang.String loadScript()
Deprecated. 


loadRecordedTask

@Deprecated
public static java.lang.String loadRecordedTask()
Deprecated. 


getGamePropertiesByFilter

public static java.util.LinkedList<standards3.games.game.GameProperties> getGamePropertiesByFilter(java.lang.String filterExpression)
Parameters:
filterExpression -
Returns:

getGameResultArray

public static java.util.LinkedList<GameResult> getGameResultArray(java.lang.String userID,
                                                                  java.util.UUID gameID)
Parameters:
userID -
gameID -
Returns:

refreshGamesServer

public static void refreshGamesServer()

getPatients

public static java.util.LinkedList<UserInfo> getPatients(UserInfo user)
Parameters:
user -
Returns:

getResultsForUser

public static java.util.HashMap<standards3.games.game.GameProperties,java.util.LinkedList<GameResult>> getResultsForUser(UserInfo ui)
Parameters:
ui -
Returns:

getDoctorRecommendedSession

public static RecommendedSession getDoctorRecommendedSession(UserInfo patient)
Parameters:
patient -
Returns:

createExperiment

public static boolean createExperiment(java.lang.String expName)
Parameters:
expName -
Returns:

createTask

public static boolean createTask(java.lang.String taskName,
                                 java.lang.String script)
Parameters:
taskName -
script -
Returns:

addTaskToExperiment

public static boolean addTaskToExperiment(java.lang.String expName,
                                          java.lang.String taskName)
Parameters:
expName -
taskName -
Returns:

deleteTaskFromExperiment

public static boolean deleteTaskFromExperiment(java.lang.String expName,
                                               java.lang.String taskName)
Parameters:
expName -
taskName -
Returns:

getExperiment

public static java.util.ArrayList<Task> getExperiment(java.lang.String expName)
Parameters:
expName -
Returns:

getTask

public static java.lang.String getTask(java.lang.String taskName)
Parameters:
taskName -
Returns:

getExperimentsList

public static java.util.ArrayList<Experiment> getExperimentsList()
Returns:

getTasksList

public static java.util.ArrayList<Task> getTasksList()
Returns:

deleteTask

public static void deleteTask(java.lang.String name)
Parameters:
name -

deleteExperiment

public static void deleteExperiment(java.lang.String name)
Parameters:
name -

assignSessiontoUser

public static boolean assignSessiontoUser(UserInfo user,
                                          RecommendedSession rs,
                                          boolean overide)
Parameters:
user -
rs -
overide -
Returns:

getServerConfigurationData

public static java.util.HashMap<java.lang.String,java.lang.String[][]> getServerConfigurationData()
Returns:

setServerConfigurationData

public static void setServerConfigurationData(java.lang.String fileName,
                                              java.lang.String[][] configMatrix)
Parameters:
fileName -
configMatrix -

setDBConnected

public static void setDBConnected(boolean isDBConnected)
Parameters:
isDBConnected -

isDBConnected

public static boolean isDBConnected()
Returns:

getAdviceForUser

public static Advisor.AdviceResult getAdviceForUser(java.lang.String userName,
                                                    java.util.LinkedList<GameResult> resultList)