Interface LeaseCampusAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Leases to
Campuses . A Lease may map to multiple Campuses and
removing the last reference to a Lease is the equivalent of
deleting it. Each Campus may have its own authorizations governing
who is allowed to operate on it.
Adding a reference of a Lease to another Campus is not
a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignLeaseToCampus(Id leaseId, Id campusId) Adds an existingLeaseto aCampus.booleanTests if this user can alter lease/campus mappings.booleancanAssignLeasesToCampus(Id campusId) Tests if this user can alter lease/campus mappings.getAssignableCampusIds(Id campusId) Gets a list of campuses including and under the given campus node in which any lease can be assigned.getAssignableCampusIdsForLease(Id campusId, Id leaseId) Gets a list of campuses including and under the given campus node in which a specific lease can be assigned.voidreassignLeaseToCampus(Id leaseId, Id fromCampusId, Id toCampusId) Moves aLeasefrom oneCampusto another.voidunassignLeaseFromCampus(Id leaseId, Id campusId) Removes aLeasefrom aCampus.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
-
canAssignLeases
boolean canAssignLeases()Tests if this user can alter lease/campus 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.
-
canAssignLeasesToCampus
Tests if this user can alter lease/campus 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:
campusId- theIdof theCampus- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-campusIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableCampusIds
Gets a list of campuses including and under the given campus node in which any lease can be assigned.- Parameters:
campusId- theIdof theCampus- Returns:
- list of assignable campus
Ids - Throws:
NullArgumentException-campusIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableCampusIdsForLease
Gets a list of campuses including and under the given campus node in which a specific lease can be assigned.- Parameters:
campusId- theIdof theCampusleaseId- theIdof theLease- Returns:
- list of assignable campus
Ids - Throws:
NullArgumentException-campusIdorleaseIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignLeaseToCampus
void assignLeaseToCampus(Id leaseId, Id campusId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingLeaseto aCampus.- Parameters:
leaseId- theIdof theLeasecampusId- theIdof theCampus- Throws:
AlreadyExistsException-leaseIdis already assigned tocampusIdNotFoundException-leaseIdorcampusIdnot foundNullArgumentException-leaseIdorcampusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignLeaseFromCampus
void unassignLeaseFromCampus(Id leaseId, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aLeasefrom aCampus.- Parameters:
leaseId- theIdof theLeasecampusId- theIdof theCampus- Throws:
NotFoundException-leaseIdorcampusIdnot found orleaseIdnot assigned tocampusIdNullArgumentException-leaseIdorcampusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignLeaseToCampus
void reassignLeaseToCampus(Id leaseId, Id fromCampusId, Id toCampusId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aLeasefrom oneCampusto another. Mappings to otherCampusesare unaffected.- Parameters:
leaseId- theIdof theLeasefromCampusId- theIdof the currentCampustoCampusId- theIdof the destinationCampus- Throws:
AlreadyExistsException-leaseIdalready assigned totoCampusIdNotFoundException-leaseId, fromCampusId, ortoCampusIdnot found orleaseIdnot mapped tofromCampusIdNullArgumentException-leaseId, fromCampusId, ortoCampusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-