|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.prc.server.ServerRPCHandler
public class ServerRPCHandler
Processes all client XML-RPC requests by delegating to the appropriate classes.
Field Summary | |
---|---|
private int |
numTransactions
|
Constructor Summary | |
---|---|
ServerRPCHandler()
|
Method Summary | |
---|---|
boolean |
addUser(java.lang.String userID,
java.lang.String eMailAddress)
Adds a new user to the system. |
int |
addWorkUnit(byte[] data)
Adds an ingress work unit to the transitioner using all default values. |
int |
addWorkUnit(byte[] data,
int priority,
int points)
Adds an ingress work unit to the transitioner. |
int |
addWorkUnit(byte[] data,
int priority,
int points,
double expirationTime)
Adds an ingress work unit to the transitioner. |
int |
addWorkUnit(java.lang.String taskID,
byte[] data,
int priority,
int points)
Adds an ingress work unit to the transitioner. |
int |
addWorkUnit(java.lang.String taskID,
byte[] data,
int priority,
int points,
double expirationTime)
Adds an ingress work unit to the transitioner. |
private void |
beginTransaction()
Begins a transaction. |
private void |
endTransaction()
Ends a transaction. |
private Result |
findResult(java.lang.String resultID)
Searches the database for a result with the given ID. |
private Volunteer |
findUser(java.lang.String userID,
java.lang.String eMailAddress)
Finds the volunteer in the database with the given user ID. |
private WorkUnit |
findWorkUnit(java.lang.String workUnitID)
Searches the database for a work unit with the given ID. |
java.util.Vector |
getAssociatedWorkUnit(java.lang.String resultID)
Gets work unit data associated with the given result. |
java.util.Vector |
getLastWorkUnit()
Searches the database for the last work unit that was added (by creation date). |
int |
getNumTransactions()
|
int |
getNumWorkUnits()
|
java.util.Vector |
getResultForValidation()
Gets the next result to be validated, or a set of results for which a canonical result must be selected. |
java.util.Vector |
getValidResultQueue(java.lang.String password)
Returns the valid result queue. |
java.util.Vector |
getWorkUnit(java.lang.String userID,
java.lang.String eMailAddress)
Gets the next available work unit to be computed by the given user. |
boolean |
kill(java.lang.String password)
Shuts down the server without waiting for all transitioner transactions to complete. |
boolean |
markResultInvalid(java.lang.String resultID)
Informs the transitioner that the specified ingress result is NOT valid. |
boolean |
markResultValid(java.lang.String resultID)
Informs the transitioner that the specified ingress result is valid. |
boolean |
returnResult(java.lang.String userID,
java.lang.String eMailAddress,
java.lang.String workUnitID,
byte[] resultData)
Adds an ingress result to the transitioner. |
boolean |
selectCanonicalResult(java.lang.String resultID)
Designates a result as the canonical result for a work unit. |
boolean |
shutdown(java.lang.String password)
Shuts down the server if given the correct password. |
boolean |
verifyUser(java.lang.String userID,
java.lang.String eMailAddress)
Determines whether a given user is a member of the project. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private volatile int numTransactions
Constructor Detail |
---|
public ServerRPCHandler()
Method Detail |
---|
public int getNumTransactions()
private void beginTransaction()
private void endTransaction()
public java.util.Vector getWorkUnit(java.lang.String userID, java.lang.String eMailAddress) throws EmptyQueueException, InvalidUserException
userID
- The volunteer's user ID.eMailAddress
- The user's e-mail address.
EmptyQueueException
InvalidUserException
public java.util.Vector getLastWorkUnit() throws EmptyQueueException
EmptyQueueException
public java.util.Vector getAssociatedWorkUnit(java.lang.String resultID) throws InvalidTaskException
resultID
- The result for which to find the associated work unit data.
InvalidTaskException
public boolean returnResult(java.lang.String userID, java.lang.String eMailAddress, java.lang.String workUnitID, byte[] resultData) throws InvalidUserException, InvalidTaskException, UnassignedUserException
userID
- The user who computed the result.eMailAddress
- The user's e-mail address.resultData
- The data contained in the result.
InvalidUserException
InvalidTaskException
UnassignedUserException
private Volunteer findUser(java.lang.String userID, java.lang.String eMailAddress) throws InvalidUserException
userID
- The user ID to search for.eMailAddress
- The user's e-mail address.
InvalidUserException
private WorkUnit findWorkUnit(java.lang.String workUnitID) throws InvalidTaskException
workUnitID
- The ID of the work unit to find.
InvalidTaskException
private Result findResult(java.lang.String resultID) throws InvalidTaskException
resultID
- The ID of the result to find.
InvalidTaskException
public boolean addUser(java.lang.String userID, java.lang.String eMailAddress)
userID
- The user ID for the new user.eMailAddress
- The new user's e-mail address.
public boolean verifyUser(java.lang.String userID, java.lang.String eMailAddress)
userID
- The user ID to search for.eMailAddress
- The new user's e-mail address.
public int addWorkUnit(java.lang.String taskID, byte[] data, int priority, int points, double expirationTime) throws DuplicateTaskIDException
taskID
- The ID of the new work unit.data
- The data contained in the work unit.priority
- The priority of the work unit.points
- The point value of the work unit.expirationTime
- The number of seconds until the work unit should expire.
DuplicateTaskIDException
public int addWorkUnit(java.lang.String taskID, byte[] data, int priority, int points) throws DuplicateTaskIDException
taskID
- The ID of the new work unit.data
- The data contained in the work unit.priority
- The priority of the work unit.points
- The point value of the work unit.
DuplicateTaskIDException
public int addWorkUnit(byte[] data, int priority, int points, double expirationTime)
data
- The data contained in the work unit.priority
- The priority of the work unit.points
- The point value of the work unit.expirationTime
- The number of seconds until the work unit should expire.
public int addWorkUnit(byte[] data, int priority, int points)
data
- The data contained in the work unit.priority
- The priority of the work unit.points
- The point value of the work unit.
public int addWorkUnit(byte[] data)
data
- The data contained in the work unit.
public int getNumWorkUnits()
public java.util.Vector getResultForValidation() throws EmptyQueueException
EmptyQueueException
public boolean markResultValid(java.lang.String resultID)
resultID
- The ID of the ingress result to mark as valid.
public boolean markResultInvalid(java.lang.String resultID)
resultID
- The ID of the ingress result to mark as invalid.
public boolean selectCanonicalResult(java.lang.String resultID)
resultID
- The task ID of the canonical result.
public java.util.Vector getValidResultQueue(java.lang.String password) throws InvalidPasswordException
password
- The project password.
InvalidPasswordException
public boolean shutdown(java.lang.String password) throws InvalidPasswordException
password
- The project password.
InvalidPasswordException
public boolean kill(java.lang.String password) throws InvalidPasswordException
password
- The project password.
InvalidPasswordException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |