cluster5.client
Interface ClusterInterface

All Known Implementing Classes:
ClusterInterfaceImpl

public interface ClusterInterface

This is the interface for common user to access the cluster services.

Author:
ibisek

Method Summary
 java.lang.Long createTask(java.lang.Object argument)
          Creates new task to be evaluated on a remote machine by the project's main class.
 void dropProject()
          Deletes currently opened project with all associated tasks and files.
 float getProjectProgress()
           
 Project.Status getProjectStatus()
           
 Task getTask(java.lang.Long taskId)
          Returns instance of a task.
 Task.Status getTaskStatus(java.lang.Long taskId)
           
 java.util.List<java.lang.String> listProjectNames()
           
 java.util.List<java.lang.Long> listTaskIds()
           
 boolean login(java.lang.String loginName, java.lang.String password)
          Log in to the cluster server.
 void logout()
          Logout from the cluster server.
 boolean openProject(java.lang.String projectName)
          Opens a project identified by the name.
 void reconnect()
          If a RemoteException has been thrown due to communocation problem, call this method to renew connection to the server.
 void removeTask(java.lang.Long taskId)
          Deletes specified task.
 void runProject()
          Sets the project's flag to RUNNING singalizing the scheduler that this project configuration is ready to evaluate the project's tasks.
 void setProjectLibraries(java.lang.Class[] classes)
          Sets list of classes required by this project to be successfully evaluated.
 void setProjectMainClass(java.lang.Class clazz)
          Sets main class of a project.
 void stopProject()
          Sets the project's flag to STOPPED so no further tasks will be processed.
 

Method Detail

login

boolean login(java.lang.String loginName,
              java.lang.String password)
              throws java.rmi.RemoteException
Log in to the cluster server.

Parameters:
loginName -
password -
Returns:
true if the combination was accepted
Throws:
java.rmi.RemoteException

logout

void logout()
            throws java.rmi.RemoteException
Logout from the cluster server.

Throws:
java.rmi.RemoteException

openProject

boolean openProject(java.lang.String projectName)
                    throws java.rmi.RemoteException
Opens a project identified by the name.

Parameters:
projectName -
Returns:
true if a project was opened or created
Throws:
java.rmi.RemoteException

setProjectMainClass

void setProjectMainClass(java.lang.Class clazz)
                         throws java.rmi.RemoteException
Sets main class of a project.

Parameters:
clazz - main class of the project
Throws:
java.rmi.RemoteException

listProjectNames

java.util.List<java.lang.String> listProjectNames()
                                                  throws java.rmi.RemoteException
Returns:
all existing project names owned by the logged in user
Throws:
java.rmi.RemoteException

setProjectLibraries

void setProjectLibraries(java.lang.Class[] classes)
                         throws java.rmi.RemoteException
Sets list of classes required by this project to be successfully evaluated.

Parameters:
classes - list of classes needed to run the main class on remote machines
Throws:
java.rmi.RemoteException

runProject

void runProject()
                throws java.rmi.RemoteException
Sets the project's flag to RUNNING singalizing the scheduler that this project configuration is ready to evaluate the project's tasks.

Throws:
java.rmi.RemoteException

stopProject

void stopProject()
                 throws java.rmi.RemoteException
Sets the project's flag to STOPPED so no further tasks will be processed.

Throws:
java.rmi.RemoteException

getProjectStatus

Project.Status getProjectStatus()
                                throws java.rmi.RemoteException
Returns:
current status of the project
Throws:
java.rmi.RemoteException

getProjectProgress

float getProjectProgress()
                         throws java.rmi.RemoteException
Returns:
progress of the project, a number between 0 and 1 where 1 = processing of all all tasks has finished. The value is calculated by the task's status in the database.
Throws:
java.rmi.RemoteException

dropProject

void dropProject()
                 throws java.rmi.RemoteException
Deletes currently opened project with all associated tasks and files.

Throws:
java.rmi.RemoteException

createTask

java.lang.Long createTask(java.lang.Object argument)
                          throws java.rmi.RemoteException
Creates new task to be evaluated on a remote machine by the project's main class. Null is returned in case the argument is not serializable; then, the task is not created.

Parameters:
argument - a Serializable array, list or structure to be passed to the project's main class as an argument of parameters.
Returns:
task ID if the task was successfully created; null otherwise
Throws:
java.rmi.RemoteException

getTaskStatus

Task.Status getTaskStatus(java.lang.Long taskId)
                          throws java.rmi.RemoteException
Parameters:
taskId - task ID
Returns:
status of a task
Throws:
java.rmi.RemoteException

listTaskIds

java.util.List<java.lang.Long> listTaskIds()
                                           throws java.rmi.RemoteException
Returns:
list of task IDs for currently open project or empty list if there are no tasks or no project is open
Throws:
java.rmi.RemoteException

getTask

Task getTask(java.lang.Long taskId)
             throws java.rmi.RemoteException
Returns instance of a task. If the task is finished, there might be a result set (if a result was returned) and a log of system.out and system.err recorded during the taks' run.

Parameters:
taskId -
Returns:
instance of Task or null if there is no such task
Throws:
java.rmi.RemoteException

removeTask

void removeTask(java.lang.Long taskId)
                throws java.rmi.RemoteException
Deletes specified task.

Parameters:
taskId - task ID
Throws:
java.rmi.RemoteException

reconnect

void reconnect()
If a RemoteException has been thrown due to communocation problem, call this method to renew connection to the server.