Interface PathBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, PathAdminSession
This session creates, updates, and deletes Paths 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
Path , a PathForm is requested using
getPathFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
PathForms 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
PathForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each PathForm corresponds to an attempted transaction.
The PathForms returned from getPathFormsForCreate()
may be linked to the originating request through the peer Ids of
the PathForm . In the case where there may be duplicates, any
PathForm of the same peer Ids may be used for a create
operation.
Once a batch of PathForms are submitted for create, a
CreateResponse is returned for each PathForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createPaths() , errors specific to an
individual PathForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
PathForm through the PathForm Id .
For updates, PathForms are requested to the Path
Id that is to be updated using getPathFormsForUpdate()
where the reference Id in the PathForm may be used to link
the request. Similarly, the PathForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The PathForm can only be used once for a successful update
and cannot be reused.
Once a batch of PathForms are submitted for update, an
UpdateResponse is returned for each PathForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updatePaths() , errors specific to an
individual PathForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
PathForm through the PathForm Id .
The delete operations delete Paths in bulk. To unmap a
Path from the current Map , the PathMapAssignmentSession
should be used. These delete operations attempt to remove the Path
itself thus removing it from all known Map catalogs. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasPaths(AliasRequestList aliasRequests) Adds anIdto aPathfor the purpose of creating compatibility.createPaths(PathBatchFormList pathForms) Creates a new set ofPaths.Deletes allPathsin thisMap.deletePaths(IdList pathIds) Deletes paths for the givenIds.getPathFormsForCreate(long number, Type[] pathRecordTypes) Gets the path forms for creating a bunch of new paths.getPathFormsForUpdate(IdList pathIds) Gets the path forms for updating an existing set of paths.updatePaths(PathBatchFormList pathForms) Updates existing paths.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 PathAdminSession
aliasPath, canCreatePaths, canCreatePathWithRecordTypes, canDeletePaths, canManagePathAliases, canUpdatePaths, createPath, deletePath, getMap, getMapId, getPathFormForCreate, getPathFormForUpdate, updatePathModifier and TypeMethodDescriptionvoidAdds anIdto aPathfor the purpose of creating compatibility.booleanTests if this user can createPaths.booleancanCreatePathWithRecordTypes(Type[] pathRecordTypes) Tests if this user can create a singlePathusing the desired record types.booleanTests if this user can deletePaths.booleanTests if this user can manageIdaliases forPaths.booleanTests if this user can updatePaths.createPath(PathForm pathForm) Creates a newPath.voiddeletePath(Id pathId) Deletes aPath.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.getPathFormForCreate(Type[] pathRecordTypes) Gets the path form for creating new paths.getPathFormForUpdate(Id pathId) Gets the path form for updating an existing path.voidupdatePath(PathForm pathForm) Updates an existing path.
-
Method Details
-
getPathFormsForCreate
PathBatchFormList getPathFormsForCreate(long number, Type[] pathRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the path forms for creating a bunch of new paths.- Parameters:
number- the number of forms to retrievepathRecordTypes- array of path record types to be included in each create operation or an empty list if none- Returns:
- the path forms
- Throws:
NullArgumentException-pathRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createPaths
CreateResponseList createPaths(PathBatchFormList pathForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofPaths. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
pathForms- the path forms- Returns:
- the create responses
- Throws:
NullArgumentException-pathFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPathFormsForUpdate
PathBatchFormList getPathFormsForUpdate(IdList pathIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the path forms for updating an existing set of paths. A new path form should be requested for each update transaction.- Parameters:
pathIds- theIdsof thePath- Returns:
- the path forms
- Throws:
NotFoundException- apathIdis not foundNullArgumentException-pathIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePaths
UpdateResponseList updatePaths(PathBatchFormList pathForms) throws OperationFailedException, PermissionDeniedException Updates existing paths. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
pathForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-pathFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllPaths
Deletes allPathsin thisMap.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deletePaths
DeleteResponseList deletePaths(IdList pathIds) throws OperationFailedException, PermissionDeniedException Deletes paths for the givenIds.- Parameters:
pathIds- theIdsof the paths to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-pathIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasPaths
AliasResponseList aliasPaths(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aPathfor the purpose of creating compatibility. The primaryIdof thePathis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another path, it is reassigned to the given pathId.- 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.
-