|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteteg.sinon.executor.CollectorExecutor
public class CollectorExecutor
Class that executes a Collector
instance.
Field Summary | |
---|---|
static java.lang.String |
LOG_FILENAME
Sinon log filename. |
Constructor Summary | |
---|---|
CollectorExecutor(Collector collector)
Single constructor of this class. |
Method Summary | |
---|---|
void |
addValueToProperty(java.lang.String propertyId,
java.lang.String value,
boolean allowDuplicates)
Adds a value to a multivalued property (list). |
void |
execute()
Executes all catalogs of this collector in sequence. |
void |
execute(Catalog[] catalogs)
Executes a list of catalogs of the coletor. |
int |
getBytesDownloaded()
Return the number of bytes already downloaded. |
Collector |
getCollector()
Retuns the Collector to be executed by this executor. |
byte[] |
getCurrentBytes()
Retorns the last downloaded document as a byte array. |
Catalog |
getCurrentCatalog()
Returns the Catalog being executed. |
DataExtraction |
getCurrentDataExtraction()
Returns the DataExtraction being executed. |
Page |
getCurrentPage()
Returns the Page being executed. |
int |
getCurrentPosition()
Retorns the current position in the current page. |
Step |
getCurrentStep()
Returns the Step being executed. |
java.lang.String |
getCurrentText()
Retorns the last downloaded page text. |
java.lang.String |
getExecutionInfo()
Returns a String containing some execution information. |
long |
getFinishTime()
Retorns the moment this executor finished in Unix timestamp format. |
org.apache.commons.logging.Log |
getLog()
Returns the logger used by this executor. |
int |
getPagesDownloaded()
Returns the number of pages already downloaded. |
java.lang.String |
getPropertyInfo()
Retorns a String containing name and value of all properties
set. |
java.lang.String[] |
getPropertyNames()
Retorns a String array containing the name of all
properties set in this executor. |
java.lang.Object |
getPropertyValue(java.lang.String propertyName)
Returns the value of the property which name is propertyName . |
long |
getStartTime()
Retorns the moment this executor started in Unix timestamp format. |
boolean |
isStopped()
Returns true if the execution of this collector
was stopped and false otherwise. |
void |
setProperty(java.lang.String propertyId,
java.lang.String value)
Sets a property. |
void |
stop()
Stops the execution of this collector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOG_FILENAME
Constructor Detail |
---|
public CollectorExecutor(Collector collector)
collector
- a Collector
instance.
java.lang.IllegalArgumentException
- if collector
is
null
.Method Detail |
---|
public void execute() throws SinonException
SinonException
- if some error ocurrs.public void execute(Catalog[] catalogs) throws SinonException
catalogs
- a Catalog
array..
SinonException
- if some unhandled error ocurrs.public Collector getCollector()
Collector
to be executed by this executor.
Collector
instance.public Catalog getCurrentCatalog()
Catalog
being executed.
Catalog
instance.public Page getCurrentPage()
Page
being executed.
Page
instance.public DataExtraction getCurrentDataExtraction()
DataExtraction
being executed.
DataExtraction
instance.public Step getCurrentStep()
Step
being executed.
Step
instance.public java.lang.String[] getPropertyNames()
String
array containing the name of all
properties set in this executor.
String[]
.public java.lang.String getCurrentText()
String
.public byte[] getCurrentBytes()
byte[]
.public int getCurrentPosition()
int
.public int getPagesDownloaded()
int
.public int getBytesDownloaded()
int
.public long getStartTime()
long
.public long getFinishTime()
long
.public java.lang.String getExecutionInfo()
String
containing some execution information.
String
.public java.lang.String getPropertyInfo()
String
containing name and value of all properties
set.
String
.public org.apache.commons.logging.Log getLog()
org.apache.commons.logging.Log
instance.public final java.lang.Object getPropertyValue(java.lang.String propertyName)
propertyName
. If this property is a simple value, a
String
is returned. Otherwise, a List
containing String
s is returned.
propertyName
- a String
.
propertyName
.
java.lang.IllegalArgumentException
- if propertyName
is
null
.public final void addValueToProperty(java.lang.String propertyId, java.lang.String value, boolean allowDuplicates) throws SinonException
setProperty(java.lang.String, java.lang.String)
.
propertyId
- a String
containing the property name.value
- a String
containing the value to be added.allowDuplicates
- a boolean
telling if duplicate values
can be added or not.
SinonException
- if propertyId
is not a multivalued
property.
java.lang.IllegalArgumentException
- if propertyId
is
null
or if value
is null
.public final void setProperty(java.lang.String propertyId, java.lang.String value) throws SinonException
addValueToProperty(java.lang.String, java.lang.String, boolean)
.
propertyId
- a String
containing the property name.value
- a String
containing the property value.
SinonException
- if propertyId
for o nome de uma propriedade
multivalorada.
java.lang.IllegalArgumentException
- se propertyId
é null
ou se
value
é null
.public void stop()
public boolean isStopped()
true
if the execution of this collector
was stopped and false
otherwise.
true
if the execution of this collector
was stopped and false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |