Class 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 int LinkFileSize  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ContentSearchContext​(CifsHelper cifsHelper, java.util.List<org.alfresco.service.cmr.repository.NodeRef> results, java.lang.String searchStr, java.lang.String relPath, boolean lockedFilesAsOffline)
      Class constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getRelativePath()
      Return the relative path that is being searched
      protected int getResultsSize()
      Return the results array size
      int getResumeId()
      Return the resume id for the current file/directory in the search.
      boolean hasMoreFiles()
      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.
      java.lang.String nextFileName()
      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 setInFlightCorrector​(InFlightCorrector corrector)  
      java.lang.String toString()
      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
    • Constructor Detail

      • ContentSearchContext

        protected ContentSearchContext​(CifsHelper cifsHelper,
                                       java.util.List<org.alfresco.service.cmr.repository.NodeRef> results,
                                       java.lang.String searchStr,
                                       java.lang.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 Detail

      • toString

        public java.lang.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 java.lang.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 java.lang.String getRelativePath()
        Return the relative path that is being searched
        Returns:
        String
      • getResultsSize

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