Interface CampusBatchAdminSession
- All Superinterfaces:
AutoCloseable, CampusAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Campuses in bulk.
The data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update and may
not be reused.
Create and update operations differ in their usage. To create an
Campus , an CampusForm is requested using
getCampusFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
CampusForms will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once an CampusForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each CampusForm corresponds to an attempted
transaction.
The CampusForms returned from
getCampusFormsForCreate() may be linked to the originating request
through the peer Ids of the CampusForm . In the case where
there may be duplicates, any CampusForm of the same peer
Ids may be used for a create operation.
Once a batch of CampusForms are submitted for create, a
CreateResponse is returned for each CampusForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createCampuses() , errors specific to
an individual CampusForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
CampusForm through the CampusForm Id .
For updates, CampusForms are requested to the Campus
Id that is to be updated using getCampusFormsForUpdate()
where the reference Id in the CampusForm may be used to
link the request. Similarly, the CampusForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The CampusForm can only be used once for a successful
update and cannot be reused.
Once a batch of CampusForms are submitted for update, an
UpdateResponse is returned for each CampusForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateCampuses() , errors specific to
an individual CampusForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
CampusForm through the CampusForm Id .
The delete operations delete Campuses in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCampuses(AliasRequestList aliasRequests) Adds anIdto anCampusfor the purpose of creating compatibility.createCampuses(CampusBatchFormList campusForms) Creates a new set ofCampuses.Deletes allCampuses.deleteCampuses(IdList campusIds) Deletes campuses for the givenIds.getCampusFormsForCreate(long number, Type[] campusRecordTypes) Gets the campus forms for creating a bunch of new campuses.getCampusFormsForUpdate(IdList campusIds) Gets the campus forms for updating an existing set of campuses.updateCampuses(CampusBatchFormList campusForms) Updates existing campuses.Methods inherited from interface CampusAdminSession
aliasCampus, canCreateCampuses, canCreateCampusWithRecordTypes, canDeleteCampuses, canManageCampusAliases, canUpdateCampuses, createCampus, deleteCampus, getCampusFormForCreate, getCampusFormForUpdate, updateCampusModifier 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
-
getCampusFormsForCreate
CampusBatchFormList getCampusFormsForCreate(long number, Type[] campusRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the campus forms for creating a bunch of new campuses.- Parameters:
number- the number of forms to retrievecampusRecordTypes- array of campus record types to be included in each create operation or an empty list if none- Returns:
- the campus forms
- Throws:
NullArgumentException-campusRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCampuses
CreateResponseList createCampuses(CampusBatchFormList campusForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCampuses. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
campusForms- the campus forms- Returns:
- the create responses
- Throws:
NullArgumentException-campusFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCampusFormsForUpdate
CampusBatchFormList getCampusFormsForUpdate(IdList campusIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the campus forms for updating an existing set of campuses. A new campus form should be requested for each update transaction.- Parameters:
campusIds- theIdsof theCampus- Returns:
- the campus form
- Throws:
NotFoundException- ancampusIdis not foundNullArgumentException-campusIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCampuses
UpdateResponseList updateCampuses(CampusBatchFormList campusForms) throws OperationFailedException, PermissionDeniedException Updates existing campuses. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
campusForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-campusFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCampuses
Deletes allCampuses.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCampuses
DeleteResponseList deleteCampuses(IdList campusIds) throws OperationFailedException, PermissionDeniedException Deletes campuses for the givenIds.- Parameters:
campusIds- theIdsof the campuses to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-campusIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCampuses
AliasResponseList aliasCampuses(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anCampusfor the purpose of creating compatibility. The primaryIdof theCampusis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another campus, it is reassigned to the given entryId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-