private void setConfig ( JsonSimpleConfig config ) throws SubscriberException { try { // Find our solr index uri = new URI ( config . getString ( null , "subscriber" , getId ( ) , "uri" ) ) ; if ( uri == null ) { throw new SubscriberException ( "No Solr URI provided" ) ; } core = new CommonsHttpSolrServer ( uri . toURL ( ) ) ; boolean serverOnline = false ; int retryCount = 0 ; // Small sleep whilst the solr index is still coming online while ( ! serverOnline ) { Thread . sleep ( 200 ) ; // Make sure it is online try { core . ping ( ) ; serverOnline = true ; } catch ( Exception ex ) { retryCount ++ ; log . error ( "Server not yet online. Attempt: " + retryCount + " of " + SOLR_SERVER_RETRY_COUNT , ex ) ; if ( retryCount == SOLR_SERVER_RETRY_COUNT ) { throw ex ; } } } // Buffering docBuffer = new ArrayList < String > ( ) ; bufferSize = 0 ; bufferOldest = 0 ; bufferDocLimit = config . getInteger ( BUFFER_LIMIT_DOCS , "subscriber" , getId ( ) , "buffer" , "docLimit" ) ; bufferSizeLimit = config . getInteger ( BUFFER_LIMIT_SIZE , "subscriber" , getId ( ) , "buffer" , "sizeLimit" ) ; bufferTimeLimit = config . getInteger ( BUFFER_LIMIT_TIME , "subscriber" , getId ( ) , "buffer" , "timeLimit" ) ; // Timeout 'tick' for buffer (10s) timer = new Timer ( "SolrEventLog:" + this . toString ( ) , true ) ; timer . scheduleAtFixedRate ( new TimerTask ( ) { @ Override public void run ( ) { checkTimeout ( ) ; } } , 0 , 10000 ) ; } catch ( Exception ex ) { throw new SubscriberException ( ex ) ; } }
Initialization of Solr Access Control plugin