Package emissary.pickup
Class WorkUnit
- java.lang.Object
-
- emissary.pickup.WorkUnit
-
public final class WorkUnit extends Object
A WorkUnit is a unit of work a worker will process. The idea is to replace fileNameList. Currently, WorkBundle is set to only have one file, and so there will only be one WorkUnit.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfailedToParse()Gets the status of whether the WorkUnit failed to parsebooleanfailedToProcess()Gets the status of whether file had an error in processing.StringgetFileName()Gets the filename for the WorkUnitStringgetTransactionId()Gets the transaction Id of the WorkUnitstatic WorkUnitreadFromStream(DataInputStream in)voidsetFailedToParse()Sets the WorkUnit as a failed to parse WorkUnitvoidsetFailedToProcess()Sets the status of whether the WorkUnit had an error in processingvoidsetFilename(String fileName)Sets the filename for the WorkUnitvoidsetTransactionId(String transactionId)Sets the transaction id of the WorkUnitvoidwriteToStream(DataOutputStream out)
-
-
-
Method Detail
-
readFromStream
public static WorkUnit readFromStream(DataInputStream in) throws IOException
- Throws:
IOException
-
writeToStream
public void writeToStream(DataOutputStream out) throws IOException
- Throws:
IOException
-
getFileName
public String getFileName()
Gets the filename for the WorkUnit- Returns:
- the filename
-
setFilename
public void setFilename(String fileName)
Sets the filename for the WorkUnit- Parameters:
fileName- the filename
-
getTransactionId
public String getTransactionId()
Gets the transaction Id of the WorkUnit- Returns:
- the transaction Id
-
setTransactionId
public void setTransactionId(String transactionId)
Sets the transaction id of the WorkUnit- Parameters:
transactionId- the transaction id to set
-
setFailedToParse
public void setFailedToParse()
Sets the WorkUnit as a failed to parse WorkUnit
-
failedToParse
public boolean failedToParse()
Gets the status of whether the WorkUnit failed to parse- Returns:
- the boolean status of failed to parse
-
setFailedToProcess
public void setFailedToProcess()
Sets the status of whether the WorkUnit had an error in processing
-
failedToProcess
public boolean failedToProcess()
Gets the status of whether file had an error in processing.- Returns:
- the boolean status of file process
-
-