public interface DepthTracker
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this client
|
void |
close(boolean resetAllCategories)
Closes this client and resets all categories on the site IFF this is the last thread scraping the site and this scrape wasn't stopped early
|
void |
close(boolean resetAllCategories,
boolean fullReset)
Closes this client and resets all categories on the site IFF this is the last thread scraping the site and this scrape wasn't stopped early
|
boolean |
enterCategory(java.lang.String categoryName) |
boolean |
enterCategory(java.lang.String categoryName,
boolean isBaseCategory) |
boolean |
enterCategory(java.lang.String categoryName,
int numRecords) |
boolean |
enterCategory(java.lang.String categoryName,
int numRecords,
boolean isBaseCategory) |
void |
exitCategory() |
void |
exitCategory(int numRecords,
RunState endState) |
void |
exitCategory(RunState endState) |
APIConnection |
getApiConnection()
Returns the connection to the API that this client uses.
|
Category |
getCategory(java.lang.String name)
Gets a category by name, assuming the category is a child of whatever we are currently in
|
java.lang.Long |
getCurrentCategoryId()
Returns the ID of the category we are currently in
|
java.util.Date |
getCurrentCategoryInitialEntryDate()
Returns the initial entry time for the current category, or null if there are no categories (or the first entry date is unknown)
|
java.util.Date |
getCurrentCategoryLastEntryTimeForSuccessfulExit()
Returns the last entry time when this category was entered and a thread successfully exited it.
|
java.util.Date |
getCurrentCategoryPreviousEntryDate()
Returns the last entry time for the current category (prior to the current entry), or null if there are no categories (or the category had never been entered prior to this
entry)
|
java.util.List<java.lang.String> |
getCurrentStack()
Returns the currently tracked stack of elements, as a list
|
java.util.Date |
getOldestSuccessfulEntryExitEncountered() |
long |
getSiteId()
Returns the id of the site that the client is dealing with.
|
long |
getThreadId()
Returns the id of the thread that the client is running under.
|
boolean |
runInCategory(java.lang.String categoryName,
java.lang.Runnable runOnEntry)
Enters the category (if possible) and runs the runnable
|
@NotNull java.util.List<java.lang.String> getCurrentStack()
@Nullable java.lang.Long getCurrentCategoryId()
boolean runInCategory(java.lang.String categoryName, java.lang.Runnable runOnEntry)
categoryName
- The name of the category to enterrunOnEntry
- Something to run if entry was successful@Nullable java.util.Date getCurrentCategoryLastEntryTimeForSuccessfulExit()
@Nullable java.util.Date getCurrentCategoryInitialEntryDate()
@Nullable java.util.Date getCurrentCategoryPreviousEntryDate()
boolean enterCategory(java.lang.String categoryName)
boolean enterCategory(java.lang.String categoryName, int numRecords)
boolean enterCategory(java.lang.String categoryName, boolean isBaseCategory)
boolean enterCategory(java.lang.String categoryName, int numRecords, boolean isBaseCategory)
void exitCategory()
void exitCategory(RunState endState)
void exitCategory(int numRecords, RunState endState)
@Nullable java.util.Date getOldestSuccessfulEntryExitEncountered()
void close()
void close(boolean resetAllCategories)
resetAllCategories
- True to reset this this is the last thread scraping the site and this scrape wasn't stopped early. If true is given but there is another thread OR
this session was stopped early, it will still not reset the sitevoid close(boolean resetAllCategories, boolean fullReset)
resetAllCategories
- True to reset this this is the last thread scraping the site and this scrape wasn't stopped early. If true is given but there is another thread OR
this session was stopped early, it will still not reset the sitefullReset
- True to reset all fields, false to reset only the status of the categories and site but leave the entry/exit dates@Nullable Category getCategory(java.lang.String name)
name
- The name of the category@Nullable APIConnection getApiConnection()
long getSiteId()
long getThreadId()