Package ghidra.framework.remote
Interface RepositoryHandle
- All Known Subinterfaces:
RemoteRepositoryHandle
public interface RepositoryHandle
RepositoryHandle
provides access to a repository.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkout
(String parentPath, String itemName, CheckoutType checkoutType, String projectPath) Perform a checkout on the specified item.void
close()
Notification to server that client is dropping handle.createDatabase
(String parentPath, String itemName, String fileID, int bufferSize, String contentType, String projectPath) Create a new empty database item within the repository.void
deleteItem
(String parentPath, String itemName, int version) Delete the specified version of an item.boolean
fileExists
(String parentPath, String itemName) Returns true if the specified item exists.boolean
folderExists
(String folderPath) Returns true if the specified folder path exists.getCheckout
(String parentPath, String itemName, long checkoutId) Returns specific checkout data for an item.getCheckouts
(String parentPath, String itemName) Get a list of all checkouts for an item.Get pending change events.Returns the RepositoryItem with the given unique file IDReturns the RepositoryItem in the given folder with the given nameint
Returns the number of folder items contained within this file-system.getItemList
(String folderPath) Get of all items found within the specified parent folder path.long
Returns the length of this domain file.getName()
Returns the name of this repository.String[]
Convenience method for obtaining a list of all users known to the server.String[]
getSubfolderList
(String folderPath) Get list of subfolders contained within the specified parent folder.getUser()
Returns user object associated with this handle.User[]
Returns a list of users authorized for this repository.Version[]
getVersions
(String parentPath, String itemName) Returns a list of all versions for the specified item.boolean
hasCheckouts
(String parentPath, String itemName) Returns true if the specified item has one or more checkouts.boolean
isCheckinActive
(String parentPath, String itemName) Returns true if the specified item has an active checkin.void
moveFolder
(String oldParentPath, String newParentPath, String oldFolderName, String newFolderName) Move an entire foldervoid
Move an item to another folderopenDatabase
(String parentPath, String itemName, int version, int minChangeDataVer) Open an existing version of a database buffer file for non-update read-only use.openDatabase
(String parentPath, String itemName, long checkoutId) Open the current version for checkin of new version.void
setUserList
(User[] users, boolean anonymousAccessAllowed) Set the list of authorized users for this repository.void
terminateCheckout
(String parentPath, String itemName, long checkoutId, boolean notify) Terminate an existing item checkout.void
updateCheckoutVersion
(String parentPath, String itemName, long checkoutId, int checkoutVersion) Update checkout data for an item following an update of a local checkout file.
-
Field Details
-
CLIENT_CHECK_PERIOD
static final int CLIENT_CHECK_PERIOD
-
-
Method Details
-
getName
Returns the name of this repository.- Throws:
IOException
- if an IO error occurs
-
getUser
Returns user object associated with this handle.- Throws:
IOException
- if an IO error occurs
-
getUserList
Returns a list of users authorized for this repository.- Throws:
UserAccessException
IOException
- if an IO error occurs
-
anonymousAccessAllowed
- Returns:
- true if anonymous access allowed by this repository
- Throws:
IOException
- if an IO error occurs
-
getServerUserList
Convenience method for obtaining a list of all users known to the server.- Returns:
- list of user names.
- Throws:
IOException
- if an IO error occurs- See Also:
-
setUserList
Set the list of authorized users for this repository.- Parameters:
users
- list of user and access permissions.anonymousAccessAllowed
- true if anonymous access should be permitted to this repository- Throws:
UserAccessException
IOException
- if an IO error occurs
-
getSubfolderList
Get list of subfolders contained within the specified parent folder.- Parameters:
folderPath
- parent folder path- Returns:
- list of subfolder names
- Throws:
UserAccessException
- if user does not have adequate permission within the repository.FileNotFoundException
- if specified parent folder path not foundIOException
- if an IO error occurs
-
getItemCount
Returns the number of folder items contained within this file-system.- Throws:
IOException
- if an IO error occursUnsupportedOperationException
- if file-system does not support this operation
-
getItemList
Get of all items found within the specified parent folder path.- Parameters:
folderPath
- parent folder path- Returns:
- list of items contained within specified parent folder
- Throws:
UserAccessException
FileNotFoundException
- if parent folder not foundIOException
- if an IO error occurs
-
getItem
Returns the RepositoryItem in the given folder with the given name- Parameters:
parentPath
- folder pathname
- item name- Returns:
- item or null if not found
- Throws:
IOException
- if an IO error occurs
-
getItem
Returns the RepositoryItem with the given unique file ID- Parameters:
fileID
- unique file ID- Returns:
- item or null if not found
- Throws:
IOException
- if an IO error occursUnsupportedOperationException
- if file-system does not support this operation
-
createDatabase
ManagedBufferFileHandle createDatabase(String parentPath, String itemName, String fileID, int bufferSize, String contentType, String projectPath) throws IOException, InvalidNameException Create a new empty database item within the repository.- Parameters:
parentPath
- parent folder pathitemName
- new item namefileID
- unique file IDbufferSize
- buffer file buffer sizecontentType
- application content typeprojectPath
- path of user's project- Returns:
- initial buffer file open for writing
- Throws:
UserAccessException
- if user does not have adequate permission within the repository.DuplicateFileException
- item path already exists within repositoryIOException
- if an IO error occursInvalidNameException
- if itemName or parentPath contains invalid characters
-
openDatabase
ManagedBufferFileHandle openDatabase(String parentPath, String itemName, int version, int minChangeDataVer) throws IOException Open an existing version of a database buffer file for non-update read-only use.- Parameters:
parentPath
- parent folder pathitemName
- name of existing data fileversion
- existing version of data file (-1 = latest version)minChangeDataVer
- indicates the oldest change data buffer file to be included. A -1 indicates only the last change data buffer file is applicable.- Returns:
- remote buffer file for non-update read-only use
- Throws:
UserAccessException
- if user does not have adequate permission within the repository.FileNotFoundException
- if database version not foundIOException
- if an IO error occurs
-
openDatabase
ManagedBufferFileHandle openDatabase(String parentPath, String itemName, long checkoutId) throws IOException Open the current version for checkin of new version.- Parameters:
parentPath
- parent folder pathitemName
- name of existing data filecheckoutId
- checkout ID- Returns:
- remote buffer file for updateable read-only use
- Throws:
UserAccessException
- if user does not have adequate permission within the repository.FileNotFoundException
- if database version not foundIOException
- if an IO error occurs
-
getVersions
Returns a list of all versions for the specified item.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Returns:
- version list
- Throws:
IOException
- if an IO error occurs
-
deleteItem
Delete the specified version of an item.- Parameters:
parentPath
- parent folder pathitemName
- name of itemversion
- oldest or latest version of item to be deleted, or -1 to delete the entire item. User must be Admin or owner of version to be deleted.- Throws:
IOException
- if an IO error occurs
-
moveFolder
void moveFolder(String oldParentPath, String newParentPath, String oldFolderName, String newFolderName) throws InvalidNameException, IOException Move an entire folder- Parameters:
oldParentPath
- current parent folder pathnewParentPath
- new parent folder patholdFolderName
- current folder namenewFolderName
- new folder name- Throws:
InvalidNameException
- if newFolderName is invalidDuplicateFileException
- if target folder already existsIOException
- if an IO error occurs
-
moveItem
void moveItem(String oldParentPath, String newParentPath, String oldItemName, String newItemName) throws InvalidNameException, IOException Move an item to another folder- Parameters:
oldParentPath
- current parent folder pathnewParentPath
- new parent folder patholdItemName
- current item namenewItemName
- new item name- Throws:
InvalidNameException
- if newItemName is invalidDuplicateFileException
- if target item already existsIOException
- if an IO error occurs
-
checkout
ItemCheckoutStatus checkout(String parentPath, String itemName, CheckoutType checkoutType, String projectPath) throws IOException Perform a checkout on the specified item.- Parameters:
parentPath
- parent folder pathitemName
- name of itemcheckoutType
- checkout type. If exclusive or transient, checkout is only successful if no other checkouts exist. No new checkouts of item will be permitted while an exclusive/transient checkout is active.projectPath
- path of user's project- Returns:
- checkout data
- Throws:
IOException
- if an IO error occurs
-
terminateCheckout
void terminateCheckout(String parentPath, String itemName, long checkoutId, boolean notify) throws IOException Terminate an existing item checkout.- Parameters:
parentPath
- parent folder pathitemName
- name of itemcheckoutId
- checkout IDnotify
- notify listeners of item status change- Throws:
IOException
- if an IO error occurs
-
getCheckout
ItemCheckoutStatus getCheckout(String parentPath, String itemName, long checkoutId) throws IOException Returns specific checkout data for an item.- Parameters:
parentPath
- parent folder pathitemName
- name of itemcheckoutId
- checkout ID- Returns:
- checkout data
- Throws:
IOException
- if an IO error occurs
-
getCheckouts
Get a list of all checkouts for an item.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Returns:
- checkout data list
- Throws:
FileNotFoundException
- if folder item not foundIOException
- if an IO error occurs
-
folderExists
Returns true if the specified folder path exists.- Parameters:
folderPath
- folder path- Throws:
IOException
- if an IO error occurs
-
fileExists
Returns true if the specified item exists.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Throws:
IOException
- if an IO error occurs
-
getLength
Returns the length of this domain file. This size is the minimum disk space used for storing this file, but does not account for additional storage space used to tracks changes, etc.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Returns:
- file length
- Throws:
IOException
- if an IO error occurs
-
hasCheckouts
Returns true if the specified item has one or more checkouts.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Throws:
IOException
-
isCheckinActive
Returns true if the specified item has an active checkin.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Throws:
IOException
-
updateCheckoutVersion
void updateCheckoutVersion(String parentPath, String itemName, long checkoutId, int checkoutVersion) throws IOException Update checkout data for an item following an update of a local checkout file.- Parameters:
parentPath
- parent folder pathitemName
- name of itemcheckoutId
- checkout IDcheckoutVersion
- item version used for update- Throws:
IOException
- if error occurs
-
getEvents
Get pending change events. Call will block until an event is available.- Returns:
- array of events
- Throws:
IOException
- if error occurs.
-
close
Notification to server that client is dropping handle.- Throws:
IOException
- if error occurs
-