Package ghidra.framework.remote
Interface RepositoryHandle
-
- All Known Subinterfaces:
RemoteRepositoryHandle
public interface RepositoryHandle
RepositoryHandle
provides access to a repository.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CLIENT_CHECK_PERIOD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
anonymousAccessAllowed()
ItemCheckoutStatus
checkout(java.lang.String parentPath, java.lang.String itemName, CheckoutType checkoutType, java.lang.String projectPath)
Perform a checkout on the specified item.void
close()
Notification to server that client is dropping handle.ManagedBufferFileHandle
createDatabase(java.lang.String parentPath, java.lang.String itemName, java.lang.String fileID, int bufferSize, java.lang.String contentType, java.lang.String projectPath)
Create a new empty database item within the repository.void
deleteItem(java.lang.String parentPath, java.lang.String itemName, int version)
Delete the specified version of an item.boolean
fileExists(java.lang.String parentPath, java.lang.String itemName)
Returns true if the specified item exists.boolean
folderExists(java.lang.String folderPath)
Returns true if the specified folder path exists.ItemCheckoutStatus
getCheckout(java.lang.String parentPath, java.lang.String itemName, long checkoutId)
Returns specific checkout data for an item.ItemCheckoutStatus[]
getCheckouts(java.lang.String parentPath, java.lang.String itemName)
Get a list of all checkouts for an item.RepositoryChangeEvent[]
getEvents()
Get pending change events.RepositoryItem
getItem(java.lang.String fileID)
Returns the RepositoryItem with the given unique file IDRepositoryItem
getItem(java.lang.String parentPath, java.lang.String name)
Returns the RepositoryItem in the given folder with the given nameint
getItemCount()
Returns the number of folder items contained within this file-system.RepositoryItem[]
getItemList(java.lang.String folderPath)
Get of all items found within the specified parent folder path.long
getLength(java.lang.String parentPath, java.lang.String itemName)
Returns the length of this domain file.java.lang.String
getName()
Returns the name of this repository.java.lang.String[]
getServerUserList()
Convenience method for obtaining a list of all users known to the server.java.lang.String[]
getSubfolderList(java.lang.String folderPath)
Get list of subfolders contained within the specified parent folder.User
getUser()
Returns user object associated with this handle.User[]
getUserList()
Returns a list of users authorized for this repository.Version[]
getVersions(java.lang.String parentPath, java.lang.String itemName)
Returns a list of all versions for the specified item.boolean
hasCheckouts(java.lang.String parentPath, java.lang.String itemName)
Returns true if the specified item has one or more checkouts.boolean
isCheckinActive(java.lang.String parentPath, java.lang.String itemName)
Returns true if the specified item has an active checkin.void
moveFolder(java.lang.String oldParentPath, java.lang.String newParentPath, java.lang.String oldFolderName, java.lang.String newFolderName)
Move an entire foldervoid
moveItem(java.lang.String oldParentPath, java.lang.String newParentPath, java.lang.String oldItemName, java.lang.String newItemName)
Move an item to another folderManagedBufferFileHandle
openDatabase(java.lang.String parentPath, java.lang.String itemName, int version, int minChangeDataVer)
Open an existing version of a database buffer file for non-update read-only use.ManagedBufferFileHandle
openDatabase(java.lang.String parentPath, java.lang.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(java.lang.String parentPath, java.lang.String itemName, long checkoutId, boolean notify)
Terminate an existing item checkout.void
updateCheckoutVersion(java.lang.String parentPath, java.lang.String itemName, long checkoutId, int checkoutVersion)
Update checkout data for an item following an update of a local checkout file.
-
-
-
Method Detail
-
getName
java.lang.String getName() throws java.io.IOException
Returns the name of this repository.- Throws:
java.io.IOException
- if an IO error occurs
-
getUser
User getUser() throws java.io.IOException
Returns user object associated with this handle.- Throws:
java.io.IOException
- if an IO error occurs
-
getUserList
User[] getUserList() throws java.io.IOException
Returns a list of users authorized for this repository.- Throws:
UserAccessException
java.io.IOException
- if an IO error occurs
-
anonymousAccessAllowed
boolean anonymousAccessAllowed() throws java.io.IOException
- Returns:
- true if anonymous access allowed by this repository
- Throws:
java.io.IOException
- if an IO error occurs
-
getServerUserList
java.lang.String[] getServerUserList() throws java.io.IOException
Convenience method for obtaining a list of all users known to the server.- Returns:
- list of user names.
- Throws:
java.io.IOException
- if an IO error occurs- See Also:
RemoteRepositoryServerHandle.getAllUsers()
-
setUserList
void setUserList(User[] users, boolean anonymousAccessAllowed) throws java.io.IOException
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
java.io.IOException
- if an IO error occurs
-
getSubfolderList
java.lang.String[] getSubfolderList(java.lang.String folderPath) throws java.io.IOException
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.java.io.FileNotFoundException
- if specified parent folder path not foundjava.io.IOException
- if an IO error occurs
-
getItemCount
int getItemCount() throws java.io.IOException
Returns the number of folder items contained within this file-system.- Throws:
java.io.IOException
- if an IO error occursjava.lang.UnsupportedOperationException
- if file-system does not support this operation
-
getItemList
RepositoryItem[] getItemList(java.lang.String folderPath) throws java.io.IOException
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
java.io.FileNotFoundException
- if parent folder not foundjava.io.IOException
- if an IO error occurs
-
getItem
RepositoryItem getItem(java.lang.String parentPath, java.lang.String name) throws java.io.IOException
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:
java.io.IOException
- if an IO error occurs
-
getItem
RepositoryItem getItem(java.lang.String fileID) throws java.io.IOException
Returns the RepositoryItem with the given unique file ID- Parameters:
fileID
- unique file ID- Returns:
- item or null if not found
- Throws:
java.io.IOException
- if an IO error occursjava.lang.UnsupportedOperationException
- if file-system does not support this operation
-
createDatabase
ManagedBufferFileHandle createDatabase(java.lang.String parentPath, java.lang.String itemName, java.lang.String fileID, int bufferSize, java.lang.String contentType, java.lang.String projectPath) throws java.io.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 repositoryjava.io.IOException
- if an IO error occursInvalidNameException
- if itemName or parentPath contains invalid characters
-
openDatabase
ManagedBufferFileHandle openDatabase(java.lang.String parentPath, java.lang.String itemName, int version, int minChangeDataVer) throws java.io.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.java.io.FileNotFoundException
- if database version not foundjava.io.IOException
- if an IO error occurs
-
openDatabase
ManagedBufferFileHandle openDatabase(java.lang.String parentPath, java.lang.String itemName, long checkoutId) throws java.io.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.java.io.FileNotFoundException
- if database version not foundjava.io.IOException
- if an IO error occurs
-
getVersions
Version[] getVersions(java.lang.String parentPath, java.lang.String itemName) throws java.io.IOException
Returns a list of all versions for the specified item.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Returns:
- version list
- Throws:
java.io.IOException
- if an IO error occurs
-
deleteItem
void deleteItem(java.lang.String parentPath, java.lang.String itemName, int version) throws java.io.IOException
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:
java.io.IOException
- if an IO error occurs
-
moveFolder
void moveFolder(java.lang.String oldParentPath, java.lang.String newParentPath, java.lang.String oldFolderName, java.lang.String newFolderName) throws InvalidNameException, java.io.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 existsjava.io.IOException
- if an IO error occurs
-
moveItem
void moveItem(java.lang.String oldParentPath, java.lang.String newParentPath, java.lang.String oldItemName, java.lang.String newItemName) throws InvalidNameException, java.io.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 existsjava.io.IOException
- if an IO error occurs
-
checkout
ItemCheckoutStatus checkout(java.lang.String parentPath, java.lang.String itemName, CheckoutType checkoutType, java.lang.String projectPath) throws java.io.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:
java.io.IOException
- if an IO error occurs
-
terminateCheckout
void terminateCheckout(java.lang.String parentPath, java.lang.String itemName, long checkoutId, boolean notify) throws java.io.IOException
Terminate an existing item checkout.- Parameters:
parentPath
- parent folder pathitemName
- name of itemcheckoutId
- checkout IDnotify
- notify listeners of item status change- Throws:
java.io.IOException
- if an IO error occurs
-
getCheckout
ItemCheckoutStatus getCheckout(java.lang.String parentPath, java.lang.String itemName, long checkoutId) throws java.io.IOException
Returns specific checkout data for an item.- Parameters:
parentPath
- parent folder pathitemName
- name of itemcheckoutId
- checkout ID- Returns:
- checkout data
- Throws:
java.io.IOException
- if an IO error occurs
-
getCheckouts
ItemCheckoutStatus[] getCheckouts(java.lang.String parentPath, java.lang.String itemName) throws java.io.IOException
Get a list of all checkouts for an item.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Returns:
- checkout data list
- Throws:
java.io.IOException
- if an IO error occurs
-
folderExists
boolean folderExists(java.lang.String folderPath) throws java.io.IOException
Returns true if the specified folder path exists.- Parameters:
folderPath
- folder path- Throws:
java.io.IOException
- if an IO error occurs
-
fileExists
boolean fileExists(java.lang.String parentPath, java.lang.String itemName) throws java.io.IOException
Returns true if the specified item exists.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Throws:
java.io.IOException
- if an IO error occurs
-
getLength
long getLength(java.lang.String parentPath, java.lang.String itemName) throws java.io.IOException
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:
java.io.IOException
- if an IO error occurs
-
hasCheckouts
boolean hasCheckouts(java.lang.String parentPath, java.lang.String itemName) throws java.io.IOException
Returns true if the specified item has one or more checkouts.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Throws:
java.io.IOException
-
isCheckinActive
boolean isCheckinActive(java.lang.String parentPath, java.lang.String itemName) throws java.io.IOException
Returns true if the specified item has an active checkin.- Parameters:
parentPath
- parent folder pathitemName
- name of item- Throws:
java.io.IOException
-
updateCheckoutVersion
void updateCheckoutVersion(java.lang.String parentPath, java.lang.String itemName, long checkoutId, int checkoutVersion) throws java.io.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:
java.io.IOException
- if error occurs
-
getEvents
RepositoryChangeEvent[] getEvents() throws java.io.IOException
Get pending change events. Call will block until an event is available.- Returns:
- array of events
- Throws:
java.io.IOException
- if error occurs.
-
close
void close() throws java.io.IOException
Notification to server that client is dropping handle.- Throws:
java.io.IOException
- if error occurs
-
-