Interface DeedBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DeedAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Deeds 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
Deed , a DeedForm is requested using
getDeedFormsForCreate() specifying the peers and desired record
Types or none if no record Types are needed. Each of the returned
DeedForms 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 DeedForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each DeedForm corresponds to an attempted
transaction.
The DeedForms returned from getDeedFormsForCreate()
may be linked to the originating request through the peer Ids of
the DeedForm . In the case where there may be duplicates, any
DeedForm of the same peer Ids may be used for a create
operation.
Once a batch of DeedForms are submitted for create, a
CreateResponse is returned for each DeedForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createDeeds() , errors specific to an
individual DeedForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
DeedForm through the DeedForm Id .
For updates, DeedForms are requested to the Deed
Id that is to be updated using getDeedFormsForUpdate()
where the reference Id in the DeedForm may be used to link
the request. Similarly, the DeedForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The DeedForm can only be used once for a successful update
and cannot be reused.
Once a batch of DeedForms are submitted for update, an
UpdateResponse is returned for each DeedForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateDeeds() , errors specific to an
individual DeedForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
DeedForm through the DeedForm Id .
The delete operations delete Deeds in bulk. To unmap a
Deed from the current Campus , the
DeedCampusAssignmentSession should be used. These delete operations
attempt to remove the Deed itself thus removing it from all known
Campus catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDeeds(AliasRequestList aliasRequests) Adds anIdto aDeedfor the purpose of creating compatibility.createDeeds(DeedBatchFormList deedForms) Creates a new set ofDeeds.Deletes allDeedsin thisCampus.deleteDeeds(IdList deedIds) Deletes deeds for the givenIds.deleteDeedsForBuilding(Id buildingId) Deletes all deeds for a building.deleteDeedsForOwner(Id resourceId) Deletes all deeds for an owner.Deletes deeds expired before the given date.getDeedFormsForCreate(DeedPeerList peers, Type[] deedRecordTypes) Gets the deed forms for creating a bunch of new deeds.getDeedFormsForUpdate(IdList deedIds) Gets the deed forms for updating an existing set of deeds.updateDeeds(DeedBatchFormList deedForms) Updates existing deeds.Methods inherited from interface DeedAdminSession
aliasDeed, canCreateDeeds, canCreateDeedWithRecordTypes, canDeleteDeeds, canManageDeedAliases, canUpdateDeeds, createDeed, deleteDeed, getCampus, getCampusId, getDeedFormForCreate, getDeedFormForUpdate, updateDeedModifier and TypeMethodDescriptionvoidAdds anIdto aDeedfor the purpose of creating compatibility.booleanTests if this user can createDeeds.booleancanCreateDeedWithRecordTypes(Type[] deedRecordTypes) Tests if this user can create a singleDeedusing the desired record interface types.booleanTests if this user can deleteDeedsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forDeeds.booleanTests if this user can updateDeeds.createDeed(DeedForm deedForm) Creates a newDeed.voiddeleteDeed(Id deedId) Deletes aDeed.Gets theCampusassociated with this session.Gets theCampusIdassociated with this session.getDeedFormForCreate(Id buildingId, Id resourceId, Type[] deedRecordTypes) Gets the deed form for creating new deeds.getDeedFormForUpdate(Id deedId) Gets the deed form for updating an existing deed.voidupdateDeed(DeedForm deedForm) Updates an existing deed.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
-
getDeedFormsForCreate
DeedBatchFormList getDeedFormsForCreate(DeedPeerList peers, Type[] deedRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the deed forms for creating a bunch of new deeds. A deed form is returned for each supplied peer.- Parameters:
peers- a list of buildingIdsdeedRecordTypes- array of deed record types to be included in each create operation or an empty list if none- Returns:
- the deed forms
- Throws:
NotFoundException- abuildingIdorresourceIdis not foundNullArgumentException-peersordeedRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDeeds
CreateResponseList createDeeds(DeedBatchFormList deedForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDeeds. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
deedForms- the deed forms- Returns:
- the create responses
- Throws:
NullArgumentException-deedFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDeedFormsForUpdate
DeedBatchFormList getDeedFormsForUpdate(IdList deedIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the deed forms for updating an existing set of deeds. A new deed form should be requested for each update transaction.- Parameters:
deedIds- theIdsof theDeed- Returns:
- the deed form
- Throws:
NotFoundException- adeedIdis not foundNullArgumentException-deedIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDeeds
UpdateResponseList updateDeeds(DeedBatchFormList deedForms) throws OperationFailedException, PermissionDeniedException Updates existing deeds. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
deedForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-deedFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDeeds
Deletes allDeedsin thisCampus.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDeeds
DeleteResponseList deleteDeeds(IdList deedIds) throws OperationFailedException, PermissionDeniedException Deletes deeds for the givenIds.- Parameters:
deedIds- theIdsof the deeds to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-deedIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDeedsForBuilding
DeleteResponseList deleteDeedsForBuilding(Id buildingId) throws OperationFailedException, PermissionDeniedException Deletes all deeds for a building.- Parameters:
buildingId- a buildingId- Returns:
- the delete responses
- Throws:
NullArgumentException-buildingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDeedsForOwner
DeleteResponseList deleteDeedsForOwner(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes all deeds for an owner.- Parameters:
resourceId- a resourceId- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveDeedsByDate
DeleteResponseList deleteIneffectiveDeedsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes deeds expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDeeds
AliasResponseList aliasDeeds(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aDeedfor the purpose of creating compatibility. The primaryIdof theDeedis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another deed, 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.
-