public interface DirectoryAdminSession extends OsidSession
This session creates and removes files and directories under the directory associated with this session.
The view of the administrative methods defined in this session is
determined by the provider. For an instance of this session where no path
has been specified, it may not be parallel to the
DirectoryLookupSession.
For example, a default
DirectoryLookupSession
may view the entire directory hierarchy
while the default DirectoryAdminSession
uses an isolated
Directory
to create new entries. Another scenario is a
federated provider who does not wish to permit administrative operations
for the federation unaware.
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateDirectoryWithRecordTypes(Type[] directoryRecordTypes)
Tests if this user can create a single
Directory using
the desired record types. |
boolean |
canCreateFileWithRecordTypes(Type[] fileRecordTypes)
Tests if this user can create a single
File using the
desired record types. |
boolean |
canModifyDirectory()
Tests if this user can create or remove entries in this directory.
|
void |
clearDirectory(Id directoryId)
Deletes all files and subdirectories within the given directory.
|
Directory |
createDirectory(DirectoryForm directoryForm)
Creates a new directory.
|
File |
createFile(FileForm fileForm)
Creates a new file in this directory.
|
void |
deleteDirectory(Id directoryId)
Deletes a directory in this directory.
|
void |
deleteFile(Id fileId)
Deletes a file.
|
Directory |
getDirectory()
Gets the directory associated with this session.
|
DirectoryForm |
getDirectoryFormForCreate(java.lang.String name,
Type[] directoryRecordTypes)
Gets the file form for creating new directories.
|
DirectoryForm |
getDirectoryFormForUpdate(Id directoryId)
Gets the directory form for updating an existing files.
|
Id |
getDirectoryId()
Gets the
Id of this directory. |
FileForm |
getFileFormForCreate(java.lang.String name,
Type[] fileRecordTypes)
Gets the file form for creating new files.
|
FileForm |
getFileFormForUpdate(Id fileId)
Gets the file form for updating an existing files.
|
void |
overwrite()
Overwrite files if a destination pathname exists and is a file.
|
void |
updateDirectory(DirectoryForm directoryForm)
Updates an existing directory.
|
void |
updateFile(FileForm fileForm)
Updates an existing file.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDirectoryId()
Id
of this directory. Id
of this directorymandatory
- This method must be implemented. Directory getDirectory() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canModifyDirectory()
PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if modifying this directory is not
authorized, true
otherwisemandatory
- This method must be implemented. void overwrite()
mandatory
- This method is must be implemented. boolean canCreateFileWithRecordTypes(Type[] fileRecordTypes)
File
using the
desired record types. While FilingManager.getFileRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
File.
Providing an empty array tests if a File
can be created with no records.fileRecordTypes
- array of file record types true
if File
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- fileRecordTypes
is null
mandatory
- This method must be implemented. FileForm getFileFormForCreate(java.lang.String name, Type[] fileRecordTypes) throws AlreadyExistsException, OperationFailedException, PermissionDeniedException
name
- name of a filefileRecordTypes
- array of file record typesAlreadyExistsException
- name
already
exists as a file in this direrctory and overwrite()
is false
InvalidArgumentException
- name
is
invalidNullArgumentException
- name
or
fileRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. File createFile(FileForm fileForm) throws OperationFailedException, PermissionDeniedException
fileForm
- the file formIllegalStateException
- fileForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- fileForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- fileForm
did not
originate from getFileFormForCreate()
mandatory
- This method must be implemented. FileForm getFileFormForUpdate(Id fileId) throws NotFoundException, OperationFailedException, PermissionDeniedException
fileId
- Id
of the file to updateNotFoundException
- fileId
is not foundNullArgumentException
- fileId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateFile(FileForm fileForm) throws OperationFailedException, PermissionDeniedException
fileForm
- the form containing the elements to be updatedIllegalStateException
- fileForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- fileForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- fileForm
did not
originate from getFileFormForUpdate()
mandatory
- This method must be implemented. void deleteFile(Id fileId) throws NotFoundException, OperationFailedException, PermissionDeniedException
fileId
- the Id
of the file to deleteNotFoundException
- fileId
is not foundNullArgumentException
- fileId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateDirectoryWithRecordTypes(Type[] directoryRecordTypes)
Directory
using
the desired record types. While
FilingManager.getDiectoryRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Directory.
Providing
an empty array tests if a Directory
can be created with
no records.directoryRecordTypes
- array of directory record types true
if Directory
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- directoryRecordTypes
is null
mandatory
- This method must be implemented. DirectoryForm getDirectoryFormForCreate(java.lang.String name, Type[] directoryRecordTypes) throws AlreadyExistsException, OperationFailedException, PermissionDeniedException
Directories
where only the
Directory
Type
is known.name
- the name of a subdirectory in this directorydirectoryRecordTypes
- array of directory record typesAlreadyExistsException
- directory already exists and
overwrite()
is falseInvalidArgumentException
- name
is
invalidNullArgumentException
- name
or
directoryRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Directory createDirectory(DirectoryForm directoryForm) throws OperationFailedException, PermissionDeniedException
directoryForm
- the directory formIllegalStateException
- directoryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- directoryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- directoryForm
did
not originate from getDirectoryFormForCreate()
mandatory
- This method must be implemented. DirectoryForm getDirectoryFormForUpdate(Id directoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Directory
to be updated is
known and is desired to access any metadata specific to the
Directory
being updated.directoryId
- Id
of the directory to updateNotFoundException
- directoryId
is not
foundNullArgumentException
- directoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateDirectory(DirectoryForm directoryForm) throws OperationFailedException, PermissionDeniedException
directoryForm
- the form containing the elements to be updatedIllegalStateException
- directoryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- directoryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- directoryForm
did
not originate from getDirectoryFormForUpdate()
mandatory
- This method must be implemented. void deleteDirectory(Id directoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
directoryId
- the Id
of the directory to deleteNotFoundException
- directoryId
is not
foundNullArgumentException
- directoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void clearDirectory(Id directoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
directoryId
- the Id
of the directory to deleteNotFoundException
- directoryId
is not
foundNullArgumentException
- directoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.