Interface FileLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for looking up on files in the current directory.
This session defines the following views:
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete result set or is an error condition
- federated directory view: searches include entries in directories of which this directory is an ancestor
- isolated directory view: lookups are restricted to entries in this directory only
Generally, the comparative view should be used for most applications as it permits operation even if there is data out of sync. Some administrative applications may need to know whether it had retrieved an entire set of objects and may sacrifice some interoperability for the sake of precision using the plenary view.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform entry lookups.Gets the directory associated with this session.Gets theIdof this directory.Gets a specified file or alias to the file.getFiles()Gets the list of files and aliases to files in this directory.getFilesByGenusType(Type fileGenusType) Gets aFileListcorresponding to the given file genusTypewhich does not include files of genus types derived from the specifiedType.getFilesByIds(IdList fileIds) Gets aFileListcorresponding to the givenIdList.getFilesByParentGenusType(Type fileGenusType) Gets aFileListcorresponding to the given file genusTypeand include any additional files with genus types derived from the specifiedType.getFilesByRecordType(Type fileRecordType) Gets aFileListcorresponding to the given file recordType.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of the file returns is desired.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getDirectoryId
Id getDirectoryId()Gets theIdof this directory.- Returns:
- the
Idof this directory - Compliance:
mandatory- This method must be implemented.
-
getDirectory
Gets the directory associated with this session.- Returns:
- the directory associated with this session
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupFiles
boolean canLookupFiles()Tests if this user can perform entry lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeFileView
void useComparativeFileView()The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryFileView
void usePlenaryFileView()A complete view of the file returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedDirectoryView
void useFederatedDirectoryView()Federates the view for methods in this session. A federated view will include entries in directories which are children of this directory.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedDirectoryView
void useIsolatedDirectoryView()Isolates the view for methods in this session. An isolated view restricts lookups to this directory only.- Compliance:
mandatory- This method is must be implemented.
-
getFile
File getFile(Id fileId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a specified file or alias to the file.- Parameters:
fileId- theIdto the file- Returns:
- the file
- Throws:
NotFoundException-fileIdis not foundNullArgumentException-fileIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFilesByIds
FileList getFilesByIds(IdList fileIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aFileListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the files specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleFiesmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
fileIds- the list ofIdsto retrieve- Returns:
- the returned
Filelist - Throws:
NotFoundException- anIdwas not foundNullArgumentException-fileIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFilesByGenusType
FileList getFilesByGenusType(Type fileGenusType) throws OperationFailedException, PermissionDeniedException Gets aFileListcorresponding to the given file genusTypewhich does not include files of genus types derived from the specifiedType. In plenary mode, the returned list contains all known files or an error results. Otherwise, the returned list may contain only those files that are accessible through this session.- Parameters:
fileGenusType- a file genus type- Returns:
- the returned
File list - Throws:
NullArgumentException-fileGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFilesByParentGenusType
FileList getFilesByParentGenusType(Type fileGenusType) throws OperationFailedException, PermissionDeniedException Gets aFileListcorresponding to the given file genusTypeand include any additional files with genus types derived from the specifiedType. In plenary mode, the returned list contains all known files or an error results. Otherwise, the returned list may contain only those files that are accessible through this session.- Parameters:
fileGenusType- a file genus type- Returns:
- the returned
Filelist - Throws:
NullArgumentException-fileGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFilesByRecordType
FileList getFilesByRecordType(Type fileRecordType) throws OperationFailedException, PermissionDeniedException Gets aFileListcorresponding to the given file recordType. The set of files implementing the given record type is returned. In plenary mode, the returned list contains all known files or an error results. Otherwise, the returned list may contain only those files that are accessible through this session.- Parameters:
fileRecordType- a file record type- Returns:
- the returned
Filelist - Throws:
NullArgumentException-fileRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFiles
Gets the list of files and aliases to files in this directory. In a federated view, this method returns all files in descendant directories. In plenary mode, the returned list contains all known files or an error results. Otherwise, the returned list may contain only those files that are accessible through this session.- Returns:
- the list of files in this directory
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-