Class ContentSearchContext

java.lang.Object
org.alfresco.jlan.server.filesys.SearchContext
org.alfresco.filesys.repo.ContentSearchContext
All Implemented Interfaces:
InFlightCorrectable
Direct Known Subclasses:
DotDotContentSearchContext

public class ContentSearchContext extends org.alfresco.jlan.server.filesys.SearchContext implements InFlightCorrectable
Wrapper for simple XPath searche against the node service. The search is performed statically outside the context instance itself - this class merely maintains the state of the search results across client connections.
Author:
Derek Hulley
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ContentSearchContext(CifsHelper cifsHelper, List<NodeRef> results, String searchStr, String relPath, boolean lockedFilesAsOffline)
    Class constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Return the relative path that is being searched
    protected int
    Return the results array size
    int
    Return the resume id for the current file/directory in the search.
    boolean
    Determine if there are more files for the active search.
    boolean
    nextFileInfo(org.alfresco.jlan.server.filesys.FileInfo info)
    Return file information for the next file in the active search.
    Return the file name of the next file in the active search.
    boolean
    restartAt(int resumeIdParameter)
    Restart the current search at the specified file.
    boolean
    restartAt(org.alfresco.jlan.server.filesys.FileInfo info)
    Restart a search at the specified resume point.
    void
     
    Return the search as a string

    Methods inherited from class org.alfresco.jlan.server.filesys.SearchContext

    closeSearch, getDotDotInfo, getDotInfo, getFlags, getMaximumFiles, getSearchString, getTreeId, hasDotFiles, numberOfEntries, setFlags, setMaximumFiles, setSearchString, setTreeId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ContentSearchContext

      protected ContentSearchContext(CifsHelper cifsHelper, List<NodeRef> results, String searchStr, String relPath, boolean lockedFilesAsOffline)
      Class constructor
      Parameters:
      cifsHelper - Filesystem helper class
      results - List of file/folder nodes that match the search pattern
      searchStr - Search path
      relPath - Relative path being searched
  • Method Details

    • setInFlightCorrector

      public void setInFlightCorrector(InFlightCorrector corrector)
      Specified by:
      setInFlightCorrector in interface InFlightCorrectable
    • toString

      public String toString()
      Return the search as a string
      Overrides:
      toString in class org.alfresco.jlan.server.filesys.SearchContext
      Returns:
      String
    • getResumeId

      public int getResumeId()
      Return the resume id for the current file/directory in the search.
      Specified by:
      getResumeId in class org.alfresco.jlan.server.filesys.SearchContext
      Returns:
      int
    • hasMoreFiles

      public boolean hasMoreFiles()
      Determine if there are more files for the active search.
      Specified by:
      hasMoreFiles in class org.alfresco.jlan.server.filesys.SearchContext
      Returns:
      boolean
    • nextFileInfo

      public boolean nextFileInfo(org.alfresco.jlan.server.filesys.FileInfo info)
      Return file information for the next file in the active search. Returns false if the search is complete.
      Specified by:
      nextFileInfo in class org.alfresco.jlan.server.filesys.SearchContext
      Parameters:
      info - FileInfo to return the file information.
      Returns:
      true if the file information is valid, else false
    • nextFileName

      public String nextFileName()
      Return the file name of the next file in the active search. Returns null is the search is complete.
      Specified by:
      nextFileName in class org.alfresco.jlan.server.filesys.SearchContext
      Returns:
      String
    • restartAt

      public boolean restartAt(org.alfresco.jlan.server.filesys.FileInfo info)
      Restart a search at the specified resume point.
      Specified by:
      restartAt in class org.alfresco.jlan.server.filesys.SearchContext
      Parameters:
      info - File to restart the search at.
      Returns:
      true if the search can be restarted, else false.
    • restartAt

      public boolean restartAt(int resumeIdParameter)
      Restart the current search at the specified file.
      Specified by:
      restartAt in class org.alfresco.jlan.server.filesys.SearchContext
      Returns:
      true if the search can be restarted, else false.
    • getRelativePath

      protected String getRelativePath()
      Return the relative path that is being searched
      Returns:
      String
    • getResultsSize

      protected int getResultsSize()
      Return the results array size
      Returns:
      int