Class SolrServer

java.lang.Object
com.broadleafcommerce.solr.autoconfigure.SolrServer
All Implemented Interfaces:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class SolrServer extends Object implements org.springframework.context.SmartLifecycle
Author:
Jeff Fischer
  • Field Details

    • props

      protected final SolrProperties props
    • isWin

      protected boolean isWin
    • WINDOWS_EXT

      protected static final String WINDOWS_EXT
      See Also:
    • UNIX_EXT

      protected static final String UNIX_EXT
      See Also:
    • created

      protected boolean created
      Indicates that Solr was created within this lifecycle and should be stopped. If not started from here, it should also not be stopped from here
  • Constructor Details

  • Method Details

    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • stop

      public void stop(Runnable runnable)
      Specified by:
      stop in interface org.springframework.context.SmartLifecycle
    • getWorkingDirectory

      protected String getWorkingDirectory()
    • getSolrCommand

      protected String getSolrCommand()
    • startSolr

      protected void startSolr()
    • checkCoreStatus

      protected void checkCoreStatus()
    • stopSolr

      protected void stopSolr()
    • syncConfig

      protected boolean syncConfig()
    • containsDataDirectory

      protected boolean containsDataDirectory(File directory) throws IOException
      Recursively searches the given directory for directories that have /data
      Throws:
      IOException
    • downloadSolrIfApplicable

      protected boolean downloadSolrIfApplicable()
    • expandDownload

      protected boolean expandDownload(File downloadFile, File workingDirectory)
    • expandNix

      protected boolean expandNix(File downloadFile, File workingDirectory)
    • copyLarge

      protected void copyLarge(InputStream input, OutputStream output, long contentLength) throws IOException
      Throws:
      IOException