public class SurtPrefixedDecideRule extends PredicatedDecideRule implements SeedListener, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, Checkpointable, org.springframework.beans.factory.BeanNameAware
Modifier and Type | Field and Description |
---|---|
protected String |
beanName |
protected Checkpoint |
recoveryCheckpoint |
protected SeedModule |
seeds |
protected boolean |
seedsAsSurtPrefixes
Should seeds also be interpreted as SURT prefixes.
|
protected org.archive.util.SurtPrefixSet |
surtPrefixes |
protected ConfigFile |
surtsDumpFile
Dump file to save SURT prefixes actually used: Useful debugging SURTs.
|
protected org.archive.io.ReadSource |
surtsSource
Text from which to infer SURT prefixes.
|
comment, kp
Constructor and Description |
---|
SurtPrefixedDecideRule() |
Modifier and Type | Method and Description |
---|---|
void |
addedSeed(CrawlURI curi)
If appropriate, convert seed notification into prefix-addition.
|
protected void |
buildSurtPrefixSet()
Construct the set of prefixes to use, from the seed list (
which may include both URIs and '+'-prefixed directives).
|
void |
concludedSeedBatch() |
void |
doCheckpoint(Checkpoint checkpointInProgress)
Do the actual checkpoint.
|
protected void |
dumpSurtPrefixSet()
Dump the current prefixes in use to configured dump file (if any)
|
protected boolean |
evaluate(CrawlURI uri)
Evaluate whether given object's URI is covered by the SURT prefix set
|
void |
finishCheckpoint(Checkpoint checkpointInProgress)
Cleanup/unlock; need not complete for a checkpoint to be valid.
|
boolean |
getAlsoCheckVia() |
SeedModule |
getSeeds() |
boolean |
getSeedsAsSurtPrefixes() |
ConfigFile |
getSurtsDumpFile() |
org.archive.io.ReadSource |
getSurtsSource() |
ConfigFile |
getSurtsSourceFile()
Deprecated.
redundant now that we have
surtsSource |
boolean |
nonseedLine(String line)
Consider nonseed lines as possible SURT prefix directives.
|
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
protected String |
prefixFrom(String uri) |
protected void |
readPrefixes() |
void |
setAlsoCheckVia(boolean checkVia) |
void |
setBeanName(String name) |
void |
setRecoveryCheckpoint(Checkpoint recoveryCheckpoint)
Used to inform a bean that it should restore its state from
the given Checkpoint when launched (Lifecycle start()).
|
void |
setSeeds(SeedModule seeds) |
void |
setSeedsAsSurtPrefixes(boolean seedsAsSurtPrefixes) |
void |
setSurtsDumpFile(ConfigFile cp) |
void |
setSurtsSource(org.archive.io.ReadSource surtsSource) |
void |
setSurtsSourceFile(ConfigFile cp)
Deprecated.
|
void |
startCheckpoint(Checkpoint checkpointInProgress)
Note a checkpoint is about to begin.
|
getDecision, innerDecide, setDecision
accepts, decisionFor, getComment, getEnabled, getKeyedProperties, onlyDecision, setComment, setEnabled
protected org.archive.io.ReadSource surtsSource
protected boolean seedsAsSurtPrefixes
protected ConfigFile surtsDumpFile
protected SeedModule seeds
protected org.archive.util.SurtPrefixSet surtPrefixes
protected String beanName
protected Checkpoint recoveryCheckpoint
public ConfigFile getSurtsSourceFile()
surtsSource
public void setSurtsSourceFile(ConfigFile cp)
public org.archive.io.ReadSource getSurtsSource()
public void setSurtsSource(org.archive.io.ReadSource surtsSource)
public boolean getSeedsAsSurtPrefixes()
public void setSeedsAsSurtPrefixes(boolean seedsAsSurtPrefixes)
public ConfigFile getSurtsDumpFile()
public void setSurtsDumpFile(ConfigFile cp)
public boolean getAlsoCheckVia()
public void setAlsoCheckVia(boolean checkVia)
public SeedModule getSeeds()
public void setSeeds(SeedModule seeds)
public void concludedSeedBatch()
concludedSeedBatch
in interface SeedListener
protected boolean evaluate(CrawlURI uri)
evaluate
in class PredicatedDecideRule
object
- Item to evaluate.protected void readPrefixes()
protected void dumpSurtPrefixSet()
protected void buildSurtPrefixSet()
public void addedSeed(CrawlURI curi)
addedSeed
in interface SeedListener
SeedListener.addedSeed(org.archive.modules.CrawlURI)
public boolean nonseedLine(String line)
nonseedLine
in interface SeedListener
SeedListener.nonseedLine(java.lang.String)
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void startCheckpoint(Checkpoint checkpointInProgress)
Checkpointable
startCheckpoint
in interface Checkpointable
checkpointInProgress
- Checkpointpublic void doCheckpoint(Checkpoint checkpointInProgress) throws IOException
Checkpointable
doCheckpoint
in interface Checkpointable
checkpointInProgress
- CheckpointIOException
public void finishCheckpoint(Checkpoint checkpointInProgress)
Checkpointable
finishCheckpoint
in interface Checkpointable
checkpointInProgress
- Checkpointpublic void setRecoveryCheckpoint(Checkpoint recoveryCheckpoint)
Checkpointable
setRecoveryCheckpoint
in interface Checkpointable
recoveryCheckpoint
- CheckpointCopyright © 2003-2014 Internet Archive. All Rights Reserved.