Interface ProjectCampusAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ProjectCampusAssignmentSession extends OsidSession

This session provides methods to re-assign Projects to Campuses . A Project may map to multiple Campuses and removing the last reference to a Project 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 Project to another Campus is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignProjects

      boolean canAssignProjects()
      Tests if this user can alter project/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.
    • canAssignProjectsToCampus

      boolean canAssignProjectsToCampus(Id campusId)
      Tests if this user can alter project/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 project 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.
    • getAssignableCampusIdsForProject

      IdList getAssignableCampusIdsForProject(Id campusId, Id projectId) throws OperationFailedException
      Gets a list of campuses including and under the given campus node in which a specific project can be assigned.
      Parameters:
      campusId - the Id of the Campus
      projectId - the Id of the Project
      Returns:
      list of assignable campus Ids
      Throws:
      NullArgumentException - campusId or projectId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignProjectToCampus

      void assignProjectToCampus(Id projectId, Id campusId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Project to a Campus .
      Parameters:
      projectId - the Id of the Project
      campusId - the Id of the Campus
      Throws:
      AlreadyExistsException - projectId is already assigned to campusId
      NotFoundException - projectId or campusId not found
      NullArgumentException - projectId or campusId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignProjectFromCampus

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

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