public class RemoteScrapingSessionHandler extends java.lang.Thread implements ScrapingSessionNotifiable
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log
Used for logging.
|
LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARN, STR_LEVEL_DEBUG, STR_LEVEL_ERROR, STR_LEVEL_INFO, STR_LEVEL_WARN
Constructor and Description |
---|
RemoteScrapingSessionHandler(java.net.Socket socket)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
block()
Blocks and stops the handler.
|
void |
disconnect()
Kills the handler.
|
int |
getLoggingLevel()
Gets the current logging level.
|
boolean |
isBlocked()
Indicates whether or not the session is currently blocked.
|
void |
log(java.lang.String message)
Logs a messgae.
|
void |
logDebug(java.lang.String message)
Logs a message with LEVEL_DEBUG.
|
void |
logError(java.lang.String message)
Logs a message with LEVEL_ERROR.
|
void |
logInfo(java.lang.String message)
Logs a message with LEVEL_INFO.
|
void |
logWarn(java.lang.String message)
Logs a message with LEVEL_WARN.
|
void |
pollForData(ScrapingSession scrapingSession,
int pollFrequency)
Polls the scraping session for data to send to the client.
|
void |
run()
Runs the session.
|
void |
scrapingSessionCompleted()
Indicates that the scraping session has ended.
|
void |
setLoggingLevel(int loggingLevel)
Sets the current logging level.
|
void |
setManager(RemoteScrapingSessionHandlerManager manager)
Sets the
RemoteScrapingSessionHandlerManager that's managing this handler. |
void |
startService()
Starts the handler up.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public RemoteScrapingSessionHandler(java.net.Socket socket)
socket
- The socket used to communicate with the client.public void setManager(RemoteScrapingSessionHandlerManager manager)
RemoteScrapingSessionHandlerManager
that's managing this handler.manager
- A RemoteScrapingSessionHandlerManager
.public void startService()
public void disconnect()
public void block()
public boolean isBlocked()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void log(java.lang.String message)
ScrapingSessionNotifiable
.log
in interface Notifiable
log
in interface ScrapingSessionNotifiable
message
- The message to be logged.public int getLoggingLevel()
getLoggingLevel
in interface Notifiable
getLoggingLevel
in interface ScrapingSessionNotifiable
public void setLoggingLevel(int loggingLevel)
setLoggingLevel
in interface Notifiable
setLoggingLevel
in interface ScrapingSessionNotifiable
loggingLevel
- The logging level, as defined by one of the "LOGGING" constants.public void logDebug(java.lang.String message)
logDebug
in interface Notifiable
logDebug
in interface ScrapingSessionNotifiable
message
- The message to be logged.public void logInfo(java.lang.String message)
logInfo
in interface Notifiable
logInfo
in interface ScrapingSessionNotifiable
message
- The message to be logged.public void logWarn(java.lang.String message)
logWarn
in interface Notifiable
logWarn
in interface ScrapingSessionNotifiable
message
- The message to be logged.public void logError(java.lang.String message)
logError
in interface Notifiable
logError
in interface ScrapingSessionNotifiable
message
- The message to be logged.public void scrapingSessionCompleted()
ScrapingSessionNotifiable
.scrapingSessionCompleted
in interface ScrapingSessionNotifiable
public void pollForData(@NotNull ScrapingSession scrapingSession, int pollFrequency) throws java.io.IOException
scrapingSession
- The ScrapingSession
to poll.pollFrequency
- The frequency seconds we're to poll.java.io.IOException