Interface RealmBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, RealmAdminSession
This session creates, updates, and deletes Realms 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 a
Realm , a RealmForm is requested using
getRealmFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
RealmForms 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 a RealmForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each RealmForm corresponds to an attempted
transaction.
The RealmForms returned from getRealmFormsForCreate()
may be linked to the originating request through the peer Ids of
the RealmForm . In the case where there may be duplicates, any
RealmForm of the same peer Ids may be used for a create
operation.
Once a batch of RealmForms are submitted for create, a
CreateResponse is returned for each RealmForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createRealms() , errors specific to an
individual RealmForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
RealmForm through the RealmForm Id .
For updates, RealmForms are requested to the Realm
Id that is to be updated using getRealmFormsForUpdate()
where the reference Id in the RealmForm may be used to
link the request. Similarly, the RealmForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The RealmForm can only be used once for a successful
update and cannot be reused.
Once a batch of RealmForms are submitted for update, an
UpdateResponse is returned for each RealmForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateRealms() , errors specific to an
individual RealmForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
RealmForm through the RealmForm Id .
The delete operations delete Realms in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasRealms(AliasRequestList aliasRequests) Adds anIdto aRealmfor the purpose of creating compatibility.createRealms(RealmBatchFormList realmForms) Creates a new set ofRealms.Deletes allRealms.deleteRealms(IdList realmIds) Deletes realms for the givenIds.getRealmFormsForCreate(long number, Type[] realmRecordTypes) Gets the realm forms for creating a bunch of new realms.getRealmFormsForUpdate(IdList realmIds) Gets the realm forms for updating an existing set of realms.updateRealms(RealmBatchFormList realmForms) Updates existing realms.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.Methods inherited from interface RealmAdminSession
aliasRealm, canCreateRealms, canCreateRealmWithRecordTypes, canDeleteRealms, canManageRealmAliases, canUpdateRealms, createRealm, deleteRealm, getRealmFormForCreate, getRealmFormForUpdate, updateRealmModifier and TypeMethodDescriptionvoidaliasRealm(Id realmId, Id aliasId) Adds anIdto aRealmfor the purpose of creating compatibility.booleanTests if this user can createRealms.booleancanCreateRealmWithRecordTypes(Type[] realmRecordTypes) Tests if this user can create a singleRealmusing the desired record types.booleanTests if this user can deleteRealmsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forRealms.booleanTests if this user can updateRealms.createRealm(RealmForm realmForm) Creates a newRealm.voiddeleteRealm(Id realmId) Deletes aRealm.getRealmFormForCreate(Type[] realmRecordTypes) Gets the realm form for creating new realms.getRealmFormForUpdate(Id realmId) Gets the realm form for updating an existing realm.voidupdateRealm(RealmForm realmForm) Updates an existing realm.
-
Method Details
-
getRealmFormsForCreate
RealmBatchFormList getRealmFormsForCreate(long number, Type[] realmRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the realm forms for creating a bunch of new realms.- Parameters:
number- the number of forms to retrieverealmRecordTypes- array of realm record types to be included in each create operation or an empty list if none- Returns:
- the realm forms
- Throws:
NullArgumentException-realmRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createRealms
CreateResponseList createRealms(RealmBatchFormList realmForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofRealms. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
realmForms- the realm forms- Returns:
- the create responses
- Throws:
NullArgumentException-realmFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRealmFormsForUpdate
RealmBatchFormList getRealmFormsForUpdate(IdList realmIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the realm forms for updating an existing set of realms. A new realm form should be requested for each update transaction.- Parameters:
realmIds- theIdsof theRealm- Returns:
- the realm form
- Throws:
NotFoundException- arealmIdis not foundNullArgumentException-realmIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRealms
UpdateResponseList updateRealms(RealmBatchFormList realmForms) throws OperationFailedException, PermissionDeniedException Updates existing realms. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
realmForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-realmFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllRealms
Deletes allRealms.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRealms
DeleteResponseList deleteRealms(IdList realmIds) throws OperationFailedException, PermissionDeniedException Deletes realms for the givenIds.- Parameters:
realmIds- theIdsof the realms to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-realmIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasRealms
AliasResponseList aliasRealms(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aRealmfor the purpose of creating compatibility. The primaryIdof theRealmis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another realm, it is reassigned to the given realmId.- 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.
-