public class ScheduledScrapingSessionManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
ScheduledScrapingSessionManager() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addScheduledScrapingSession(ScheduledScrapingSession scheduledScrapingSession)
Adds a
ScheduledScrapingSession to the manager. |
static void |
dumpToLog()
Dumps all of the scheduled scraping sessions to the log.
|
static int |
getNumScheduledScrapingSessions()
Gets the number of scheduled scraping sessions held by the
manager.
|
static ScheduledScrapingSession |
getScheduledScrapingSessionByID(int id)
Gets a
ScheduledScrapingSession based on its database ID. |
static java.util.ArrayList |
getScheduledScrapingSessionsAsArrayListOfHashMaps()
Gets the
ScheduledScrapingSession objects in an
ArrayList of HashMap |
static java.util.Iterator |
getScheduledScrapingSessionsIterator()
Gets an
Iterator over which the various
ScheduledScrapingSession objects can be cycled. |
static boolean |
isLoaded()
Indicates whether or not the manager has been loaded.
|
static void |
reload()
Reloads all objects from the database.
|
static void |
removeScheduledScrapingSession(java.lang.String id)
Removes a
ScheduledScrapingSession from the manager, and deletes
it from the database. |
static void |
replaceScrapingSession(ScrapingSession existingScrapingSession,
ScrapingSession newScrapingSession)
Replaces any references to the existing scraping session with
the new scraping session.
|
static void |
runScheduledScrapingSessions()
Run any
ScheduledScrapingSession objects that
have reached the time to run. |
static boolean |
scheduledScrapingSessionExists(ScheduledScrapingSession scheduledScrapingSession)
Determines whether or not a
ScheduledScrapingSession
matching this one already exists. |
public static void reload()
public static boolean isLoaded()
public static int getNumScheduledScrapingSessions()
public static boolean scheduledScrapingSessionExists(@Nullable ScheduledScrapingSession scheduledScrapingSession)
ScheduledScrapingSession
matching this one already exists.scheduledScrapingSession
- The ScheduledScrapingSession
to compare.public static void replaceScrapingSession(@Nullable ScrapingSession existingScrapingSession, @Nullable ScrapingSession newScrapingSession)
existingScrapingSession
- The existing ScrapingSession
.newScrapingSession
- The new ScrapingSession
.public static boolean addScheduledScrapingSession(@Nullable ScheduledScrapingSession scheduledScrapingSession)
ScheduledScrapingSession
to the manager.scheduledScrapingSession
- A ScheduledScrapingSession
.public static java.util.Iterator getScheduledScrapingSessionsIterator()
Iterator
over which the various
ScheduledScrapingSession
objects can be cycled.Iterator
containnig ScheduledScrapingSession
objects.@NotNull public static java.util.ArrayList getScheduledScrapingSessionsAsArrayListOfHashMaps()
ScheduledScrapingSession
objects in an
ArrayList
of HashMap objects so that they
can be used on the client side.
public static ScheduledScrapingSession getScheduledScrapingSessionByID(int id)
ScheduledScrapingSession
based on its database ID.id
- The ID to match.ScheduledScrapingSession
if found; null, otherwise.public static void removeScheduledScrapingSession(@Nullable java.lang.String id) throws java.lang.Exception
ScheduledScrapingSession
from the manager, and deletes
it from the database.id
- The ID to match.java.lang.Exception
public static void runScheduledScrapingSessions()
ScheduledScrapingSession
objects that
have reached the time to run.public static void dumpToLog()