org.pentaho.platform.api.repository2.unified
Interface IUnifiedRepository

All Known Implementing Classes:
DefaultUnifiedRepository, ExceptionLoggingDecorator, UnifiedRepositoryToWebServiceAdapter

public interface IUnifiedRepository

Entry point into the unified repository. The finest grained object that can be read and written to this repository is a RepositoryFile.

Author:
mlowery

Method Summary
 boolean canUnlockFile(Serializable fileId)
          Returns true if the current user can unlock the file.
 RepositoryFile createFile(Serializable parentFolderId, RepositoryFile file, IRepositoryFileData data, RepositoryFileAcl acl, String versionMessage)
          Creates a file.
 RepositoryFile createFile(Serializable parentFolderId, RepositoryFile file, IRepositoryFileData data, String versionMessage)
          Creates a file.
 RepositoryFile createFolder(Serializable parentFolderId, RepositoryFile file, RepositoryFileAcl acl, String versionMessage)
          Creates a folder.
 RepositoryFile createFolder(Serializable parentFolderId, RepositoryFile file, String versionMessage)
          Creates a folder.
 void deleteFile(Serializable fileId, boolean permanent, String versionMessage)
          Deletes a file.
 void deleteFile(Serializable fileId, String versionMessage)
          Deletes a file in a recoverable manner.
 void deleteFileAtVersion(Serializable fileId, Serializable versionId)
          Permanently deletes a specific version of a file.
 RepositoryFileAcl getAcl(Serializable fileId)
          Returns ACL for file.
 List<RepositoryFile> getChildren(Serializable folderId)
          Returns the children of this folder.
 List<RepositoryFile> getChildren(Serializable folderId, String filter)
          Returns the children of this folder that match the specified filter.
<T extends IRepositoryFileData>
T
getDataAtVersionForExecute(Serializable fileId, Serializable versionId, Class<T> dataClass)
          Gets data at given version for read.
<T extends IRepositoryFileData>
T
getDataAtVersionForRead(Serializable fileId, Serializable versionId, Class<T> dataClass)
          Gets data at given version for read.
<T extends IRepositoryFileData>
T
getDataForExecute(Serializable fileId, Class<T> dataClass)
          Gets data at base version for execute.
<T extends IRepositoryFileData>
T
getDataForRead(Serializable fileId, Class<T> dataClass)
          Gets data at base version for read.
 List<RepositoryFile> getDeletedFiles()
          Gets all deleted files for the current user.
 List<RepositoryFile> getDeletedFiles(Serializable folderId)
          Gets all deleted files for the current user in this folder.
 List<RepositoryFile> getDeletedFiles(Serializable folderId, String filter)
          Gets all deleted files for the current user in this folder.
 List<RepositoryFileAce> getEffectiveAces(Serializable fileId)
          Returns the list of access control entries (ACEs) that will be used to make an access control decision.
 List<RepositoryFileAce> getEffectiveAces(Serializable fileId, boolean forceEntriesInheriting)
          Returns the list of access control entries (ACEs) that will be used to make an access control decision.
 RepositoryFile getFile(String path)
          Gets file.
 RepositoryFile getFile(String path, boolean loadLocaleMaps)
          Same as getFile(String) except that if loadMaps is true, the maps for localized strings will be loaded as well.
 RepositoryFile getFileAtVersion(Serializable fileId, Serializable versionId)
          Gets file as it was at the given version.
 RepositoryFile getFileById(Serializable fileId)
          Gets file.
 RepositoryFile getFileById(Serializable fileId, boolean loadLocaleMaps)
          Same as getFile(String) except that if loadMaps is true, the maps for localized strings will be loaded as well.
 RepositoryFileTree getTree(String path, int depth, String filter)
          Gets a tree rooted at path.
 List<VersionSummary> getVersionSummaries(Serializable fileId)
          Returns a list of version summary instances.
 VersionSummary getVersionSummary(Serializable fileId, Serializable versionId)
          Returns a version summary for the given file id and version id.
 boolean hasAccess(String path, EnumSet<RepositoryFilePermission> permissions)
          Returns true if user has all permissions given.
 void lockFile(Serializable fileId, String message)
          Locks a file.
 void moveFile(Serializable fileId, String destAbsPath, String versionMessage)
          Moves and/or renames file.
 void restoreFileAtVersion(Serializable fileId, Serializable versionId, String versionMessage)
          Makes a file, as it was at the given version, the latest version.
 void undeleteFile(Serializable fileId, String versionMessage)
          Recovers a deleted file if it was not permanently deleted.
 void unlockFile(Serializable fileId)
          Unlocks a file.
 RepositoryFileAcl updateAcl(RepositoryFileAcl acl)
          Updates an ACL.
 RepositoryFile updateFile(RepositoryFile file, IRepositoryFileData data, String versionMessage)
          Updates a file and/or the data of a file.
 

Method Detail

getFile

