com.aelitis.azureus.core.metasearch.impl
Class EngineImpl
java.lang.Object
com.aelitis.azureus.core.metasearch.impl.EngineImpl
- All Implemented Interfaces:
- Engine
- Direct Known Subclasses:
- PluginEngine, WebEngine
public abstract class EngineImpl
- extends Object
- implements Engine
Fields inherited from interface com.aelitis.azureus.core.metasearch.Engine |
AUTO_DL_SUPPORTED_NO, AUTO_DL_SUPPORTED_UNKNOWN, AUTO_DL_SUPPORTED_YES, AZ_VERSION, CT_AUDIO, CT_GAME, CT_VIDEO, ENGINE_SOURCE_LOCAL, ENGINE_SOURCE_RSS, ENGINE_SOURCE_STRS, ENGINE_SOURCE_UNKNOWN, ENGINE_SOURCE_VUZE, ENGINE_TYPE_JSON, ENGINE_TYPE_PLUGIN, ENGINE_TYPE_REGEX, ENGINE_TYPE_RSS, ENGINE_TYPE_STRS, FIELD_CATEGORY, FIELD_CDPLINK, FIELD_COMMENTS, FIELD_CONTENT_TYPE, FIELD_DATE, FIELD_DISCARD, FIELD_DOWNLOADBTNLINK, FIELD_DRMKEY, FIELD_HASH, FIELD_IDS, FIELD_NAME, FIELD_NAMES, FIELD_PEERS, FIELD_PLAYLINK, FIELD_PRIVATE, FIELD_RANK, FIELD_SEEDS, FIELD_SIZE, FIELD_SUPERSEEDS, FIELD_TORRENTLINK, FIELD_VOTES, FIELD_VOTES_DOWN, SC_AZID, SC_BATCH_PERIOD, SC_FORCE_FULL, SC_REMOVE_DUP_HASH, SC_SOURCE, SEL_STATE_AUTO_SELECTED, SEL_STATE_DESELECTED, SEL_STATE_FORCE_DESELECTED, SEL_STATE_MANUAL_SELECTED, SEL_STATE_STRINGS, VUZE_FILE_COMPONENT_ENGINE_KEY |
Constructor Summary |
protected |
EngineImpl(MetaSearchImpl _meta_search,
int _type,
long _id,
long _last_updated,
float _rank_bias,
String _name)
|
protected |
EngineImpl(MetaSearchImpl meta_search,
int type,
long id,
long last_updated,
float rank_bias,
String name,
JSONObject map)
|
protected |
EngineImpl(MetaSearchImpl _meta_search,
Map map)
|
Method Summary |
void |
addPotentialAssociation(String key)
|
protected void |
allocateUID(long id)
|
float |
applyRankBias(float _rank)
|
void |
checkSelectionStateRecorded()
|
protected void |
configDirty()
|
protected void |
debugLog(String str)
|
protected void |
debugStart()
|
void |
delete()
|
protected void |
exportBEncodedMappings(Map map,
String name,
List mappings)
|
protected void |
exportJSONMappings(JSONObject res,
String str,
List l,
boolean level_1)
|
protected void |
exportToBencodedMap(Map map,
boolean generic)
|
protected void |
exportToJSONObject(JSONObject res)
|
String |
exportToJSONString()
|
VuzeFile |
exportToVuzeFile()
|
VuzeFile |
exportToVuzeFile(boolean generic)
|
void |
exportToVuzeFile(File target)
|
int |
getAutoDownloadSupported()
|
int |
getAZVersion()
|
protected File |
getDebugFile()
|
long |
getId()
|
protected long |
getLastUpdateCheck()
|
long |
getLastUpdated()
|
protected boolean |
getLocalBoolean(String key,
boolean def)
|
protected long |
getLocalLong(String key,
long def)
|
protected String |
getLocalString(String key)
|
protected MetaSearchImpl |
getMetaSearch()
|
String |
getName()
|
float |
getPreferredWeighting()
|
float |
getRankBias()
|
int |
getSelectionState()
|
int |
getSource()
|
String |
getString()
|
String |
getString(boolean full)
|
int |
getType()
|
String |
getUID()
|
protected int |
getUpdateCheckSecs()
|
protected String |
getUpdateURL()
|
protected Object |
getUserData(Object key)
|
int |
getVersion()
|
protected List |
importBEncodedMappings(Map map,
String name)
|
protected static EngineImpl |
importFromBEncodedMap(MetaSearchImpl meta_search,
Map map)
|
static Engine |
importFromJSONString(MetaSearchImpl meta_search,
int type,
long id,
long last_updated,
float rank_bias,
String name,
String content)
|
protected List |
importJSONMappings(JSONObject map,
String str,
boolean level_1)
|
boolean |
isActive()
|
boolean |
isAuthenticated()
|
boolean |
isMine()
|
boolean |
isPublic()
|
protected void |
log(String str)
|
protected void |
log(String str,
Throwable e)
|
protected Result[] |
mapResults(Result[] results)
|
void |
recordSelectionState()
|
void |
reset()
resets to initial state (e.g. |
boolean |
sameLogicAs(Engine other)
Tests for sameness in terms of function (ignores id, selection state etc) |
Result[] |
search(SearchParameter[] params,
Map context,
int desired_max_matches,
int absolute_max_matches,
String headers,
ResultListener listener)
|
protected Result[] |
searchAndMap(SearchParameter[] params,
Map context,
int desired_max_matches,
int absolute_max_matches,
String headers,
ResultListener listener)
|
protected abstract Result[] |
searchSupport(SearchParameter[] params,
Map searchContext,
int desired_max_matches,
int absolute_max_matches,
String headers,
ResultListener listener)
|
protected void |
setDefaultUpdateCheckSecs(int secs)
|
protected void |
setId(long _id)
|
protected void |
setLastUpdateCheck(long when)
|
protected void |
setLocalBoolean(String key,
boolean value)
|
protected void |
setLocalLong(String key,
long value)
|
protected void |
setLocalString(String key,
String value)
|
protected void |
setLocalUpdateCheckSecs(int secs)
|
void |
setMine(boolean mine)
|
protected void |
setName(String n)
|
void |
setPreferredDelta(float delta)
|
protected void |
setPublic(boolean p)
|
void |
setRankBias(float _rank_bias)
|
void |
setSelectionState(int state)
|
void |
setSource(int _source)
|
protected void |
setUID(String str)
|
protected void |
setUpdateURL(String url)
|
protected void |
setUserData(Object key,
Object value)
|
protected void |
setVersion(int _v)
|
protected int |
vuzeFieldToID(String field)
|
protected String |
vuzeIDToField(int id)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LD_COOKIES
protected static final String LD_COOKIES
- See Also:
- Constant Field Values
LD_ETAG
protected static final String LD_ETAG
- See Also:
- Constant Field Values
LD_LAST_MODIFIED
protected static final String LD_LAST_MODIFIED
- See Also:
- Constant Field Values
LD_LAST_UPDATE_CHECK
protected static final String LD_LAST_UPDATE_CHECK
- See Also:
- Constant Field Values
LD_UPDATE_CHECK_SECS
protected static final String LD_UPDATE_CHECK_SECS
- See Also:
- Constant Field Values
LD_CREATED_BY_ME
protected static final String LD_CREATED_BY_ME
- See Also:
- Constant Field Values
LD_AUTO_DL_SUPPORTED
protected static final String LD_AUTO_DL_SUPPORTED
- See Also:
- Constant Field Values
LD_LINK_IS_TORRENT
protected static final String LD_LINK_IS_TORRENT
- See Also:
- Constant Field Values
EngineImpl
protected EngineImpl(MetaSearchImpl _meta_search,
int _type,
long _id,
long _last_updated,
float _rank_bias,
String _name)
EngineImpl
protected EngineImpl(MetaSearchImpl _meta_search,
Map map)
throws IOException
- Throws:
IOException
EngineImpl
protected EngineImpl(MetaSearchImpl meta_search,
int type,
long id,
long last_updated,
float rank_bias,
String name,
JSONObject map)
throws IOException
- Throws:
IOException
importFromBEncodedMap
protected static EngineImpl importFromBEncodedMap(MetaSearchImpl meta_search,
Map map)
throws IOException
- Throws:
IOException
importFromJSONString
public static Engine importFromJSONString(MetaSearchImpl meta_search,
int type,
long id,
long last_updated,
float rank_bias,
String name,
String content)
throws IOException
- Throws:
IOException
exportToBencodedMap
protected void exportToBencodedMap(Map map,
boolean generic)
throws IOException
- Throws:
IOException
exportToJSONObject
protected void exportToJSONObject(JSONObject res)
throws IOException
- Throws:
IOException
importJSONMappings
protected List importJSONMappings(JSONObject map,
String str,
boolean level_1)
throws IOException
- Throws:
IOException
exportJSONMappings
protected void exportJSONMappings(JSONObject res,
String str,
List l,
boolean level_1)
importBEncodedMappings
protected List importBEncodedMappings(Map map,
String name)
throws IOException
- Throws:
IOException
exportBEncodedMappings
protected void exportBEncodedMappings(Map map,
String name,
List mappings)
throws IOException
- Throws:
IOException
exportToJSONString
public String exportToJSONString()
throws IOException
- Specified by:
exportToJSONString
in interface Engine
- Throws:
IOException
getAZVersion
public int getAZVersion()
- Specified by:
getAZVersion
in interface Engine
getVersion
public int getVersion()
- Specified by:
getVersion
in interface Engine
setVersion
protected void setVersion(int _v)
getUID
public String getUID()
- Specified by:
getUID
in interface Engine
setUID
protected void setUID(String str)
allocateUID
protected void allocateUID(long id)
sameLogicAs
public boolean sameLogicAs(Engine other)
- Description copied from interface:
Engine
- Tests for sameness in terms of function (ignores id, selection state etc)
- Specified by:
sameLogicAs
in interface Engine
- Returns:
search
public Result[] search(SearchParameter[] params,
Map context,
int desired_max_matches,
int absolute_max_matches,
String headers,
ResultListener listener)
throws SearchException
- Specified by:
search
in interface Engine
- Throws:
SearchException
searchAndMap
protected Result[] searchAndMap(SearchParameter[] params,
Map context,
int desired_max_matches,
int absolute_max_matches,
String headers,
ResultListener listener)
throws SearchException
- Throws:
SearchException
mapResults
protected Result[] mapResults(Result[] results)
searchSupport
protected abstract Result[] searchSupport(SearchParameter[] params,
Map searchContext,
int desired_max_matches,
int absolute_max_matches,
String headers,
ResultListener listener)
throws SearchException
- Throws:
SearchException
delete
public void delete()
- Specified by:
delete
in interface Engine
getMetaSearch
protected MetaSearchImpl getMetaSearch()
vuzeFieldToID
protected int vuzeFieldToID(String field)
vuzeIDToField
protected String vuzeIDToField(int id)
getType
public int getType()
- Specified by:
getType
in interface Engine
setId
protected void setId(long _id)
getId
public long getId()
- Specified by:
getId
in interface Engine
getLastUpdated
public long getLastUpdated()
- Specified by:
getLastUpdated
in interface Engine
getName
public String getName()
- Specified by:
getName
in interface Engine
setName
protected void setName(String n)
isActive
public boolean isActive()
- Specified by:
isActive
in interface Engine
isPublic
public boolean isPublic()
- Specified by:
isPublic
in interface Engine
setPublic
protected void setPublic(boolean p)
getSelectionState
public int getSelectionState()
- Specified by:
getSelectionState
in interface Engine
setSelectionState
public void setSelectionState(int state)
- Specified by:
setSelectionState
in interface Engine
isAuthenticated
public boolean isAuthenticated()
- Specified by:
isAuthenticated
in interface Engine
recordSelectionState
public void recordSelectionState()
- Specified by:
recordSelectionState
in interface Engine
checkSelectionStateRecorded
public void checkSelectionStateRecorded()
- Specified by:
checkSelectionStateRecorded
in interface Engine
getSource
public int getSource()
- Specified by:
getSource
in interface Engine
setSource
public void setSource(int _source)
- Specified by:
setSource
in interface Engine
getRankBias
public float getRankBias()
- Specified by:
getRankBias
in interface Engine
setRankBias
public void setRankBias(float _rank_bias)
- Specified by:
setRankBias
in interface Engine
setPreferredDelta
public void setPreferredDelta(float delta)
- Specified by:
setPreferredDelta
in interface Engine
getPreferredWeighting
public float getPreferredWeighting()
- Specified by:
getPreferredWeighting
in interface Engine
applyRankBias
public float applyRankBias(float _rank)
- Specified by:
applyRankBias
in interface Engine
isMine
public boolean isMine()
- Specified by:
isMine
in interface Engine
setMine
public void setMine(boolean mine)
- Specified by:
setMine
in interface Engine
getUpdateURL
protected String getUpdateURL()
setUpdateURL
protected void setUpdateURL(String url)
getUpdateCheckSecs
protected int getUpdateCheckSecs()
setDefaultUpdateCheckSecs
protected void setDefaultUpdateCheckSecs(int secs)
setLocalUpdateCheckSecs
protected void setLocalUpdateCheckSecs(int secs)
getLastUpdateCheck
protected long getLastUpdateCheck()
setLastUpdateCheck
protected void setLastUpdateCheck(long when)
getAutoDownloadSupported
public int getAutoDownloadSupported()
- Specified by:
getAutoDownloadSupported
in interface Engine
- Returns:
- one of AUTO_DL constants above
configDirty
protected void configDirty()
addPotentialAssociation
public void addPotentialAssociation(String key)
- Specified by:
addPotentialAssociation
in interface Engine
exportToVuzeFile
public void exportToVuzeFile(File target)
throws IOException
- Specified by:
exportToVuzeFile
in interface Engine
- Throws:
IOException
exportToVuzeFile
public VuzeFile exportToVuzeFile()
throws IOException
- Specified by:
exportToVuzeFile
in interface Engine
- Throws:
IOException
exportToVuzeFile
public VuzeFile exportToVuzeFile(boolean generic)
throws IOException
- Throws:
IOException
reset
public void reset()
- Description copied from interface:
Engine
- resets to initial state (e.g. if the engine has state pertaining to what has/hasn't been downloaded
such as etags then this will be cleared)
- Specified by:
reset
in interface Engine
setLocalString
protected void setLocalString(String key,
String value)
getLocalString
protected String getLocalString(String key)
setLocalBoolean
protected void setLocalBoolean(String key,
boolean value)
getLocalBoolean
protected boolean getLocalBoolean(String key,
boolean def)
setLocalLong
protected void setLocalLong(String key,
long value)
getLocalLong
protected long getLocalLong(String key,
long def)
setUserData
protected void setUserData(Object key,
Object value)
getUserData
protected Object getUserData(Object key)
getDebugFile
protected File getDebugFile()
debugStart
protected void debugStart()
debugLog
protected void debugLog(String str)
log
protected void log(String str)
log
protected void log(String str,
Throwable e)
getString
public String getString()
- Specified by:
getString
in interface Engine
getString
public String getString(boolean full)