|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvgrid.server.FileSystemExecutingPlodderServer
public class FileSystemExecutingPlodderServer
Implementation of the server interface, using the local filesystem to manage the tasks.
| Field Summary | |
|---|---|
protected java.io.File |
errorDir
|
protected java.io.File |
finishedDir
|
protected java.io.File |
libDir
|
protected java.io.File |
requestedDir
|
static java.lang.String |
TASK_FILE_EXTENSION
|
protected java.io.File |
unfinishedDir
|
| Constructor Summary | |
|---|---|
FileSystemExecutingPlodderServer(java.io.File baseDir,
int nullTaskTimeout)
Creates an instance of the server. |
|
| 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()
Returns a html string describing the server. |
java.util.Collection |
getLibraryNames()
Returns a list of the names of the files located in the libraries directory. |
java.util.Collection |
getLibraryUrls()
Returns a collection of urls (java.net.URL) which describe the urls in that contain the code for the currently avaylable tasks. |
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)
Returns a task by id. |
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()
Returns a task out of the unfinished tasks directory. |
java.lang.String |
getVersion()
Returns the version of the server. |
void |
setErrorTask(java.io.InputStream in)
Receives an error task from a client. |
void |
setFinishedTask(java.io.InputStream in)
Receives a finished task from a client. |
void |
setLibrary(java.lang.String name,
java.io.InputStream in)
Stores a library in the libraries directory. |
void |
setUnfinishedTask(java.io.InputStream in)
Receives an unfinished task from a plodder or dispenser. |
java.lang.String |
toDescriptionString()
Returns a string describing the server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TASK_FILE_EXTENSION
protected java.io.File unfinishedDir
protected java.io.File finishedDir
protected java.io.File requestedDir
protected java.io.File errorDir
protected java.io.File libDir
| Constructor Detail |
|---|
public FileSystemExecutingPlodderServer(java.io.File baseDir,
int nullTaskTimeout)
baseDir - The base directory where to store all data.nullTaskTimeout - The time (in ms) after which a NullTask will be finished (stop
sleeping) and the client requests a new task.| Method Detail |
|---|
public java.io.InputStream getUnfinishedTask()
throws VgridException
getUnfinishedTask in interface ExecutingPlodderServerVgridExceptionExecutingPlodderServer.getUnfinishedTask()
public java.io.InputStream getTask(java.lang.String id)
throws VgridException
getTask in interface ExecutingPlodderServerid - The id of the task to be downloaded.
VgridException
public void setFinishedTask(java.io.InputStream in)
throws VgridException
setFinishedTask in interface ExecutingPlodderServerin - The task in serialized form.
VgridExceptionExecutingPlodderServer.setFinishedTask(java.io.InputStream)
public void setErrorTask(java.io.InputStream in)
throws VgridException
setErrorTask in interface ExecutingPlodderServerin - The task in serialized form.
VgridExceptionExecutingPlodderServer.setErrorTask(java.io.InputStream)public java.lang.String getConfiguration()
getConfiguration in interface ExecutingPlodderServerpublic java.lang.String toDescriptionString()
public void setUnfinishedTask(java.io.InputStream in)
setUnfinishedTask in interface ExecutingPlodderServerin - The task in serialized form.
public java.util.Collection getLibraryUrls()
throws VgridException
getLibraryUrls in interface ExecutingPlodderServerVgridExceptionpublic java.util.Collection getLibraryNames()
getLibraryNames in interface ExecutingPlodderServer
public void setLibrary(java.lang.String name,
java.io.InputStream in)
throws VgridException
setLibrary in interface ExecutingPlodderServername - 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.
VgridException
public void deleteTask(java.lang.String id)
throws VgridException
ExecutingPlodderServer
deleteTask in interface ExecutingPlodderServerid - The id of the task to be deleted.
VgridException
public java.util.Collection getTaskIds(TaskState state)
throws VgridException
ExecutingPlodderServer
getTaskIds in interface ExecutingPlodderServerstate - 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
VgridException
public void deleteLibrary(java.lang.String name)
throws VgridException
ExecutingPlodderServer
deleteLibrary in interface ExecutingPlodderServername - The name of the libray to be deleted.
VgridExceptionpublic java.lang.String getVersion()
ExecutingPlodderServer
getVersion in interface ExecutingPlodderServer
public java.lang.String getNextId()
throws VgridException
ExecutingPlodderServer
getNextId in interface ExecutingPlodderServerVgridExceptionpublic void clear()
ExecutingPlodderServer
clear in interface ExecutingPlodderServerpublic java.lang.String getState()
ExecutingPlodderServer
getState in interface ExecutingPlodderServer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||