vgrid.server
Interface ExecutingPlodderServer

All Known Implementing Classes:
FileSystemExecutingPlodderServer, InMemoryExecutiongPlodderServer, TestFileServerEmpty

public interface ExecutingPlodderServer

The server interface allows accessing the server from the vendor as well as from the client side.

It allows the vendor to deploy tasks and the associated code, to query the progress of execution, to receive the results and finally to delete tasks and code if it is no longer needed on the server.

The client gets unfinished tasks for execution and may send back tasks as finished, unfinished or error weather the execution has finished, not finished or an error occured. It may also load the newest code from the server if it fails instantiating a task.


Method Summary
 void clear()
          Removes all tasks and libraries from the server.
 void deleteLibrary(java.lang.String name)
          Deletes a library from the server.
 void deleteTask(java.lang.String id)
          Deletes a task from the server.
 java.lang.String getConfiguration()
          A description of server, containing static information of the server.
 java.util.Collection getLibraryNames()
          Returns a collection of library names.
 java.util.Collection getLibraryUrls()
          Returns a collection of urls (java.net.URL) that describe the libraries deployed on the server.
 java.lang.String getNextId()
          Returns a unique ID to be used as Job- or Taskid.
 java.lang.String getState()
          A string describing the state of the server.
 java.io.InputStream getTask(java.lang.String id)
          Downloads a specific task from the server.
 java.util.Collection getTaskIds(TaskState state)
          Returns a collection of strings containing the task-ids beeing in a given state on the server.
 java.io.InputStream getUnfinishedTask()
          Provides an unfinished task to be executed by a client.
 java.lang.String getVersion()
          Returns the version of the server.
 void setErrorTask(java.io.InputStream in)
          Sends a task to the server.
 void setFinishedTask(java.io.InputStream in)
          Sends a task to the server.
 void setLibrary(java.lang.String name, java.io.InputStream in)
          Sends a library containing java classes in zipped form to the server.
 void setUnfinishedTask(java.io.InputStream in)
          Sends a task to the server.
 

Method Detail

getUnfinishedTask

java.io.InputStream getUnfinishedTask()
                                      throws VgridException
Provides an unfinished task to be executed by a client. The client cannot influence which task it gets.

Returns:
The task in serialized form.
Throws:
VgridException

getTask

java.io.InputStream getTask(java.lang.String id)
                            throws VgridException
Downloads a specific task from the server. Should be used by the vendor receive the finished tasks.

Parameters:
id - The id of the task to be downloaded.
Returns:
The task in serialized form.
Throws:
VgridException

deleteTask

void deleteTask(java.lang.String id)
                throws VgridException
Deletes a task from the server. This method should be used from the vendor to delete the finished tasks from the server.

Parameters:
id - The id of the task to be deleted.
Throws:
VgridException

getTaskIds

java.util.Collection getTaskIds(TaskState state)
                                throws VgridException
Returns a collection of strings containing the task-ids beeing in a given state on the server. Should be used by the vendor to find out if his tasks are finished.

Parameters:
state - The state what whos ids should be requested. Possible values: Server.TASK_STATE_UNFINISHED, Server.TASK_STATE_UNFINISHED, Server.TASK_STATE_REQUESTED, Server.TASK_STATE_ERROR, Server.TASK_STATE_ABSENT
Returns:
Collection of Strings.
Throws:
VgridException

setFinishedTask

void setFinishedTask(java.io.InputStream in)
                     throws VgridException
Sends a task to the server. Task that reach the client by calling this method are put into the finished category. They are not redistributed to other clients. The client should use that method to send a task to the server that was finished during execution.

Parameters:
in - The task in serialized form.
Throws:
VgridException

setUnfinishedTask

void setUnfinishedTask(java.io.InputStream in)
                       throws VgridException
Sends a task to the server. Task that reach the client by calling this method are put into the unfinished category. They are redistributed to other clients. The client should use that method to send a task to the server that was not finished during execution.

Parameters:
in - The task in serialized form.
Throws:
VgridException

setErrorTask

void setErrorTask(java.io.InputStream in)
                  throws VgridException
Sends a task to the server. Task that reach the client by calling this method are put into the error category. They are not redistributed to other clients. The client should use that method to send a task to the server that caused an error during execution.

Parameters:
in - The task in serialized form.
Throws:
VgridException

getConfiguration

java.lang.String getConfiguration()
A description of server, containing static information of the server.

Returns:
The current configuration of the server..

getState

java.lang.String getState()
A string describing the state of the server.


setLibrary

void setLibrary(java.lang.String name,
                java.io.InputStream in)
                throws VgridException
Sends a library containing java classes in zipped form to the server. Typically a .jar file.

Parameters:
name - The name of the library. E.g. mylib.jar, lib.jar, ... . The name must be unique. Therefore a prefix spezifying the vendor and the vendor project should be used.
in - A stream containing the library.
Throws:
VgridException

getLibraryUrls

java.util.Collection getLibraryUrls()
                                    throws VgridException
Returns a collection of urls (java.net.URL) that describe the libraries deployed on the server. These urls should be used by the client to download the latest versions of code to be executed. Is typically uses by an URLClassLoader.

Returns:
A collection of strings containing urls.
Throws:
VgridException

getLibraryNames

java.util.Collection getLibraryNames()
Returns a collection of library names. Used for the implementation of getLibraryUrls().

Returns:
Collection of java.net.URL.

deleteLibrary

void deleteLibrary(java.lang.String name)
                   throws VgridException
Deletes a library from the server. Should be used by the vendor to delete libraries that are no longer needed because no mor tasks are deployed using it.

Parameters:
name - The name of the libray to be deleted.
Throws:
VgridException

getVersion

java.lang.String getVersion()
Returns the version of the server.


getNextId

java.lang.String getNextId()
                           throws VgridException
Returns a unique ID to be used as Job- or Taskid.

Throws:
VgridException

clear

void clear()
Removes all tasks and libraries from the server.



vgrid the vienna grid project