RepositoryFile getFile(String path)
Gets file. Use this method to test for file existence too.

Parameters:
path - path to file
Returns:
file or null if the file does not exist or access is denied

getTree

RepositoryFileTree getTree(String path,
                           int depth,
                           String filter)
Gets a tree rooted at path.

Parameters:
path - path to file
depth - 0 fetches just file at path; positive integer n fetches node at path plus n levels of children; negative integer fetches all children
filter - filter may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these; filter does not apply to root node
Returns:
file or null if the file does not exist or access is denied

getFileAtVersion

RepositoryFile getFileAtVersion(Serializable fileId,
                                Serializable versionId)
Gets file as it was at the given version.

Parameters:
fileId - file id
versionId - version id
Returns:
file at version

getFileById

RepositoryFile getFileById(Serializable fileId)
Gets file. Use this method to test for file existence too.

Parameters:
fileId - file id
Returns:
file or null if the file does not exist or access is denied

getFile

RepositoryFile getFile(String path,
                       boolean loadLocaleMaps)
Same as getFile(String) except that if loadMaps is true, the maps for localized strings will be loaded as well. (Normally these are not loaded.) Use true in editing tools that can show the maps for editing purposes.

Parameters:
path - path to file
loadLocaleMaps - true to load localized string maps
Returns:
file or null if the file does not exist or access is denied

getFileById

RepositoryFile getFileById(Serializable fileId,
                           boolean loadLocaleMaps)
Same as getFile(String) except that if loadMaps is true, the maps for localized strings will be loaded as well. (Normally these are not loaded.) Use true in editing tools that can show the maps for editing purposes.

Parameters:
fileId - file id
loadLocaleMaps - true to load localized string maps
Returns:
file or null if the file does not exist or access is denied

getDataForRead

<T extends IRepositoryFileData> T getDataForRead(Serializable fileId,
                                                 Class<T> dataClass)
Gets data at base version for read.

Parameters:
fileId - file id
dataClass - class that implements IRepositoryFileData
Returns:
data

getDataAtVersionForRead

<T extends IRepositoryFileData> T getDataAtVersionForRead(Serializable fileId,
                                                          Serializable versionId,
                                                          Class<T> dataClass)
Gets data at given version for read.

Parameters:
fileId - file id
versionId - version id
dataClass - class that implements IRepositoryFileData
Returns:
data

getDataForExecute

<T extends IRepositoryFileData> T getDataForExecute(Serializable fileId,
                                                    Class<T> dataClass)
Gets data at base version for execute.

Parameters:
fileId - file id
dataClass - class that implements IRepositoryFileData
Returns:
data

getDataAtVersionForExecute

<T extends IRepositoryFileData> T getDataAtVersionForExecute(Serializable fileId,
                                                             Serializable versionId,
                                                             Class<T> dataClass)
Gets data at given version for read.

Parameters:
fileId - file id
versionId - version id
dataClass - class that implements IRepositoryFileData
Returns:
data

createFile

RepositoryFile createFile(Serializable parentFolderId,
                          RepositoryFile file,
                          IRepositoryFileData data,
                          String versionMessage)
Creates a file.

Parameters:
parentFolderId - parent folder id
file - file to create
data - file data
versionMessage - optional version comment to be applied to parentFolder
Returns:
file that is equal to given file except with id populated

createFile

RepositoryFile createFile(Serializable parentFolderId,
                          RepositoryFile file,
                          IRepositoryFileData data,
                          RepositoryFileAcl acl,
                          String versionMessage)
Creates a file.

Parameters:
parentFolderId - parent folder id
file - file to create
data - file data
acl - file acl
versionMessage - optional version comment to be applied to parentFolder
Returns:
file that is equal to given file except with id populated

createFolder

RepositoryFile createFolder(Serializable parentFolderId,
                            RepositoryFile file,
                            String versionMessage)
Creates a folder.

Parameters:
parentFolderId - parent folder id
file - file to create
versionMessage - optional version comment to be applied to parentFolder
Returns:
file that is equal to given file except with id populated

createFolder

RepositoryFile createFolder(Serializable parentFolderId,
                            RepositoryFile file,
                            RepositoryFileAcl acl,
                            String versionMessage)
Creates a folder.

Parameters:
parentFolderId - parent folder id
file - file to create
acl - file acl
versionMessage - optional version comment to be applied to parentFolder
Returns:
file that is equal to given file except with id populated

getChildren

List<RepositoryFile> getChildren(Serializable folderId)
Returns the children of this folder.

Parameters:
folderId - id of folder whose children to fetch
Returns:
list of children (never null)

getChildren

List<RepositoryFile> getChildren(Serializable folderId,
                                 String filter)
Returns the children of this folder that match the specified filter.

Parameters:
folderId - id of folder whose children to fetch
filter - filter may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these
Returns:
list of children (never null)

updateFile

