Interface ResourceBinAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Resources to
Bins. A Resource may map to multiple Bin objects and
removing the last reference to a Resource is the equivalent of
deleting it. Each Bin may have its own authorizations governing
who is allowed to operate on it.
Moving or adding a reference of a Resource to another
Bin is not a copy operation (eg: does not change its Id).
Like all OsidSessions, ResourceBinAssignmentSessions
are dedicated to single processing threads and a single authenticated
user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignResourceToBin(Id resourceId, Id binId) Adds an existingResourceto aBin.booleanTests if this user can alter resource/bin mappings.booleancanAssignResourcesToBin(Id binId) Tests if this user can alter resource/bin mappings.getAssignableBinIds(Id binId) Gets a list of bins including and under the given bin node in which any resource can be assigned.getAssignableBinIdsForResource(Id binId, Id resourceId) Gets a list of bins including and under the given bin node in which a specific resource can be assigned.voidreassignResourceToBin(Id resourceId, Id fromBinId, Id toBinId) Moves aResourcefrom oneBinto another.voidunassignResourceFromBin(Id resourceId, Id binId) Removes aResourcefrom aBin.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
canAssignResources
boolean canAssignResources()Tests if this user can alter resource/bin 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.
-
canAssignResourcesToBin
Tests if this user can alter resource/bin 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:
binId- theIdof theBin- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-binIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableBinIds
Gets a list of bins including and under the given bin node in which any resource can be assigned.- Parameters:
binId- theIdof theBin- Returns:
- list of assignable bin
Ids - Throws:
NullArgumentException-binIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableBinIdsForResource
Gets a list of bins including and under the given bin node in which a specific resource can be assigned.- Parameters:
binId- theIdof theBinresourceId- theIdof theResource- Returns:
- list of assignable bin
Ids - Throws:
NullArgumentException-binIdorresourceIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignResourceToBin
void assignResourceToBin(Id resourceId, Id binId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingResourceto aBin.- Parameters:
resourceId- theIdof theResourcebinId- theIdof theBin- Throws:
AlreadyExistsException-resourceIdis already assigned tobinIdNotFoundException-resourceIdorbinIdnot foundNullArgumentException-resourceIdorbinIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignResourceFromBin
void unassignResourceFromBin(Id resourceId, Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aResourcefrom aBin.- Parameters:
resourceId- theIdof theResourcebinId- theIdof theBin- Throws:
NotFoundException-resourceIdorbinIdnot found orresourceIdnot assigned tobinIdNullArgumentException-resourceIdorbinIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignResourceToBin
void reassignResourceToBin(Id resourceId, Id fromBinId, Id toBinId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aResourcefrom oneBinto another. Mappings to otherBinsare unaffected.- Parameters:
resourceId- theIdof theResourcefromBinId- theIdof the currentBintoBinId- theIdof the destinationBin- Throws:
AlreadyExistsException-resourceIdalready assigned totoBinIdNotFoundException-resourceId, fromBinId, ortoBinIdnot found orresourceIdnot mapped tofromBinIdNullArgumentException-resourceId, fromBinId, ortoBinIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-