Interface EffortBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, EffortAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Efforts 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
Effort , an EffortForm is requested using
getEffortFormsForCreate() specifying the desired commission, resource,
record Types or none if no record Types are needed. Each
of the returned EffortForms 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 EffortForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each EffortForm corresponds
to an attempted transaction.
The EffortForms returned from
getEffortFormsForCreate() may be linked to the originating request
through the peer Ids of the EffortForm . In the case where
there may be duplicates, any EffortForm of the same peer
Ids may be used for a create operation.
Once a batch of EffortForms are submitted for create, a
CreateResponse is returned for each EffortForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createEfforts() , errors specific to
an individual EffortForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
EffortForm through the EffortForm Id .
For updates, EffortForms are requested to the Effort
Id that is to be updated using getEffortFormsForUpdate()
where the reference Id in the EffortForm may be used to
link the request. Similarly, the EffortForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The EffortForm can only be used once for a successful
update and cannot be reused.
Once a batch of EffortForms are submitted for update, an
UpdateResponse is returned for each EffortForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateEfforts() , errors specific to
an individual EffortForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
EffortForm through the EffortForm Id .
The delete operations delete Efforts in bulk. To unmap an
Effort from the current Foundry , the
EffortFoundryAssignmentSession should be used. These delete operations
attempt to remove the Effort itself thus removing it from all
known Foundry catalogs. Bulk delete operations return the results
in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasEfforts(AliasRequestList aliasRequests) Adds anIdto anEffortfor the purpose of creating compatibility.createEfforts(EffortBatchFormList effortForms) Creates a new set ofEfforts.Deletes allEffortsin thisFoundry.deleteEfforts(IdList effortIds) Deletes efforts for the givenIds.deleteEffortsForCommission(Id commissionId) Deletes efforts for the given commission.deleteEffortsForResource(Id resourceId) Deletes efforts for the given resource.Deletes efforts expired before the given date.getEffortFormsForCreate(EffortPeerList peers, Type[] effortRecordTypes) Gets the effort forms for creating a bunch of new efforts.getEffortFormsForUpdate(IdList effortIds) Gets the effort forms for updating an existing set of efforts.updateEfforts(EffortBatchFormList effortForms) Updates existing efforts.Methods inherited from interface EffortAdminSession
aliasEffort, canCreateEfforts, canCreateEffortWithRecordTypes, canDeleteEfforts, canManageEffortAliases, canUpdateEfforts, createEffort, deleteEffort, getEffortFormForCreate, getEffortFormForUpdate, getFoundry, getFoundryId, updateEffortModifier and TypeMethodDescriptionvoidaliasEffort(Id effortId, Id aliasId) Adds anIdto anEffortfor the purpose of creating compatibility.booleanTests if this user can createEfforts.booleancanCreateEffortWithRecordTypes(Type[] effortRecordTypes) Tests if this user can create a singleEffortusing the desired record types.booleanTests if this user can deleteEfforts.booleanTests if this user can manageIdaliases forEfforts.booleanTests if this user can updateEfforts.createEffort(EffortForm effortForm) Creates a newEffort.voiddeleteEffort(Id effortId) Deletes anEffort.getEffortFormForCreate(Id resourceId, Id commissionId, Type[] effortRecordTypes) Gets the effort form for creating new efforts.getEffortFormForUpdate(Id effortId) Gets the effort form for updating an existing effort.Gets theFoundryassociated with this session.Gets theFoundryIdassociated with this session.voidupdateEffort(EffortForm effortForm) Updates an existing effort.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
-
getEffortFormsForCreate
EffortBatchFormList getEffortFormsForCreate(EffortPeerList peers, Type[] effortRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the effort forms for creating a bunch of new efforts. A form is returned for each commission and resource pair.- Parameters:
peers- the relationship peerseffortRecordTypes- array of effort record types to be included in each create operation or an empty list if none- Returns:
- the effort forms
- Throws:
NotFoundException- acommissionIdorresourceIdis not foundNullArgumentException-peersoreffortRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createEfforts
CreateResponseList createEfforts(EffortBatchFormList effortForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofEfforts. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
effortForms- the effort forms- Returns:
- the create responses
- Throws:
NullArgumentException-effortFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getEffortFormsForUpdate
EffortBatchFormList getEffortFormsForUpdate(IdList effortIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the effort forms for updating an existing set of efforts. A new effort form should be requested for each update transaction.- Parameters:
effortIds- theIdsof theEffort- Returns:
- the effort form
- Throws:
NotFoundException- aneffortIdis not foundNullArgumentException-effortIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEfforts
UpdateResponseList updateEfforts(EffortBatchFormList effortForms) throws OperationFailedException, PermissionDeniedException Updates existing efforts. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
effortForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-effortFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllEfforts
Deletes allEffortsin thisFoundry.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEfforts
DeleteResponseList deleteEfforts(IdList effortIds) throws OperationFailedException, PermissionDeniedException Deletes efforts for the givenIds.- Parameters:
effortIds- theIdsof the efforts to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-effortIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEffortsForResource
DeleteResponseList deleteEffortsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes efforts for the given resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEffortsForCommission
DeleteResponseList deleteEffortsForCommission(Id commissionId) throws OperationFailedException, PermissionDeniedException Deletes efforts for the given commission.- Parameters:
commissionId- anIdof a commission- Returns:
- the delete responses
- Throws:
NullArgumentException-commissionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveEffortsByDate
DeleteResponseList deleteIneffectiveEffortsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes efforts 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.
-
aliasEfforts
AliasResponseList aliasEfforts(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anEffortfor the purpose of creating compatibility. The primaryIdof theEffortis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another effort, it is reassigned to the given effortId.- 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.
-