RepositoryFile updateFile(RepositoryFile file,
                          IRepositoryFileData data,
                          String versionMessage)
Updates a file and/or the data of a file.

Parameters:
file - updated file (not a folder); must have non-null id
data - updated data
versionMessageoptional - version comment
Returns:
updated file (possibly with new version number)

deleteFile

void deleteFile(Serializable fileId,
                boolean permanent,
                String versionMessage)
Deletes a file.

Parameters:
fileId - file id
permanent - if true, once file is deleted, it cannot be undeleted
versionMessage - optional version comment

deleteFile

void deleteFile(Serializable fileId,
                String versionMessage)
Deletes a file in a recoverable manner.

Parameters:
fileId - file id
versionMessage - optional version comment

moveFile

void moveFile(Serializable fileId,
              String destAbsPath,
              String versionMessage)
Moves and/or renames file.

Parameters:
fileId - if of file or folder to move and/or rename
destAbsPath - path to destination; if only moving then destAbsPath will be an existing path
versionMessageAndLabel - optional version comment to be applied to source and destination parent folders

undeleteFile

void undeleteFile(Serializable fileId,
                  String versionMessage)
Recovers a deleted file if it was not permanently deleted. File is recovered to its original folder.

Parameters:
fileId - deleted file id
versionMessage - optional version comment to be applied to original parent folder

getDeletedFiles

List<RepositoryFile> getDeletedFiles(Serializable folderId)
Gets all deleted files for the current user in this folder.

Parameters:
folderId - folder id
Returns:
list of deleted files

getDeletedFiles

List<RepositoryFile> getDeletedFiles(Serializable folderId,
                                     String filter)
Gets all deleted files for the current user in this folder.

Parameters:
folderId - folder id
filter - filter may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these
Returns:
list of deleted files

getDeletedFiles

List<RepositoryFile> getDeletedFiles()
Gets all deleted files for the current user. This is the "recycle bin" view.

Returns:
list of deleted files

canUnlockFile

boolean canUnlockFile(Serializable fileId)
Returns true if the current user can unlock the file. This might be a function of access control.

Parameters:
fileId - file id
Returns:
true if the current user can unlock the file

lockFile

void lockFile(Serializable fileId,
              String message)
Locks a file.

Parameters:
fileId - file id
lock - message

unlockFile

void unlockFile(Serializable fileId)
Unlocks a file.

Parameters:
fileId - file id

getAcl

RepositoryFileAcl getAcl(Serializable fileId)
Returns ACL for file.

Parameters:
fileId - file id
Returns:
access control list

updateAcl

RepositoryFileAcl updateAcl(RepositoryFileAcl acl)
Updates an ACL.

Parameters:
acl - ACL to set; must have non-null id
Returns:
updated ACL as it would be if calling getAcl(Serializable)

hasAccess

boolean hasAccess(String path,
                  EnumSet<RepositoryFilePermission> permissions)
Returns true if user has all permissions given.

Parameters:
path - path to file or folder
permissions - permissions to check
Returns:
true if user has all permissions given

getEffectiveAces

List<RepositoryFileAce> getEffectiveAces(Serializable fileId)
Returns the list of access control entries (ACEs) that will be used to make an access control decision.

Parameters:
fileId - file id
Returns:
list of ACEs

getEffectiveAces

List<RepositoryFileAce> getEffectiveAces(Serializable fileId,
                                         boolean forceEntriesInheriting)
Returns the list of access control entries (ACEs) that will be used to make an access control decision.

Parameters:
fileId - file id
forceEntriesInheriting - true to treat ACL as if isEntriesInheriting was true; this avoids having the caller fetch the parent of ACL belonging to file with fileId; no change is persisted to the ACL
Returns:
list of ACEs

getVersionSummary

VersionSummary getVersionSummary(Serializable fileId,
                                 Serializable versionId)
Returns a version summary for the given file id and version id.

Parameters:
fileId - file id
versionId - version id (if null, returns the last version)
Returns:
version summary

getVersionSummaries

List<VersionSummary> getVersionSummaries(Serializable fileId)
Returns a list of version summary instances. The first version in the list is the root version. The last version in the list is the base version. Branching and merging are not supported so this is a simple list.

Parameters:
fileId - file id
Returns:
list of version summaries (never null)

deleteFileAtVersion

void deleteFileAtVersion(Serializable fileId,
                         Serializable versionId)
Permanently deletes a specific version of a file. The version is removed from the version history of the given file.

Parameters:
fileId - file id
versionId - version id (MUST not be null)

restoreFileAtVersion

void restoreFileAtVersion(Serializable fileId,
                          Serializable versionId,
                          String versionMessage)
Makes a file, as it was at the given version, the latest version. Result should be the same as if the user had called updateFile(RepositoryFile, IRepositoryFileData, String) with a file and data that matched the state of the file and data at the given version.

Parameters:
fileId - file id
versionId - version id
versionMessage - optional version comment