Interface OfficeBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OfficeAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Offices 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
Office , an OfficeForm is requested using
getOfficeFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
OfficeForms 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 OfficeForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each OfficeForm corresponds to an attempted
transaction.
The OfficeForms returned from
getOfficeFormsForCreate() may be linked to the originating request
through the peer Ids of the OfficeForm . In the case where
there may be duplicates, any OfficeForm of the same peer
Ids may be used for a create operation.
Once a batch of OfficeForms are submitted for create, a
CreateResponse is returned for each OfficeForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createOffices() , errors specific to
an individual OfficeForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
OfficeForm through the OfficeForm Id .
For updates, OfficeForms are requested to the Office
Id that is to be updated using getOfficeFormsForUpdate()
where the reference Id in the OfficeForm may be used to
link the request. Similarly, the OfficeForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The OfficeForm can only be used once for a successful
update and cannot be reused.
Once a batch of OfficeForms are submitted for update, an
UpdateResponse is returned for each OfficeForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateOffices() , errors specific to
an individual OfficeForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
OfficeForm through the OfficeForm Id .
The delete operations delete Offices in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasOffices(AliasRequestList aliasRequests) Adds anIdto anOfficefor the purpose of creating compatibility.createOffices(OfficeBatchFormList officeForms) Creates a new set ofOffices.Deletes allOffices.deleteOffices(IdList officeIds) Deletes offices for the givenIds.getOfficeFormsForCreate(long number, Type[] officeRecordTypes) Gets the office forms for creating a bunch of new offices.getOfficeFormsForUpdate(IdList officeIds) Gets the office forms for updating an existing set of offices.updateOffices(OfficeBatchFormList officeForms) Updates existing offices.Methods inherited from interface OfficeAdminSession
aliasOffice, canCreateOffices, canCreateOfficeWithRecordTypes, canDeleteOffices, canManageOfficeAliases, canUpdateOffices, createOffice, deleteOffice, getOfficeFormForCreate, getOfficeFormForUpdate, updateOfficeModifier and TypeMethodDescriptionvoidaliasOffice(Id officeId, Id aliasId) Adds anIdto anOfficefor the purpose of creating compatibility.booleanTests if this user can createOffices.booleancanCreateOfficeWithRecordTypes(Type[] officeRecordTypes) Tests if this user can create a singleOfficeusing the desired record types.booleanTests if this user can deleteOffices.booleanTests if this user can manageIdaliases forOffices.booleanTests if this user can updateOffices.createOffice(OfficeForm officeForm) Creates a newOffice.voiddeleteOffice(Id officeId) Deletes anOffice.getOfficeFormForCreate(Type[] officeRecordTypes) Gets the office form for creating new offices.getOfficeFormForUpdate(Id officeId) Gets the office form for updating an existing office.voidupdateOffice(OfficeForm officeForm) Updates an existing officeMethods 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
-
getOfficeFormsForCreate
OfficeBatchFormList getOfficeFormsForCreate(long number, Type[] officeRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the office forms for creating a bunch of new offices.- Parameters:
number- the number of forms to retrieveofficeRecordTypes- array of office record types to be included in each create operation or an empty list if none- Returns:
- the office forms
- Throws:
NullArgumentException-officeRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createOffices
CreateResponseList createOffices(OfficeBatchFormList officeForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofOffices. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
officeForms- the office forms- Returns:
- the create responses
- Throws:
NullArgumentException-officeFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOfficeFormsForUpdate
OfficeBatchFormList getOfficeFormsForUpdate(IdList officeIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the office forms for updating an existing set of offices. A new office form should be requested for each update transaction.- Parameters:
officeIds- theIdsof theOffice- Returns:
- the office form
- Throws:
NotFoundException- anofficeIdis not foundNullArgumentException-officeIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateOffices
UpdateResponseList updateOffices(OfficeBatchFormList officeForms) throws OperationFailedException, PermissionDeniedException Updates existing offices. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
officeForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-officeFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllOffices
Deletes allOffices.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOffices
DeleteResponseList deleteOffices(IdList officeIds) throws OperationFailedException, PermissionDeniedException Deletes offices for the givenIds.- Parameters:
officeIds- theIdsof the offices to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-officeIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasOffices
AliasResponseList aliasOffices(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anOfficefor the purpose of creating compatibility. The primaryIdof theOfficeis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another office, it is reassigned to the given officeId.- 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.
-