Class EngineImpl

    • Field Detail

      • DEFAULT_UPDATE_CHECK_SECS

        private static final int DEFAULT_UPDATE_CHECK_SECS
        See Also:
        Constant Field Values
      • logging_enabled

        static boolean logging_enabled
      • LD_LAST_MODIFIED

        protected static final java.lang.String LD_LAST_MODIFIED
        See Also:
        Constant Field Values
      • LD_LAST_UPDATE_CHECK

        protected static final java.lang.String LD_LAST_UPDATE_CHECK
        See Also:
        Constant Field Values
      • LD_UPDATE_CHECK_SECS

        protected static final java.lang.String LD_UPDATE_CHECK_SECS
        See Also:
        Constant Field Values
      • LD_CREATED_BY_ME

        protected static final java.lang.String LD_CREATED_BY_ME
        See Also:
        Constant Field Values
      • LD_AUTO_DL_SUPPORTED

        protected static final java.lang.String LD_AUTO_DL_SUPPORTED
        See Also:
        Constant Field Values
      • LD_LINK_IS_TORRENT

        protected static final java.lang.String LD_LINK_IS_TORRENT
        See Also:
        Constant Field Values
      • type

        private int type
      • id

        private long id
      • last_updated

        private long last_updated
      • name

        private java.lang.String 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

        private java.util.List first_level_mapping
      • second_level_mapping

        private java.util.List second_level_mapping
      • update_url

        private java.lang.String update_url
      • update_check_default_secs

        private int update_check_default_secs
      • user_data

        private java.util.Map user_data
    • Constructor Detail

      • EngineImpl

        protected EngineImpl​(MetaSearchImpl _meta_search,
                             int _type,
                             long _id,
                             long _last_updated,
                             float _rank_bias,
                             java.lang.String _name)
      • EngineImpl

        protected EngineImpl​(MetaSearchImpl _meta_search,
                             java.util.Map map)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • EngineImpl

        protected EngineImpl​(MetaSearchImpl meta_search,
                             int type,
                             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

        protected 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,
                                                  int type,
                                                  long id,
                                                  long last_updated,
                                                  float rank_bias,
                                                  java.lang.String name,
                                                  java.lang.String content)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • exportToBencodedMap

        protected void exportToBencodedMap​(java.util.Map map,
                                           boolean generic)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • exportToJSONObject

        protected void exportToJSONObject​(JSONObject res)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • importJSONMappings

        protected java.util.List importJSONMappings​(JSONObject map,
                                                    java.lang.String str,
                                                    boolean level_1)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • exportJSONMappings

        protected void exportJSONMappings​(JSONObject res,
                                          java.lang.String str,
                                          java.util.List l,
                                          boolean level_1)
      • importBEncodedMappings

        protected java.util.List importBEncodedMappings​(java.util.Map map,
                                                        java.lang.String name)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • exportBEncodedMappings

        protected void exportBEncodedMappings​(java.util.Map map,
                                              java.lang.String name,
                                              java.util.List mappings)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • exportToJSONString

        public java.lang.String exportToJSONString()
                                            throws java.io.IOException
        Specified by:
        exportToJSONString in interface Engine
        Throws:
        java.io.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 java.lang.String getUID()
        Specified by:
        getUID in interface Engine
      • setUID

        protected void setUID​(java.lang.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:
      • mapResults

        protected Result[] mapResults​(Result[] results)
      • delete

        public void delete()
        Specified by:
        delete in interface Engine
      • vuzeFieldToID

        protected int vuzeFieldToID​(java.lang.String field)
      • vuzeIDToField

        protected java.lang.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
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Engine
      • setName

        protected void setName​(java.lang.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)
      • setSelectionState

        public void setSelectionState​(int state)
        Specified by:
        setSelectionState 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
      • 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 java.lang.String getUpdateURL()
      • setUpdateURL

        protected void setUpdateURL​(java.lang.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​(java.lang.String key)
        Specified by:
        addPotentialAssociation in interface Engine
      • exportToVuzeFile

        public void exportToVuzeFile​(java.io.File target)
                              throws java.io.IOException
        Specified by:
        exportToVuzeFile in interface Engine
        Throws:
        java.io.IOException
      • exportToVuzeFile

        public VuzeFile exportToVuzeFile()
                                  throws java.io.IOException
        Specified by:
        exportToVuzeFile in interface Engine
        Throws:
        java.io.IOException
      • exportToVuzeFile

        public VuzeFile exportToVuzeFile​(boolean generic)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getLocalKey

        private java.lang.String getLocalKey()
      • 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​(java.lang.String key,
                                      java.lang.String value)
      • getLocalString

        protected java.lang.String getLocalString​(java.lang.String key)
      • setLocalBoolean

        protected void setLocalBoolean​(java.lang.String key,
                                       boolean value)
      • getLocalBoolean

        protected boolean getLocalBoolean​(java.lang.String key,
                                          boolean def)
      • setLocalLong

        protected void setLocalLong​(java.lang.String key,
                                    long value)
      • getLocalLong

        protected long getLocalLong​(java.lang.String key,
                                    long def)
      • setUserData

        protected void setUserData​(java.lang.Object key,
                                   java.lang.Object value)
      • getUserData

        protected java.lang.Object getUserData​(java.lang.Object key)
      • getDebugFile

        protected java.io.File getDebugFile()
      • debugStart

        protected void debugStart()
      • debugLog

        protected void debugLog​(java.lang.String str)
      • log

        protected void log​(java.lang.String str)
      • log

        protected void log​(java.lang.String str,
                           java.lang.Throwable e)
      • getString

        public java.lang.String getString()
        Specified by:
        getString in interface Engine
      • getString

        public java.lang.String getString​(boolean full)