Interface CampusAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CampusBatchAdminSession
This session creates and removes campuses. The data for create and update is provided by the consumer via the form.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasCampus(Id campusId, Id aliasId) Adds anIdto aCampusfor the purpose of creating compatibility.booleanTests if this user can createCampuses.booleancanCreateCampusWithRecordTypes(Type[] campusRecordTypes) Tests if this user can create a singleCampususing the desired record interface types.booleanTests if this user can deleteCampusesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forCampuses.booleanTests if this user can updateCampuses.createCampus(CampusForm campusForm) Creates a newCampus.voiddeleteCampus(Id campusId) Deletes aCampus.getCampusFormForCreate(Type[] campusRecordTypes) Gets the campus form for creating new campuses.getCampusFormForUpdate(Id campusId) Gets the campus form for updating an existing campus.voidupdateCampus(CampusForm campusForm) Updates an existing campus.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
-
canCreateCampuses
boolean canCreateCampuses()Tests if this user can createCampuses. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCampuswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifCampuscreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCampusWithRecordTypes
Tests if this user can create a singleCampususing the desired record interface types. WhileRoomManager.getCampusRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificCampus. Providing an empty array tests if aCampuscan be created with no records.- Parameters:
campusRecordTypes- array of campus record types- Returns:
trueifCampuscreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-campusRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCampusFormForCreate
CampusForm getCampusFormForCreate(Type[] campusRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the campus form for creating new campuses. A new form should be requested for each create transaction.- Parameters:
campusRecordTypes- array of campus record types- Returns:
- the campus form
- Throws:
NullArgumentException-campusRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get foem for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCampus
Campus createCampus(CampusForm campusForm) throws OperationFailedException, PermissionDeniedException Creates a newCampus.- Parameters:
campusForm- the form for thisCampus- Returns:
- the new
Campus - Throws:
IllegalStateException-campusFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-campusFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-campusFormdid not originate fromgetCampusFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCampuses
boolean canUpdateCampuses()Tests if this user can updateCampuses. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCampuswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifCampusmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCampusFormForUpdate
CampusForm getCampusFormForUpdate(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the campus form for updating an existing campus. A new campus form should be requested for each update transaction.- Parameters:
campusId- theIdof theCampus- Returns:
- the campus form
- Throws:
NotFoundException-campusIdis not foundNullArgumentException-campusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCampus
Updates an existing campus.- Parameters:
campusForm- the form containing the elements to be updated- Throws:
IllegalStateException-campusFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-campusFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-campusFormdid not originate fromgetCampusFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCampuses
boolean canDeleteCampuses()Tests if this user can deleteCampusesA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCampuswill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifCampusdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCampus
void deleteCampus(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCampus.- Parameters:
campusId- theIdof theCampusto remove- Throws:
NotFoundException-campusIdnot foundNullArgumentException-campusIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCampusAliases
boolean canManageCampusAliases()Tests if this user can manageIdaliases forCampuses. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifCampusaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCampus
void aliasCampus(Id campusId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCampusfor the purpose of creating compatibility. The primaryIdof theCampusis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another campus, it is reassigned to the given campusId.- Parameters:
campusId- theIdof aCampusaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-campusIdnot foundNullArgumentException-campusIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-