Interface PersonBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, PersonAdminSession
This session creates, updates, and deletes Persons 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
Person , a PersonForm is requested using
getPersonFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
PersonForms 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 PersonForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each PersonForm corresponds to an attempted
transaction.
The PersonForms returned from
getPersonFormsForCreate() may be linked to the originating request
through the peer Ids of the PersonForm . In the case where
there may be duplicates, any PersonForm of the same peer
Ids may be used for a create operation.
Once a batch of PersonForms are submitted for create, a
CreateResponse is returned for each PersonForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createPersons() , errors specific to
an individual PersonForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
PersonForm through the PersonForm Id .
For updates, PersonForms are requested to the Person
Id that is to be updated using getPersonFormsForUpdate()
where the reference Id in the PersonForm may be used to
link the request. Similarly, the PersonForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The PersonForm can only be used once for a successful
update and cannot be reused.
Once a batch of PersonForms are submitted for update, an
UpdateResponse is returned for each PersonForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updatePersons() , errors specific to
an individual PersonForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
PersonForm through the PersonForm Id .
The delete operations delete Persons in bulk. To unmap a
Person from the current Realm , the
PersonRealmAssignmentSession should be used. These delete operations
attempt to remove the Person itself thus removing it from all
known Realm catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasPersons(AliasRequestList aliasRequests) Adds anIdto aPersonfor the purpose of creating compatibility.createPersons(PersonBatchFormList personForms) Creates a new set ofPersons.Deletes allPersonsin thisRealm.deletePersons(IdList personIds) Deletes persons for the givenIds.getPersonFormsForCreate(long number, Type[] personRecordTypes) Gets the person forms for creating a bunch of new persons.getPersonFormsForUpdate(IdList personIds) Gets the person forms for updating an existing set of persons.updatePersons(PersonBatchFormList personForms) Updates existing persons.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 PersonAdminSession
aliasPerson, canCreatePersons, canCreatePersonWithRecordTypes, canDeletePersons, canManagePersonAliases, canUpdatePersons, createPerson, deletePerson, getPersonFormForCreate, getPersonFormForUpdate, getRealm, getRealmId, updatePersonModifier and TypeMethodDescriptionvoidaliasPerson(Id personId, Id aliasId) Adds anIdto aPersonfor the purpose of creating compatibility.booleanTests if this user can create persons.booleancanCreatePersonWithRecordTypes(Type[] personRecordTypes) Tests if this user can create a singlePersonusing the desired record types.booleanTests if this user can delete persons.booleanTests if this user can manageIdaliases forPersons.booleanTests if this user can update persons.createPerson(PersonForm personForm) Creates a newPerson.voiddeletePerson(Id personId) Deletes aPerson.getPersonFormForCreate(Type[] personRecordTypes) Gets the person form for creating new persons.getPersonFormForUpdate(Id personId) Gets the person form for updating an existing person.getRealm()Gets theRealmassociated with this session.Gets theRealmIdassociated with this session.voidupdatePerson(PersonForm personForm) Updates an existing person.
-
Method Details
-
getPersonFormsForCreate
PersonBatchFormList getPersonFormsForCreate(long number, Type[] personRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the person forms for creating a bunch of new persons.- Parameters:
number- the number of forms to retrievepersonRecordTypes- array of person record types to be included in each create operation or an empty list if none- Returns:
- the person forms
- Throws:
NullArgumentException-personRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createPersons
CreateResponseList createPersons(PersonBatchFormList personForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofPersons. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
personForms- the person forms- Returns:
- the create responses
- Throws:
NullArgumentException-personFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPersonFormsForUpdate
PersonBatchFormList getPersonFormsForUpdate(IdList personIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the person forms for updating an existing set of persons. A new person form should be requested for each update transaction.- Parameters:
personIds- theIdsof thePerson- Returns:
- the person form
- Throws:
NotFoundException- apersonIdis not foundNullArgumentException-personIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePersons
UpdateResponseList updatePersons(PersonBatchFormList personForms) throws OperationFailedException, PermissionDeniedException Updates existing persons. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
personForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-personFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllPersons
Deletes allPersonsin thisRealm.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePersons
DeleteResponseList deletePersons(IdList personIds) throws OperationFailedException, PermissionDeniedException Deletes persons for the givenIds.- Parameters:
personIds- theIdsof the persons to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-personIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasPersons
AliasResponseList aliasPersons(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aPersonfor the purpose of creating compatibility. The primaryIdof thePersonis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another person, it is reassigned to the given personId.- 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.
-