Class JSONEngine
- java.lang.Object
-
- com.biglybt.core.metasearch.impl.EngineImpl
-
- com.biglybt.core.metasearch.impl.web.WebEngine
-
- com.biglybt.core.metasearch.impl.web.json.JSONEngine
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biglybt.core.metasearch.impl.web.WebEngine
WebEngine.pageDetails, WebEngine.pageDetailsVerifier
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
DEBUG_MAPPINGS
private static java.util.regex.Pattern
patternVariable
private float
rankDivisor
private java.lang.String
rankDivisorPath
private java.lang.String
resultsEntryPath
private static java.lang.String
variablePattern
-
Fields inherited from class com.biglybt.core.metasearch.impl.web.WebEngine
AM_PROXY, AM_TRANSPARENT
-
Fields inherited from class com.biglybt.core.metasearch.impl.EngineImpl
LD_AUTO_DL_SUPPORTED, LD_COOKIES, LD_CREATED_BY_ME, LD_ETAG, LD_LAST_MODIFIED, LD_LAST_UPDATE_CHECK, LD_LINK_IS_TORRENT, LD_UPDATE_CHECK_SECS
-
Fields inherited from interface com.biglybt.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_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
Constructors Modifier Constructor Description JSONEngine(MetaSearchImpl meta_search, long id, long last_updated, float rank_bias, java.lang.String name, java.lang.String searchURLFormat, java.lang.String timeZone, boolean automaticDateFormat, java.lang.String userDateFormat, java.lang.String resultsEntryPath, FieldMapping[] mappings, boolean needs_auth, java.lang.String auth_method, java.lang.String login_url, java.lang.String[] required_cookies)
protected
JSONEngine(MetaSearchImpl meta_search, long id, long last_updated, float rank_bias, java.lang.String name, JSONObject map)
protected
JSONEngine(MetaSearchImpl meta_search, java.util.Map map)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map
exportToBencodedMap()
java.util.Map
exportToBencodedMap(boolean generic)
protected void
exportToJSONObject(JSONObject res)
static EngineImpl
importFromBEncodedMap(MetaSearchImpl meta_search, java.util.Map map)
static Engine
importFromJSONString(MetaSearchImpl meta_search, long id, long last_updated, float rank_bias, java.lang.String name, JSONObject map)
protected Result[]
searchSupport(SearchParameter[] searchParameters, java.util.Map searchContext, int desired_max_matches, int absolute_max_matches, java.lang.String headers, ResultListener listener)
-
Methods inherited from class com.biglybt.core.metasearch.impl.web.WebEngine
exportToBencodedMap, extractProperty, getAuthMethod, getBasePage, getCookies, getDateParser, getDownloadLinkCSS, getIcon, getLoginPageUrl, getMappings, getNameEx, getReferer, getRequiredCookies, getRootPage, getSearchUrl, getSearchUrl, getString, getString, getWebPageContent, getWebPageContent, init, isAnonymous, isAuthenticated, isNeedsAuth, isShareable, requiresLogin, setCookies, setHeaders, setLoginPageUrl, setNeedsAuth, setRequiredCookies, setSearchUrl, supportsContext, supportsField
-
Methods inherited from class com.biglybt.core.metasearch.impl.EngineImpl
addPotentialAssociation, allocateUID, applyRankBias, checkSelectionStateRecorded, configDirty, debugLog, debugStart, delete, exportBEncodedMappings, exportJSONMappings, exportToJSONString, exportToVuzeFile, exportToVuzeFile, exportToVuzeFile, getAutoDownloadSupported, getAZVersion, getDebugFile, getId, getLastUpdateCheck, getLastUpdated, getLocalBoolean, getLocalLong, getLocalString, getMetaSearch, getName, getPreferredWeighting, getRankBias, getSelectionState, getSource, getSubscription, getType, getUID, getUpdateCheckSecs, getUpdateURL, getUserData, getVersion, importBEncodedMappings, importFromJSONString, importJSONMappings, isActive, isMine, isPublic, log, log, mapResults, recordSelectionState, reset, sameLogicAs, search, searchAndMap, setDefaultUpdateCheckSecs, setId, setLastUpdateCheck, setLocalBoolean, setLocalLong, setLocalString, setLocalUpdateCheckSecs, setMine, setName, setPreferredDelta, setPublic, setRankBias, setSelectionState, setSource, setUID, setUpdateURL, setUserData, setVersion, vuzeFieldToID, vuzeIDToField
-
-
-
-
Field Detail
-
variablePattern
private static final java.lang.String variablePattern
- See Also:
- Constant Field Values
-
patternVariable
private static final java.util.regex.Pattern patternVariable
-
DEBUG_MAPPINGS
private static final boolean DEBUG_MAPPINGS
- See Also:
- Constant Field Values
-
resultsEntryPath
private java.lang.String resultsEntryPath
-
rankDivisorPath
private java.lang.String rankDivisorPath
-
rankDivisor
private float rankDivisor
-
-
Constructor Detail
-
JSONEngine
public JSONEngine(MetaSearchImpl meta_search, long id, long last_updated, float rank_bias, java.lang.String name, java.lang.String searchURLFormat, java.lang.String timeZone, boolean automaticDateFormat, java.lang.String userDateFormat, java.lang.String resultsEntryPath, FieldMapping[] mappings, boolean needs_auth, java.lang.String auth_method, java.lang.String login_url, java.lang.String[] required_cookies)
-
JSONEngine
protected JSONEngine(MetaSearchImpl meta_search, java.util.Map map) throws java.io.IOException
- Throws:
java.io.IOException
-
JSONEngine
protected JSONEngine(MetaSearchImpl meta_search, long id, long last_updated, float rank_bias, java.lang.String name, JSONObject map) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
importFromBEncodedMap
public static EngineImpl importFromBEncodedMap(MetaSearchImpl meta_search, java.util.Map map) throws java.io.IOException
- Throws:
java.io.IOException
-
importFromJSONString
public static Engine importFromJSONString(MetaSearchImpl meta_search, long id, long last_updated, float rank_bias, java.lang.String name, JSONObject map) throws java.io.IOException
- Throws:
java.io.IOException
-
exportToBencodedMap
public java.util.Map exportToBencodedMap() throws java.io.IOException
- Throws:
java.io.IOException
-
exportToBencodedMap
public java.util.Map exportToBencodedMap(boolean generic) throws java.io.IOException
- Throws:
java.io.IOException
-
exportToJSONObject
protected void exportToJSONObject(JSONObject res) throws java.io.IOException
- Overrides:
exportToJSONObject
in classWebEngine
- Throws:
java.io.IOException
-
searchSupport
protected Result[] searchSupport(SearchParameter[] searchParameters, java.util.Map searchContext, int desired_max_matches, int absolute_max_matches, java.lang.String headers, ResultListener listener) throws SearchException
- Specified by:
searchSupport
in classEngineImpl
- Throws:
SearchException
-
-