Interface FamilyBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, FamilyAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Families 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
Family , a FamilyForm is requested using
getFamilyFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
FamilyForms 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 FamilyForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each FamilyForm corresponds to an attempted
transaction.
The FamilyForms returned from
getFamilyFormsForCreate() may be linked to the originating request
through the peer Ids of the FamilyForm . In the case where
there may be duplicates, any FamilyForm of the same peer
Ids may be used for a create operation.
Once a batch of FamilyForms are submitted for create, a
CreateResponse is returned for each FamilyForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createFamily() , errors specific to an
individual FamilyForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
FamilyForm through the FamilyForm Id .
For updates, FamilyForms are requested to the Family
Id that is to be updated using getFamilyFormsForUpdate()
where the reference Id in the FamilyForm may be used to
link the request. Similarly, the FamilyForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The FamilyForm can only be used once for a successful
update and cannot be reused.
Once a batch of FamilyForms are submitted for update, an
UpdateResponse is returned for each FamilyForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateFamily() , errors specific to an
individual FamilyForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
FamilyForm through the FamilyForm Id .
The delete operations delete Families in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasFamilies(AliasRequestList aliasRequests) Adds anIdto aFamilyfor the purpose of creating compatibility.createFamilies(FamilyBatchFormList familyForms) Creates a new set ofFamilies.Deletes allFamilies.deleteFamilies(IdList familyIds) Deletes families for the givenIds.getFamilyFormsForCreate(long number, Type[] familyRecordTypes) Gets the family forms for creating a bunch of new family.getFamilyFormsForUpdate(IdList familyIds) Gets the family forms for updating an existing set of families.updateFamilies(FamilyBatchFormList familyForms) Updates existing families.Methods inherited from interface FamilyAdminSession
aliasFamily, canCreateFamilies, canCreateFamilyWithRecordTypes, canDeleteFamilies, canManageFamilyAliases, canUpdateFamilies, createFamily, deleteFamily, getFamilyFormForCreate, getFamilyFormForUpdate, updateFamilyModifier and TypeMethodDescriptionvoidaliasFamily(Id familyId, Id aliasId) Adds anIdto aFamilyfor the purpose of creating compatibility.booleanTests if this user can create families.booleancanCreateFamilyWithRecordTypes(Type[] familyRecordTypes) Tests if this user can create a singleFamilyusing the desired record types.booleanTests if this user can delete families.booleanTests if this user can manageIdaliases for families.booleanTests if this user can update families.createFamily(FamilyForm familyForm) Creates a newFamily.voiddeleteFamily(Id familyId) Deletes aFamily.getFamilyFormForCreate(Type[] familyRecordTypes) Gets the family form for creating new families.getFamilyFormForUpdate(Id familyId) Gets the family form for updating an existing family.voidupdateFamily(FamilyForm familyForm) Updates an existing family.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
-
getFamilyFormsForCreate
FamilyBatchFormList getFamilyFormsForCreate(long number, Type[] familyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the family forms for creating a bunch of new family.- Parameters:
number- the number of forms to retrievefamilyRecordTypes- array of family record types to be included in each create operation or an empty list if none- Returns:
- the family forms
- Throws:
NullArgumentException-familyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createFamilies
CreateResponseList createFamilies(FamilyBatchFormList familyForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofFamilies. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
familyForms- the family forms- Returns:
- the create responses
- Throws:
NullArgumentException-familyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFamilyFormsForUpdate
FamilyBatchFormList getFamilyFormsForUpdate(IdList familyIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the family forms for updating an existing set of families. A new family form should be requested for each update transaction.- Parameters:
familyIds- theIdsof theFamilies- Returns:
- the family form
- Throws:
NotFoundException- afamilyIdis not foundNullArgumentException-familyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateFamilies
UpdateResponseList updateFamilies(FamilyBatchFormList familyForms) throws OperationFailedException, PermissionDeniedException Updates existing families. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
familyForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-familyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllFamilies
Deletes allFamilies.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteFamilies
DeleteResponseList deleteFamilies(IdList familyIds) throws OperationFailedException, PermissionDeniedException Deletes families for the givenIds.- Parameters:
familyIds- theIdsof the families to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-familyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasFamilies
AliasResponseList aliasFamilies(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aFamilyfor the purpose of creating compatibility. The primaryIdof theFamilyis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another family, it is reassigned to the given familyId.- 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.
-