Interface FoundryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, FoundryAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Foundries 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
Foundry , a FoundryForm is requested using
getFoundryFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
FoundryForms 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 FoundryForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each FoundryForm corresponds to an attempted
transaction.
The FoundryForms returned from
getFoundryFormsForCreate() may be linked to the originating request
through the peer Ids of the FoundryForm . In the case
where there may be duplicates, any FoundryForm of the same peer
Ids may be used for a create operation.
Once a batch of FoundryForms are submitted for create, a
CreateResponse is returned for each FoundryForm , although
the ordering is not defined. Only errors that pertain to the entire create
operation are returned from createFoundries() , errors specific to
an individual FoundryForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the
originating FoundryForm through the FoundryForm Id
.
For updates, FoundryForms are requested to the Foundry
Id that is to be updated using getFoundryFormsForUpdate()
where the reference Id in the FoundryForm may be used to
link the request. Similarly, the FoundryForm has metadata about
the data that can be updated and it can perform validation before
submitting the update. The FoundryForm can only be used once for a
successful update and cannot be reused.
Once a batch of FoundryForms are submitted for update, an
UpdateResponse is returned for each FoundryForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateFoundries() , errors specific to
an individual FoundryForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the
originating FoundryForm through the FoundryForm Id
.
The delete operations delete Foundries in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasFoundries(AliasRequestList aliasRequests) Adds anIdto aFoundryfor the purpose of creating compatibility.createFoundries(FoundryBatchFormList foundryForms) Creates a new set ofFoundries.Deletes allFoundries.deleteFoundries(IdList foundryIds) Deletes foundries for the givenIds.getFoundryFormsForCreate(long number, Type[] foundryRecordTypes) Gets the foundry forms for creating a bunch of new foundries.getFoundryFormsForUpdate(IdList foundryIds) Gets the foundry forms for updating an existing set of foundries.updateFoundries(FoundryBatchFormList foundryForms) Updates existing foundries.Methods inherited from interface FoundryAdminSession
aliasFoundry, canCreateFoundries, canCreateFoundryWithRecordTypes, canDeleteFoundries, canManageFoundryAliases, canUpdateFoundries, createFoundry, deleteFoundry, getFoundryFormForCreate, getFoundryFormForUpdate, updateFoundryModifier and TypeMethodDescriptionvoidaliasFoundry(Id foundryId, Id aliasId) Adds anIdto aFoundryfor the purpose of creating compatibility.booleanTests if this user can createFoundries.booleancanCreateFoundryWithRecordTypes(Type[] foundryRecordTypes) Tests if this user can create a singleFoundryusing the desired record types.booleanTests if this user can deleteFoundries.booleanTests if this user can manageIdaliases forFoundries.booleanTests if this user can updateFoundries.createFoundry(FoundryForm foundryForm) Creates a newFoundry.voiddeleteFoundry(Id foundryId) Deletes aFoundry.getFoundryFormForCreate(Type[] foundryRecordTypes) Gets the foundry form for creating new foundries.getFoundryFormForUpdate(Id foundryId) Gets the foundry form for updating an existing foundry.voidupdateFoundry(FoundryForm foundryForm) Updates an existing foundryMethods 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
-
getFoundryFormsForCreate
FoundryBatchFormList getFoundryFormsForCreate(long number, Type[] foundryRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the foundry forms for creating a bunch of new foundries.- Parameters:
number- the number of forms to retrievefoundryRecordTypes- array of foundry record types to be included in each create operation or an empty list if none- Returns:
- the foundry forms
- Throws:
NullArgumentException-foundryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createFoundries
CreateResponseList createFoundries(FoundryBatchFormList foundryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofFoundries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
foundryForms- the foundry forms- Returns:
- the create responses
- Throws:
NullArgumentException-foundryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFoundryFormsForUpdate
FoundryBatchFormList getFoundryFormsForUpdate(IdList foundryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the foundry forms for updating an existing set of foundries. A new foundry form should be requested for each update transaction.- Parameters:
foundryIds- theIdsof theFoundry- Returns:
- the foundry form
- Throws:
NotFoundException- afoundryIdis not foundNullArgumentException-foundryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateFoundries
UpdateResponseList updateFoundries(FoundryBatchFormList foundryForms) throws OperationFailedException, PermissionDeniedException Updates existing foundries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
foundryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-foundryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllFoundries
Deletes allFoundries.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteFoundries
DeleteResponseList deleteFoundries(IdList foundryIds) throws OperationFailedException, PermissionDeniedException Deletes foundries for the givenIds.- Parameters:
foundryIds- theIdsof the foundries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-foundryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasFoundries
AliasResponseList aliasFoundries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aFoundryfor the purpose of creating compatibility. The primaryIdof theFoundryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another foundry, it is reassigned to the given foundryId.- 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.
-