Interface PackageDepotAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Packages to
Depots . A Package may map to multiple Depots and
removing the last reference to an Package is the equivalent of
deleting it. Each Depot may have its own authorizations governing
who is allowed to operate on it.
Moving or adding a reference of a Package to another
Depot is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignPackageToDepot(Id packageId, Id depotId) Adds an existingPackageto aDepot.booleanTests if this user can alter package/depot mappings.booleancanAssignPackagesToDepot(Id depotId) Tests if this user can alter package/depot mappings.getAssignableDepotIds(Id depotId) Gets a list of depot including and under the given depot node in which any package can be assigned.getAssignableDepotIdsForPackage(Id depotId, Id packageId) Gets a list of depot including and under the given depot node in which a specific package can be assigned.voidreassignPackageToDepot(Id packageId, Id fromDepotId, Id toDepotId) Moves aPackagefrom oneDepotto another.voidunassignPackageFromDepot(Id packageId, Id depotId) Removes aPackagefrom aDepot.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
-
canAssignPackages
boolean canAssignPackages()Tests if this user can alter package/depot 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.
-
canAssignPackagesToDepot
Tests if this user can alter package/depot 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:
depotId- theIdof theDepot- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-depotIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableDepotIds
Gets a list of depot including and under the given depot node in which any package can be assigned.- Parameters:
depotId- theIdof theDepot- Returns:
- list of assignable depot
Ids - Throws:
NullArgumentException-depotIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableDepotIdsForPackage
Gets a list of depot including and under the given depot node in which a specific package can be assigned.- Parameters:
depotId- theIdof theDepotpackageId- theIdof thePackage- Returns:
- list of assignable depot
Ids - Throws:
NullArgumentException-depotIdorpackageIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignPackageToDepot
void assignPackageToDepot(Id packageId, Id depotId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingPackageto aDepot.- Parameters:
packageId- theIdof thePackagedepotId- theIdof theDepot- Throws:
AlreadyExistsException-packageIdis already assigned todepotIdNotFoundException-packageIdordepotIdnot foundNullArgumentException-packageIdordepotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignPackageFromDepot
void unassignPackageFromDepot(Id packageId, Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aPackagefrom aDepot.- Parameters:
packageId- theIdof thePackagedepotId- theIdof theDepot- Throws:
NotFoundException-packageIdordepotIdnot found orpackageIdnot assigned todepotIdNullArgumentException-packageIdordepotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignPackageToDepot
void reassignPackageToDepot(Id packageId, Id fromDepotId, Id toDepotId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aPackagefrom oneDepotto another. Mappings to otherDepotsare unaffected.- Parameters:
packageId- theIdof thePackagefromDepotId- theIdof the currentDepottoDepotId- theIdof the destinationDepot- Throws:
AlreadyExistsException-packageIdalready assigned totoDepotIdNotFoundException-packageId, fromDepotId, ortoDepotIdnot found orpackageIdnot mapped tofromDepotIdNullArgumentException-packageId, fromDepotId, ortoDepotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-