Interface FunctionVaultAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Functions to
Vaults . A Function may map to multiple Vaults and
removing the last reference to a Function is the equivalent of
deleting it. Each Vault may have its own authorizations governing
who is allowed to operate on it.
Adding a reference of a Function to another Vault is
not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignFunctionToVault(Id functionId, Id vaultId) Adds an existingFunctionto aVault.booleanTests if this user can alter function/vault mappings.booleancanAssignFunctionsToVault(Id vaultId) Tests if this user can alter function/vault mappings.getAssignableVaultIds(Id vaultId) Gets a list of vault including and under the given vault node in which any function can be assigned.getAssignableVaultIdsForFunction(Id vaultId, Id functionId) Gets a list of vault including and under the given vault node in which a specific function can be assigned.voidreassignFunctionToVault(Id functionId, Id fromVaultId, Id toVaultId) Moves aFunctionfrom oneVaultto another.voidunassignFunctionFromVault(Id functionId, Id vaultId) Removes aFunctionfrom aVault.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
-
canAssignFunctions
boolean canAssignFunctions()Tests if this user can alter function/vault mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignFunctionsToVault
Tests if this user can alter function/vault mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
vaultId- theIdof theVault- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-vaultIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableVaultIds
Gets a list of vault including and under the given vault node in which any function can be assigned.- Parameters:
vaultId- theIdof theVault- Returns:
- list of assignable vault
Ids - Throws:
NullArgumentException-vaultIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableVaultIdsForFunction
Gets a list of vault including and under the given vault node in which a specific function can be assigned.- Parameters:
vaultId- theIdof theVaultfunctionId- theIdof theFunction- Returns:
- list of assignable vault
Ids - Throws:
NullArgumentException-vaultIdorfunctionIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignFunctionToVault
void assignFunctionToVault(Id functionId, Id vaultId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingFunctionto aVault.- Parameters:
functionId- theIdof theFunctionvaultId- theIdof theVault- Throws:
AlreadyExistsException-functionIdis already assigned tovaultIdNotFoundException-functionIdorvaultIdnot foundNullArgumentException-functionIdorvaultIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignFunctionFromVault
void unassignFunctionFromVault(Id functionId, Id vaultId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aFunctionfrom aVault.- Parameters:
functionId- theIdof theFunctionvaultId- theIdof theVault- Throws:
NotFoundException-functionIdorvaultIdnot found orfunctionIdnot assigned tovaultIdNullArgumentException-functionIdorvaultIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignFunctionToVault
void reassignFunctionToVault(Id functionId, Id fromVaultId, Id toVaultId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aFunctionfrom oneVaultto another. Mappings to otherVaultsare unaffected.- Parameters:
functionId- theIdof theFunctionfromVaultId- theIdof the currentVaulttoVaultId- theIdof the destinationVault- Throws:
AlreadyExistsException-functionIdalready assigned totoVaultIdNotFoundException-functionId, fromVaultId, ortoVaultIdnot found orfunctionIdnot mapped tofromVaultIdNullArgumentException-functionId, fromVaultId, ortoVaultIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-