Interface LeaseCampusAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface LeaseCampusAssignmentSession extends 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 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignLeasesToCampus

      boolean canAssignLeasesToCampus(Id campusId)
      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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      campusId - the Id of the Campus
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - campusId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCampusIds

      IdList getAssignableCampusIds(Id campusId) throws OperationFailedException
      Gets a list of campuses including and under the given campus node in which any lease can be assigned.
      Parameters:
      campusId - the Id of the Campus
      Returns:
      list of assignable campus Ids
      Throws:
      NullArgumentException - campusId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableCampusIdsForLease

      IdList getAssignableCampusIdsForLease(Id campusId, Id leaseId) throws OperationFailedException
      Gets a list of campuses including and under the given campus node in which a specific lease can be assigned.
      Parameters:
      campusId - the Id of the Campus
      leaseId - the Id of the Lease
      Returns:
      list of assignable campus Ids
      Throws:
      NullArgumentException - campusId or leaseId is null
      OperationFailedException - 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 existing Lease to a Campus .
      Parameters:
      leaseId - the Id of the Lease
      campusId - the Id of the Campus
      Throws:
      AlreadyExistsException - leaseId is already assigned to campusId
      NotFoundException - leaseId or campusId not found
      NullArgumentException - leaseId or campusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignLeaseFromCampus

      void unassignLeaseFromCampus(Id leaseId, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Lease from a Campus .
      Parameters:
      leaseId - the Id of the Lease
      campusId - the Id of the Campus
      Throws:
      NotFoundException - leaseId or campusId not found or leaseId not assigned to campusId
      NullArgumentException - leaseId or campusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignLeaseToCampus

      void reassignLeaseToCampus(Id leaseId, Id fromCampusId, Id toCampusId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Lease from one Campus to another. Mappings to other Campuses are unaffected.
      Parameters:
      leaseId - the Id of the Lease
      fromCampusId - the Id of the current Campus
      toCampusId - the Id of the destination Campus
      Throws:
      AlreadyExistsException - leaseId already assigned to toCampusId
      NotFoundException - leaseId, fromCampusId , or toCampusId not found or leaseId not mapped to fromCampusId
      NullArgumentException - leaseId, fromCampusId , or toCampusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.