Class SearchServerSocket

    • Field Detail

      • SEARCH_PORT_PROPERTY

        public static final java.lang.String SEARCH_PORT_PROPERTY
        The configuration property used for listen port.
        See Also:
        Constant Field Values
      • DEFAULT_SEARCH_PORT

        public static final java.lang.String DEFAULT_SEARCH_PORT
        The default listen port, as a string.
        See Also:
        Constant Field Values
      • THREAD_POOL_SIZE_PROPERTY

        public static final java.lang.String THREAD_POOL_SIZE_PROPERTY
        The configuration property used for listen thread count.
        See Also:
        Constant Field Values
      • DEFAULT_THREAD_POOL_SIZE

        public static final java.lang.String DEFAULT_THREAD_POOL_SIZE
        The default number of threads, as a string.
        See Also:
        Constant Field Values
      • PRODUCT_INDEXER_PROPERTY

        public static final java.lang.String PRODUCT_INDEXER_PROPERTY
        The configuration property used to reference a ProductIndex.
        See Also:
        Constant Field Values
      • PRODUCT_STORAGE_PROPERTY

        public static final java.lang.String PRODUCT_STORAGE_PROPERTY
        The configuration property used to reference a URLProductStorage.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SearchServerSocket

        public SearchServerSocket()
        Construct a new SearchServerSocket using defaults.
    • Method Detail

      • search

        protected SearchResponse search​(SearchRequest request)
                                 throws java.lang.Exception
        Method to perform search. Calls Indexer.search(SearchRequest). Simplifies testing.
        Parameters:
        request - the search to execute.
        Returns:
        the search response.
        Throws:
        java.lang.Exception - if error occurs
      • onSocket

        public void onSocket​(java.net.Socket socket)
        This method is called each time a SearchSocket connects.
        Specified by:
        onSocket in interface SocketListenerInterface
        Parameters:
        socket - socket to be processed.
      • configure

        public void configure​(Config config)
                       throws java.lang.Exception
        Description copied from class: DefaultConfigurable
        Process configuration settings. Called before startup().
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class DefaultConfigurable
        Parameters:
        config - the Config object with settings.
        Throws:
        java.lang.Exception - if configuration exceptions occur.
      • getPort

        public int getPort()
        Returns:
        int port
      • setPort

        public void setPort​(int port)
        Parameters:
        port - int to set
      • getThreads

        public int getThreads()
        Returns:
        int threads
      • setThreads

        public void setThreads​(int threads)
        Parameters:
        threads - into to set
      • getIndexer

        public Indexer getIndexer()
        Returns:
        indexer
      • setIndex

        public void setIndex​(Indexer indexer)
        Parameters:
        indexer - to set