Interface AllocationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for managing quotas. Allocations can be assigned across all users in a directory structure or on a user by user basis.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can create allocations in this session for or under the session directory.booleanTests if this user can create allocations in this session for or under the session directory for specific users.booleancanCreateAllocationWithRecordTypes(Type[] allocationRecordTypes) Tests if this user can create a singleAllocationusing the desired record types.booleancanCreateAllocationWithRecordTypesForUsers(Type[] allocationRecordTypes) Tests if this user can create a singleAllocationusing the desired record types targeted for specific users.booleanTests if this user can delete allocations for directories in this session.booleanTests if this user can delete allocations for users in directories in this session.booleanTests if this user can update allocations for directories in this session.booleanTests if this user can update allocations for users in directories in this session.createAllocation(AllocationForm allocationForm) Creates a new allocation across all users for a directory.createAllocationForUser(AllocationForm allocationForm) Creates a new allocation for a specific user for a directory.voiddeleteAllocation(String name) Deletes the allocation for a directory.voiddeleteAllocationForUser(String name, Id agentId) Deletes the allocation for a directory.getAllocationFormForCreate(String name, Type[] allocationRecordTypes) Gets the file form for creating new allocations across all users for a directory.getAllocationFormForCreateForUser(String name, Id agentId, Type[] allocationRecordTypes) Gets the file form for creating new allocations across all users for a directory.Gets the allocation form for updating an existing allocation.getAllocationFormForUpdateForUser(String name, Id agentId) Gets the allocation form for updating an existing allocation for a user.Gets the directory associated with this session.Gets the absolute path of this directory.voidupdateAllocation(AllocationForm allocationForm) Updates an existing allocation.voidupdateAllocationForUser(AllocationForm allocationForm) Updates an existing allocation.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
-
getDirectoryPath
String getDirectoryPath()Gets the absolute path of this directory.- Returns:
- the absolute path of 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.
-
canCreateAllocations
boolean canCreateAllocations()Tests if this user can create allocations in this session for or under the session directory. 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 create operations to unauthorized users.- Returns:
falseif filing allocation create methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAllocationWithRecordTypes
Tests if this user can create a singleAllocationusing the desired record types. WhileFilingAllocationManager.getAllocationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAllocation. Providing an empty array tests if anAllocationcan be created with no records.- Parameters:
allocationRecordTypes- array of allocation record types- Returns:
trueifAllocationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-allocationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAllocationFormForCreate
AllocationForm getAllocationFormForCreate(String name, Type[] allocationRecordTypes) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Gets the file form for creating new allocations across all users for a directory. A new form should be requested for each create transaction.- Parameters:
name- name of a directoryallocationRecordTypes- array of allocation record types- Returns:
- the allocation form
- Throws:
AlreadyExistsException- allocation already existsNotFoundException-namenot foundNullArgumentException-nameorallocationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAllocation
Allocation createAllocation(AllocationForm allocationForm) throws OperationFailedException, PermissionDeniedException Creates a new allocation across all users for a directory.- Parameters:
allocationForm- the allocation form- Returns:
- the new allocation
- Throws:
IllegalStateException-allocationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-allocationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-fileFormdid not originate fromgetAllocationFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAllocations
boolean canUpdateAllocations()Tests if this user can update allocations for directories in this session. 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 update operations to unauthorized users.- Returns:
falseif filing allocation update methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAllocationFormForUpdate
AllocationForm getAllocationFormForUpdate(String name) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the allocation form for updating an existing allocation. A new file form should be requested for each update transaction.- Parameters:
name- name of the directory- Returns:
- the allocation form
- Throws:
NotFoundException-nameis not found or no allocation existsNullArgumentException-nameisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAllocation
void updateAllocation(AllocationForm allocationForm) throws OperationFailedException, PermissionDeniedException Updates an existing allocation.- Parameters:
allocationForm- the form containing the elements to be updated- Throws:
IllegalStateException-allocationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-allocationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-allocationFormdid not originate fromgetAllocationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAllocations
boolean canDeleteAllocations()Tests if this user can delete allocations for directories in this session. 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 delete operations to unauthorized users.- Returns:
falseif filing allocation delete methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAllocation
void deleteAllocation(String name) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes the allocation for a directory.- Parameters:
name- the name of the directory- Throws:
NotFoundException-nameis not found or no allocation existsNullArgumentException-nameisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAllocationsForUsers
boolean canCreateAllocationsForUsers()Tests if this user can create allocations in this session for or under the session directory for specific users. 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 create operations to unauthorized users.- Returns:
falseif user allocation create methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAllocationWithRecordTypesForUsers
Tests if this user can create a singleAllocationusing the desired record types targeted for specific users. WhileFilingAllocationManager.getAllocationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAllocation. Providing an empty array tests if anAllocationcan be created with no records.- Parameters:
allocationRecordTypes- array of allocation record types- Returns:
trueifAllocationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-allocationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAllocationFormForCreateForUser
AllocationForm getAllocationFormForCreateForUser(String name, Id agentId, Type[] allocationRecordTypes) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Gets the file form for creating new allocations across all users for a directory. A new form should be requested for each create transaction.- Parameters:
name- name of a directoryagentId- theIdof a userallocationRecordTypes- array of allocation record types- Returns:
- the allocation form
- Throws:
AlreadyExistsException- allocation already existsNotFoundException-nameoragentIdis not foundNullArgumentException-name, agentId, orallocationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAllocationForUser
Allocation createAllocationForUser(AllocationForm allocationForm) throws OperationFailedException, PermissionDeniedException Creates a new allocation for a specific user for a directory.- Parameters:
allocationForm- the allocation form- Returns:
- the new allocation
- Throws:
IllegalStateException-allocationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-allocationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-fileFormdid not originate fromgetAllocationFormForCreateForUser()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAllocationsForUsers
boolean canUpdateAllocationsForUsers()Tests if this user can update allocations for users in directories in this session. 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 update operations to unauthorized users.- Returns:
falseif filing allocation user update methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAllocationFormForUpdateForUser
AllocationForm getAllocationFormForUpdateForUser(String name, Id agentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the allocation form for updating an existing allocation for a user. A new file form should be requested for each update transaction.- Parameters:
name- name of the directoryagentId- theIdof the user- Returns:
- the allocation form
- Throws:
NotFoundException-nameoragentIdis not found or no allocation existsNullArgumentException-nameoragentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAllocationForUser
void updateAllocationForUser(AllocationForm allocationForm) throws OperationFailedException, PermissionDeniedException Updates an existing allocation.- Parameters:
allocationForm- the form containing the elements to be updated- Throws:
IllegalStateException-allocationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-allocationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-allocationFormdid not originate fromgetAllocationFormForUpdateForUser()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAllocationsForUser
boolean canDeleteAllocationsForUser()Tests if this user can delete allocations for users in directories in this session. 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 delete operations to unauthorized users.- Returns:
falseif filing allocation delete methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAllocationForUser
void deleteAllocationForUser(String name, Id agentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes the allocation for a directory.- Parameters:
name- name of the directoryagentId- theIdof the user- Throws:
NotFoundException-nameoragentIdis not found or no allocation existsNullArgumentException-nameoragentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-