cluster5.server
Interface ServerInterface4User

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
Server
All Known Implementing Classes:
ServerImpl, ServerInterface4UserImpl

public interface ServerInterface4User
extends java.rmi.Remote


Method Summary
 java.lang.Long createTask(java.lang.String token, java.lang.Long projectId, byte[] argument)
          Creates a new task for specified user (by token) and project ID with an argument object which has to be serializable (!).
 void dropProject(java.lang.String token, java.lang.Long projectId)
          Drops a project and all related tasks and files.
 float getProjectProgress(java.lang.String token, java.lang.Long projectId)
           
 Project.Status getProjectStatus(java.lang.String token, java.lang.Long projectId)
           
 Task getTask(java.lang.String token, java.lang.Long taskId)
           
 Task.Status getTaskStatus(java.lang.String token, java.lang.Long taskId)
           
 java.util.List<java.lang.String> listProjectNames(java.lang.String token)
          Lists project for user specified by the token.
 java.util.List<java.lang.Long> listTaskIds(java.lang.String token, java.lang.Long projectId)
           
 java.lang.String login(java.lang.String loginName, java.lang.String password)
           
 void logout(java.lang.String token)
           
 Project openProject(java.lang.String token, java.lang.String projectName)
          Opens a project by name.
 void removeTask(java.lang.String token, java.lang.Long projectId, java.lang.Long taskId)
          Deletes specified task.
 void runProject(java.lang.String token, java.lang.Long projectId)
          Sets project's flag to RUNNING.
 void setProjectMainClass(java.lang.String token, java.lang.Long projectId, java.lang.String canonicalClassName)
          Sets project main class.
 void stopProject(java.lang.String token, java.lang.Long projectId)
          Sets project's flag to STOPPED.
 void uploadFile(java.lang.String token, java.lang.Long projectId, SharedFile file)
          Uploads recent version of a file which will be distributed across executors.
 

Method Detail

login

java.lang.String login(java.lang.String loginName,
                       java.lang.String password)
                       throws java.rmi.RemoteException
Parameters:
loginName -
password -
Returns:
token uniquely identifying the user. This token changes after every call to login() and is invalidated by calling logout()
Throws:
java.rmi.RemoteException

logout

void logout(java.lang.String token)
            throws java.rmi.RemoteException
Parameters:
token -
Throws:
java.rmi.RemoteException

openProject

Project openProject(java.lang.String token,
                    java.lang.String projectName)
                    throws java.rmi.RemoteException
Opens a project by name. If there is no such project, new project is created.

Parameters:
token -
projectName -
Returns:
instance of a project or null if there is no such one owned by the user identified by the token
Throws:
java.rmi.RemoteException

setProjectMainClass

void setProjectMainClass(java.lang.String token,
                         java.lang.Long projectId,
                         java.lang.String canonicalClassName)
                         throws java.rmi.RemoteException
Sets project main class. The class file must be uploaded and present on terminals before processing a task using this class. The main class MUST implement the ClusterTask interface.

Parameters:
token -
projectId -
canonicalClassName -
Throws:
java.rmi.RemoteException

dropProject

void dropProject(java.lang.String token,
                 java.lang.Long projectId)
                 throws java.rmi.RemoteException
Drops a project and all related tasks and files.

Parameters:
token -
projectId -
Throws:
java.rmi.RemoteException

listProjectNames

java.util.List<java.lang.String> listProjectNames(java.lang.String token)
                                                  throws java.rmi.RemoteException
Lists project for user specified by the token.

Parameters:
token -
Returns:
list of project names
Throws:
java.rmi.RemoteException

getProjectStatus

Project.Status getProjectStatus(java.lang.String token,
                                java.lang.Long projectId)
                                throws java.rmi.RemoteException
Parameters:
token -
projectId -
Returns:
current project status
Throws:
java.rmi.RemoteException

getProjectProgress

float getProjectProgress(java.lang.String token,
                         java.lang.Long projectId)
                         throws java.rmi.RemoteException
Parameters:
token -
projectId -
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

runProject

void runProject(java.lang.String token,
                java.lang.Long projectId)
                throws java.rmi.RemoteException
Sets project's flag to RUNNING.

Parameters:
token -
projectId -
Throws:
java.rmi.RemoteException

stopProject

void stopProject(java.lang.String token,
                 java.lang.Long projectId)
                 throws java.rmi.RemoteException
Sets project's flag to STOPPED.

Parameters:
token -
projectId -
Throws:
java.rmi.RemoteException

uploadFile

void uploadFile(java.lang.String token,
                java.lang.Long projectId,
                SharedFile file)
                throws java.rmi.RemoteException
Uploads recent version of a file which will be distributed across executors.

Parameters:
token -
projectId -
file -
Throws:
java.rmi.RemoteException

createTask

java.lang.Long createTask(java.lang.String token,
                          java.lang.Long projectId,
                          byte[] argument)
                          throws java.rmi.RemoteException
Creates a new task for specified user (by token) and project ID with an argument object which has to be serializable (!).

Parameters:
token -
projectId -
argument -
Returns:
task ID
Throws:
java.rmi.RemoteException

getTaskStatus

Task.Status getTaskStatus(java.lang.String token,
                          java.lang.Long taskId)
                          throws java.rmi.RemoteException
Parameters:
token -
taskId -
Returns:
current status of a task identified by task ID
Throws:
java.rmi.RemoteException

listTaskIds

java.util.List<java.lang.Long> listTaskIds(java.lang.String token,
                                           java.lang.Long projectId)
                                           throws java.rmi.RemoteException
Parameters:
token -
projectId -
Returns:
list of task IDs for specific project ID
Throws:
java.rmi.RemoteException

getTask

Task getTask(java.lang.String token,
             java.lang.Long taskId)
             throws java.rmi.RemoteException
Parameters:
token -
taskId -
Returns:
a task object no matter in which state
Throws:
java.rmi.RemoteException

removeTask

void removeTask(java.lang.String token,
                java.lang.Long projectId,
                java.lang.Long taskId)
                throws java.rmi.RemoteException
Deletes specified task.

Parameters:
token -
projectId -
taskId -
Throws:
java.rmi.RemoteException