public class ScrapeableSession
extends java.lang.Object
implements java.lang.Comparable, com.screenscraper.client.util.WebConstants
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log |
APD_LOG_CONTENTS, APD_NUM_LOG_LINES_TO_DISPLAY, APD_RUN_RUNNING_SESSION_TAB, APD_RUNNABLE_SESSION_TAB, APD_SCHEDULED_SCRAPING_SESSION_DATA, APD_SCHEDULED_SESSION_TAB, APD_SCRAPEABLE_SESSION_ID, APD_SCRAPING_SESSION_ID, APD_TAB_TO_SELECT, APE_DISPLAY_ENTER_REGISTRATION_INFORMATION_DIALOG, APE_DISPLAY_IMPORT_DIALOG, APE_DISPLAY_NOTES_DIALOG, APE_DISPLAY_PEEK_LOG_DIALOG, APE_DISPLAY_SCRAPING_SESSION_SCHEDULER_DIALOG, APE_DISPLAY_SETTINGS_DIALOG, APE_HIDE_REGISTRATION_BUTTON, APE_REFRESH_TABLE, APE_SCHEDULE_SCRAPING_SESSION, APE_SELECT_RUN_RUNNING_TAB_AND_REFRESH_TABLE, APE_SELECT_RUNNABLE_TAB_AND_REFRESH_TABLE, APE_SELECT_SHEDULED_TAB_AND_REFRESH_TABLE, APE_SELECT_TAB, DEFAULT_REPEAT_DAYS, DEFAULT_REPEAT_HOURS, DEFAULT_REPEAT_MINUTES, DEFAULT_REPEAT_SECONDS, DEFAULT_THRESHOLD_RECORD_COUNT, DEFAULT_THRESHOLD_TIME, DEFAULT_TIMEOUT, DOWNLOAD_FILE_TYPE_SCRAPING_SESSION, ENABLED, ERROR_MESSAGE, FOLDER_NAME, GUI_DIALOG_BOX_SCHEDULE_SCRAPING_SESSION, GUI_PANEL_MAIN_CONTENT, GUI_PANEL_RUN_RUNNING_SCRAPING_SESSIONS, GUI_PANEL_RUNNABLE_SCRAPING_SESSIONS, GUI_PANEL_SCHEDULED_SCRAPING_SESSIONS, GUI_PANEL_TOP_NAV, GUI_SCREENSCRAPER_WEB, GUI_SETTINGS_DIALOG, IS_ERROR, NUM_DUPLICATE_RECORDS, NUM_ERROR_RECORDS, NUM_NEW_RECORDS, NUM_RECORDS, NUM_UPDATED_RECORDS, PREVIOUS_NUM_RECORDS, PREVIOUS_RUNNING_TIME, PREVIOUS_RUNNING_TIME_MACHINE_READABLE, REPEAT_DAYS, REPEAT_HOURS, REPEAT_MINUTES, REPEAT_SECONDS, RUNNING_TIME, RUNNING_TIME_MACHINE_READABLE, SCHEDULE_DATE, SCHEDULE_TIME, SCHEDULED_SCRAPING_SESSION_ID, SCRAPEABLE_SESSION_ID, SCRAPING_SESSION_ID, SCRAPING_SESSION_NAME, SCRAPING_SESSIONS, SECONDS_IN_A_DAY, SECONDS_IN_A_MINUTE, SECONDS_IN_AN_HOUR, SETTABLE_SESSION_VARIABLES, START_TIME, START_TIME_MACHINE_READABLE, STATUS, STATUS_COMPLETED, STATUS_IN_PROCESS, STATUS_INTERRUPTED, STATUS_NOT_STARTED, STATUS_UNKNOWN, THRESHOLD_RECORD_COUNT, THRESHOLD_TIME, TIMEOUT
Constructor and Description |
---|
ScrapeableSession(int scrapeableSessionID,
int scrapingSessionID,
long startTime,
long elapsedTime,
int numRecordsScraped,
int numNewRecordsScraped,
int numUpdatedRecordsScraped,
int numDuplicateRecordsScraped,
int numErrorRecordsScraped,
boolean fatalErrorOccurred,
java.lang.String status,
java.lang.String errorMessage,
java.lang.String logFileName,
int relativeTimeThreshold,
int relativeRecordsScrapedThreshold,
java.lang.String savedSessionVariables)
Initializes the object with all of its fields.
|
ScrapeableSession(ScrapingSession session)
Initializes the object for a running
ScrapingSession . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object scrapeableSession)
So that these things can be sorted.
|
void |
completeScrapingSession()
Handles salvaging any data it can from the
ScrapingSession
before it gets nuked. |
boolean |
containsReferenceToScrapingSession()
Indicates whether or not the object holds a reference to its
corresponding
ScrapingSession . |
void |
dumpToLog()
Dumps this ojbect to the log.
|
boolean |
getCompleteScrapingSessionWhenFinished()
Indicates whether or not the scrapeable session should be
completed when it finishes.
|
long |
getElapsedTime()
Gets the amount of time that did or has transpired in
running the session.
|
java.lang.String |
getErrorMessage()
Gets any error message(s) that might have been logged.
|
boolean |
getFatalErrorOccurred()
Gets whether or not an error occurred in running the session.
|
java.lang.String |
getHost()
Gets the host on which this session was run.
|
int |
getID()
Gets the database ID of this object.
|
java.lang.String |
getLogFileName()
Gets the name of the log file corresponding to this session.
|
int |
getNumDuplicateRecordsScraped()
Gets the number of duplicate records scraped.
|
int |
getNumErrorRecordsScraped()
Gets the number of error records scraped.
|
int |
getNumNewRecordsScraped()
Gets the number of new records scraped.
|
int |
getNumRecordsScraped()
Gets the number of records scraped.
|
int |
getNumUpdatedRecordsScraped()
Gets the number of updated records scraped.
|
java.lang.String |
getPort()
Gets the port on which this scraping session was run.
|
long |
getPreviousElapsedTime()
Gets the elapsed time of the scrapeable session just prior to this one.
|
int |
getPreviousNumRecordsScraped()
Gets the number of records scraped of the scrapeable session just prior
to this one.
|
int |
getRelativeRecordsScrapedThreshold()
Gets the records scraped threshold used for the scraping session.
|
int |
getRelativeTimeThreshold()
Gets the time threshold used for the scraping session.
|
boolean |
getRemoveLogFileOnCompletion()
Indicates whether or not the log file should be removed when the
scraping session completes.
|
java.lang.String |
getSavedSessionVariables()
Gets any saved session variables corresponding to the session.
|
ScrapingSession |
getScrapingSession()
If the session is in progress, this will get a reference to the
corresponding session.
|
int |
getScrapingSessionID()
Gets the database ID of the scraping session corresponding
to this object.
|
java.lang.String |
getScrapingSessionName()
Gets the name of the scraping session corresponding
to this object.
|
long |
getStartTime()
Gets the time the session was started.
|
java.lang.String |
getStartTimeAsString()
Gets the start time as a string.
|
java.lang.String |
getStatus()
Gets the status of the session, as defined by one of the corresponding
constants found in com.screenscraper.client.util.
|
void |
nullScrapingSessionReference()
Nulls out the reference this object has to its corresponding
ScrapingSession object. |
void |
save()
Saves the
ScrapeableSession to the database. |
void |
setCompleteScrapingSessionWhenFinished(boolean completeScrapingSessionWhenFinished)
Determines whether or not the scrapeable session should be
completed when it finishes.
|
void |
setPreviousElapsedTime(long previousElapsedTime)
Sets the elapsed time of the scrapeable session just prior to this one.
|
void |
setPreviousNumRecordsScraped(int previousNumRecordsScraped)
Sets the number of records scraped of the scrapeable session just prior
to this one.
|
void |
setRemoveLogFileOnCompletion(boolean removeLogFileOnCompletion)
Sets whether or not the log file should be removed when the
scraping session completes.
|
void |
setScrapingSession(ScrapingSession session)
If the session is in progress, this will set a reference to the
corresponding session.
|
void |
setScrapingSessionID(int scrapingSessionID)
Sets the database ID of the scraping session corresponding
to this object.
|
void |
setStatus(java.lang.String status)
Sets the status of the session, as defined by one of the corresponding
constants found in com.screenscraper.client.util.
|
public ScrapeableSession(@Nullable ScrapingSession session)
ScrapingSession
.session
- The running ScrapingSession
.public ScrapeableSession(int scrapeableSessionID, int scrapingSessionID, long startTime, long elapsedTime, int numRecordsScraped, int numNewRecordsScraped, int numUpdatedRecordsScraped, int numDuplicateRecordsScraped, int numErrorRecordsScraped, boolean fatalErrorOccurred, java.lang.String status, java.lang.String errorMessage, java.lang.String logFileName, int relativeTimeThreshold, int relativeRecordsScrapedThreshold, java.lang.String savedSessionVariables)
public int getID()
public int getScrapingSessionID()
public void setScrapingSessionID(int scrapingSessionID)
scrapingSessionID
- The ID of the scraping session.@Nullable public java.lang.String getScrapingSessionName()
public long getStartTime()
@Nullable public java.lang.String getStartTimeAsString()
@Nullable public java.lang.String getHost()
@Nullable public java.lang.String getPort()
public long getElapsedTime()
public long getPreviousElapsedTime()
public void setPreviousElapsedTime(long previousElapsedTime)
previousElapsedTime
- The elapsed time.public int getNumRecordsScraped()
public int getNumNewRecordsScraped()
public int getNumUpdatedRecordsScraped()
public int getNumDuplicateRecordsScraped()
public int getNumErrorRecordsScraped()
public int getPreviousNumRecordsScraped()
public void setPreviousNumRecordsScraped(int previousNumRecordsScraped)
previousNumRecordsScraped
- The number of records.public boolean getFatalErrorOccurred()
@Nullable public java.lang.String getStatus()
public void setStatus(java.lang.String status)
status
- The status.@Nullable public java.lang.String getErrorMessage()
@Nullable public java.lang.String getLogFileName()
public int getRelativeTimeThreshold()
public int getRelativeRecordsScrapedThreshold()
@Nullable public java.lang.String getSavedSessionVariables()
@Nullable public ScrapingSession getScrapingSession()
ScrapingSession
public void setScrapingSession(@Nullable ScrapingSession session)
session
- The ScrapingSession
public void save()
ScrapeableSession
to the database.public int compareTo(java.lang.Object scrapeableSession)
compareTo
in interface java.lang.Comparable
scrapeableSession
- The object to compare to.public boolean containsReferenceToScrapingSession()
ScrapingSession
.public void completeScrapingSession()
ScrapingSession
before it gets nuked.public boolean getRemoveLogFileOnCompletion()
public void setRemoveLogFileOnCompletion(boolean removeLogFileOnCompletion)
public boolean getCompleteScrapingSessionWhenFinished()
public void setCompleteScrapingSessionWhenFinished(boolean completeScrapingSessionWhenFinished)
completeScrapingSessionWhenFinished
- A boolean.public void nullScrapingSessionReference()
ScrapingSession
object.public void dumpToLog()