Class EngineImpl
java.lang.Object
com.biglybt.core.metasearch.impl.EngineImpl
- All Implemented Interfaces:
Engine
- Direct Known Subclasses:
PluginEngine, WebEngine
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate Listprivate longprivate booleanprivate longprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String(package private) static booleanprivate MetaSearchImplprivate Stringprivate floatprivate floatprivate Listprivate intprivate booleanprivate intprivate intprivate byte[]private intprivate Stringprivate Mapprivate intFields inherited from interface 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_ASSET_DATE, 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_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
ConstructorsModifierConstructorDescriptionprotectedEngineImpl(MetaSearchImpl _meta_search, int _type, long _id, long _last_updated, float _rank_bias, String _name) protectedEngineImpl(MetaSearchImpl meta_search, int type, long id, long last_updated, float rank_bias, String name, JSONObject map) protectedEngineImpl(MetaSearchImpl _meta_search, Map map) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidallocateUID(long id) floatapplyRankBias(float _rank) voidprotected voidprotected voidprotected voidvoiddelete()protected voidexportBEncodedMappings(Map map, String name, List mappings) protected voidexportJSONMappings(JSONObject res, String str, List l, boolean level_1) protected voidexportToBencodedMap(Map map, boolean generic) protected voidexportToVuzeFile(boolean generic) voidexportToVuzeFile(File target) intintprotected FilelonggetId()protected longlongprotected booleangetLocalBoolean(String key, boolean def) private Stringprotected longgetLocalLong(String key, long def) protected StringgetLocalString(String key) protected MetaSearchImplgetName()floatfloatintintgetString(boolean full) intgetType()getUID()protected intprotected Stringprotected ObjectgetUserData(Object key) intprotected ListimportBEncodedMappings(Map map, String name) protected static EngineImplimportFromBEncodedMap(MetaSearchImpl meta_search, Map map) static EngineimportFromJSONString(MetaSearchImpl meta_search, int type, long id, long last_updated, float rank_bias, String name, String content) protected ListimportJSONMappings(JSONObject map, String str, boolean level_1) booleanisActive()booleanbooleanisMine()booleanisPublic()protected voidprotected voidprotected Result[]mapResults(Result[] results) voidvoidreset()resets to initial state (e.g.booleansameLogicAs(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 voidsetDefaultUpdateCheckSecs(int secs) protected voidsetId(long _id) protected voidsetLastUpdateCheck(long when) protected voidsetLocalBoolean(String key, boolean value) protected voidsetLocalLong(String key, long value) protected voidsetLocalString(String key, String value) protected voidsetLocalUpdateCheckSecs(int secs) voidsetMine(boolean mine) voidvoidsetPreferredDelta(float delta) protected voidsetPublic(boolean p) voidsetRankBias(float _rank_bias) voidsetSelectionState(int state) voidsetSource(int _source) protected voidprotected voidsetUpdateURL(String url) protected voidsetUserData(Object key, Object value) protected voidsetVersion(int _v) protected intvuzeFieldToID(String field) protected StringvuzeIDToField(int id) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Engine
exportToBencodedMap, exportToBencodedMap, getDownloadLinkCSS, getIcon, getNameEx, getReferer, isAnonymous, isShareable, supportsContext, supportsField
-
Field Details
-
DEFAULT_UPDATE_CHECK_SECS
private static final int DEFAULT_UPDATE_CHECK_SECS- See Also:
-
logging_enabled
static boolean logging_enabled -
LD_COOKIES
- See Also:
-
LD_ETAG
- See Also:
-
LD_LAST_MODIFIED
- See Also:
-
LD_LAST_UPDATE_CHECK
- See Also:
-
LD_UPDATE_CHECK_SECS
- See Also:
-
LD_CREATED_BY_ME
- See Also:
-
LD_AUTO_DL_SUPPORTED
- See Also:
-
LD_LINK_IS_TORRENT
- See Also:
-
meta_search
-
type
private int type -
id
private long id -
last_updated
private long last_updated -
name
-
uid
private byte[] uid -
version
private int version -
is_public
private boolean is_public -
az_version
private int az_version -
selection_state
private int selection_state -
selection_state_recorded
private boolean selection_state_recorded -
source
private int source -
rank_bias
private float rank_bias -
preferred_count
private float preferred_count -
first_level_mapping
-
second_level_mapping
-
update_url
-
update_check_default_secs
private int update_check_default_secs -
user_data
-
-
Constructor Details
-
EngineImpl
protected EngineImpl(MetaSearchImpl _meta_search, int _type, long _id, long _last_updated, float _rank_bias, String _name) -
EngineImpl
- 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
-
-
Method Details
-
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
- Throws:
IOException
-
exportToJSONObject
- Throws:
IOException
-
importJSONMappings
- Throws:
IOException
-
exportJSONMappings
-
importBEncodedMappings
- Throws:
IOException
-
exportBEncodedMappings
- Throws:
IOException
-
exportToJSONString
- Specified by:
exportToJSONStringin interfaceEngine- Throws:
IOException
-
getAZVersion
public int getAZVersion()- Specified by:
getAZVersionin interfaceEngine
-
getVersion
public int getVersion()- Specified by:
getVersionin interfaceEngine
-
setVersion
protected void setVersion(int _v) -
getUID
-
setUID
-
allocateUID
protected void allocateUID(long id) -
sameLogicAs
Description copied from interface:EngineTests for sameness in terms of function (ignores id, selection state etc)- Specified by:
sameLogicAsin interfaceEngine- Parameters:
other-- 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:
searchin interfaceEngine- 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
-
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
-
getMetaSearch
-
vuzeFieldToID
-
vuzeIDToField
-
getType
-
setId
protected void setId(long _id) -
getId
-
getLastUpdated
public long getLastUpdated()- Specified by:
getLastUpdatedin interfaceEngine
-
getName
-
setName
-
isActive
-
isPublic
-
setPublic
protected void setPublic(boolean p) -
getSelectionState
public int getSelectionState()- Specified by:
getSelectionStatein interfaceEngine
-
setSelectionState
public void setSelectionState(int state) - Specified by:
setSelectionStatein interfaceEngine
-
isAuthenticated
public boolean isAuthenticated()- Specified by:
isAuthenticatedin interfaceEngine
-
recordSelectionState
public void recordSelectionState()- Specified by:
recordSelectionStatein interfaceEngine
-
checkSelectionStateRecorded
public void checkSelectionStateRecorded()- Specified by:
checkSelectionStateRecordedin interfaceEngine
-
getSource
-
setSource
-
getRankBias
public float getRankBias()- Specified by:
getRankBiasin interfaceEngine
-
setRankBias
public void setRankBias(float _rank_bias) - Specified by:
setRankBiasin interfaceEngine
-
setPreferredDelta
public void setPreferredDelta(float delta) - Specified by:
setPreferredDeltain interfaceEngine
-
getPreferredWeighting
public float getPreferredWeighting()- Specified by:
getPreferredWeightingin interfaceEngine
-
applyRankBias
public float applyRankBias(float _rank) - Specified by:
applyRankBiasin interfaceEngine
-
isMine
-
setMine
-
getUpdateURL
-
setUpdateURL
-
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:
getAutoDownloadSupportedin interfaceEngine- Returns:
- one of AUTO_DL constants above
-
configDirty
protected void configDirty() -
addPotentialAssociation
- Specified by:
addPotentialAssociationin interfaceEngine
-
getSubscription
- Specified by:
getSubscriptionin interfaceEngine
-
exportToVuzeFile
- Specified by:
exportToVuzeFilein interfaceEngine- Throws:
IOException
-
exportToVuzeFile
- Specified by:
exportToVuzeFilein interfaceEngine- Throws:
IOException
-
exportToVuzeFile
- Throws:
IOException
-
getLocalKey
-
reset
-
setLocalString
-
getLocalString
-
setLocalBoolean
-
getLocalBoolean
-
setLocalLong
-
getLocalLong
-
setUserData
-
getUserData
-
getDebugFile
-
debugStart
protected void debugStart() -
debugLog
-
log
-
log
-
getString
-
getString
-