Package edu.byu.hbll.box
Class ProcessContext
- java.lang.Object
-
- edu.byu.hbll.box.ProcessContext
-
public class ProcessContext extends Object
Contains information about each document to be processed including the ID and required dependencies.- Author:
- Charles Draper
-
-
Constructor Summary
Constructors Constructor Description ProcessContext(String id)
Creates a new simpleProcessContext
that only specifies which ID to process.ProcessContext(String id, Map<edu.byu.hbll.box.DocumentId,edu.byu.hbll.box.BoxDocument> dependencies)
Creates a newProcessContext
with the given ID and dependencies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<edu.byu.hbll.box.DocumentId,edu.byu.hbll.box.BoxDocument>
getDependencies()
Returns the dependencies.List<edu.byu.hbll.box.BoxDocument>
getDependencies(String sourceName)
Gets a list of all dependencies for the given source.edu.byu.hbll.box.BoxDocument
getDependency(edu.byu.hbll.box.DocumentId documentId)
Returns the dependency matching the given document id or null if none.edu.byu.hbll.box.BoxDocument
getDependency(String sourceName, String id)
Returns the dependency matching the given document id or null if none.edu.byu.hbll.box.BoxDocument
getFirstDependency(String sourceName)
Gets the first dependency for the given source.String
getId()
Returns the id to be processed.
-
-
-
Constructor Detail
-
ProcessContext
public ProcessContext(String id)
Creates a new simpleProcessContext
that only specifies which ID to process.- Parameters:
id
- the document ID to process.
-
ProcessContext
public ProcessContext(String id, Map<edu.byu.hbll.box.DocumentId,edu.byu.hbll.box.BoxDocument> dependencies)
Creates a newProcessContext
with the given ID and dependencies.- Parameters:
id
- the document ID to process.dependencies
- the dependencies of the document to be processed.
-
-
Method Detail
-
getId
public String getId()
Returns the id to be processed.- Returns:
- the id to be processed
-
getDependency
public edu.byu.hbll.box.BoxDocument getDependency(String sourceName, String id)
Returns the dependency matching the given document id or null if none.- Parameters:
sourceName
- sourceName of the dependencyid
- id of the dependency- Returns:
- the dependency identified by the given sourceName and id or null if dependency is not processed (not found)
-
getDependency
public edu.byu.hbll.box.BoxDocument getDependency(edu.byu.hbll.box.DocumentId documentId)
Returns the dependency matching the given document id or null if none.- Parameters:
documentId
- documentId of the dependency- Returns:
- the dependency identified by the given documentId or null if dependency is not processed (not found)
-
getDependencies
public Map<edu.byu.hbll.box.DocumentId,edu.byu.hbll.box.BoxDocument> getDependencies()
Returns the dependencies.- Returns:
- the dependencies
-
getDependencies
public List<edu.byu.hbll.box.BoxDocument> getDependencies(String sourceName)
Gets a list of all dependencies for the given source. If there are no dependencies for the source, an empty list is returned.- Parameters:
sourceName
- source name of the dependencies- Returns:
- list of dependency documents
-
getFirstDependency
public edu.byu.hbll.box.BoxDocument getFirstDependency(String sourceName)
Gets the first dependency for the given source. If there are no dependencies for the source, null is returned.- Parameters:
sourceName
- source name of the dependency- Returns:
- first dependency if one exists, null otherwise
-
-