org.alfresco.filesys.repo
Class ContentSearchContext

java.lang.Object
  extended by org.alfresco.jlan.server.filesys.SearchContext
      extended by org.alfresco.filesys.repo.ContentSearchContext
Direct Known Subclasses:
CacheLookupSearchContext

public class ContentSearchContext
extends org.alfresco.jlan.server.filesys.SearchContext

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.


Field Summary
static int LinkFileSize
           
 
Constructor Summary
protected ContentSearchContext(CifsHelper cifsHelper, java.util.List results, java.lang.String searchStr, org.alfresco.jlan.server.filesys.pseudo.PseudoFileList pseudoList, java.lang.String relPath)
          Class constructor
 
Method Summary
protected  int getPseudoListSize()
          Return the pseudo file list size
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(org.alfresco.jlan.server.filesys.FileInfo info)
          Restart a search at the specified resume point.
 boolean restartAt(int resumeId)
          Restart the current search at the specified file.
protected  boolean returningPseudoFiles()
          Check if the search is returning pseudo files or real file entries
 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
 

Field Detail

LinkFileSize

public static final int LinkFileSize
See Also:
Constant Field Values
Constructor Detail

ContentSearchContext

protected ContentSearchContext(CifsHelper cifsHelper,
                               java.util.List results,
                               java.lang.String searchStr,
                               org.alfresco.jlan.server.filesys.pseudo.PseudoFileList pseudoList,
                               java.lang.String relPath)
Class constructor

Parameters:
cifsHelper - Filesystem helper class
results - List of file/folder nodes that match the search pattern
searchStr - Search path
pseudoList - List of pseudo files to be blended into the returned list of files
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:
resumeId - Resume point id.
Returns:
true if the search can be restarted, else false.

restartAt

public boolean restartAt(int resumeId)
Restart the current search at the specified file.

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.

returningPseudoFiles

protected boolean returningPseudoFiles()
Check if the search is returning pseudo files or real file entries

Returns:
boolean

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

getPseudoListSize

protected int getPseudoListSize()
Return the pseudo file list size

Returns:
int


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.