Package gov.usgs.earthquake.indexer
Class SearchServerSocket
java.lang.Object
gov.usgs.util.DefaultConfigurable
gov.usgs.earthquake.indexer.SearchServerSocket
- All Implemented Interfaces:
- Configurable,- SocketListenerInterface
Server side of socket search interface.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe default listen port, as a string.static final StringThe default number of threads, as a string.static final StringThe configuration property used to reference a ProductIndex.static final StringThe configuration property used to reference a URLProductStorage.static final StringThe configuration property used for listen port.static final StringThe configuration property used for listen thread count.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidProcess configuration settings.intgetPort()intvoidThis method is called each time a SearchSocket connects.protected SearchResponsesearch(SearchRequest request) Method to perform search.voidvoidsetPort(int port) voidsetThreads(int threads) voidshutdown()Stop any processing/background threads.voidstartup()Start any processing/background threads.Methods inherited from class gov.usgs.util.DefaultConfigurablegetName, setName
- 
Field Details- 
SEARCH_PORT_PROPERTYThe configuration property used for listen port.- See Also:
 
- 
DEFAULT_SEARCH_PORTThe default listen port, as a string.- See Also:
 
- 
THREAD_POOL_SIZE_PROPERTYThe configuration property used for listen thread count.- See Also:
 
- 
DEFAULT_THREAD_POOL_SIZEThe default number of threads, as a string.- See Also:
 
- 
PRODUCT_INDEXER_PROPERTYThe configuration property used to reference a ProductIndex.- See Also:
 
- 
PRODUCT_STORAGE_PROPERTYThe configuration property used to reference a URLProductStorage.- See Also:
 
 
- 
- 
Constructor Details- 
SearchServerSocketpublic SearchServerSocket()Construct a new SearchServerSocket using defaults.
 
- 
- 
Method Details- 
searchMethod to perform search. Calls Indexer.search(SearchRequest). Simplifies testing.- Parameters:
- request- the search to execute.
- Returns:
- the search response.
- Throws:
- Exception- if error occurs
 
- 
onSocketThis method is called each time a SearchSocket connects.- Specified by:
- onSocketin interface- SocketListenerInterface
- Parameters:
- socket- socket to be processed.
 
- 
configureDescription copied from class:DefaultConfigurableProcess configuration settings. Called before startup().- Specified by:
- configurein interface- Configurable
- Overrides:
- configurein class- DefaultConfigurable
- Parameters:
- config- the Config object with settings.
- Throws:
- Exception- if configuration exceptions occur.
 
- 
shutdownDescription copied from class:DefaultConfigurableStop any processing/background threads.- Specified by:
- shutdownin interface- Configurable
- Overrides:
- shutdownin class- DefaultConfigurable
- Throws:
- Exception- if exceptions occur while starting.
 
- 
startupDescription copied from class:DefaultConfigurableStart any processing/background threads.- Specified by:
- startupin interface- Configurable
- Overrides:
- startupin class- DefaultConfigurable
- Throws:
- Exception- if exceptions occur while starting.
 
- 
getPortpublic int getPort()- Returns:
- int port
 
- 
setPortpublic void setPort(int port) - Parameters:
- port- int to set
 
- 
getThreadspublic int getThreads()- Returns:
- int threads
 
- 
setThreadspublic void setThreads(int threads) - Parameters:
- threads- into to set
 
- 
getIndexer- Returns:
- indexer
 
- 
setIndex- Parameters:
- indexer- to set
 
 
-