Interface IntersectionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, IntersectionAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Intersections 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
Intersection , an IntersectionForm is requested using
getIntersectionFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the
returned IntersectionForms 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 IntersectionForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each IntersectionForm
corresponds to an attempted transaction.
The IntersectionForms returned from
getIntersectionFormsForCreate() may be linked to the originating request
through the peer Ids of the IntersectionForm . In the case
where there may be duplicates, any IntersectionForm of the same
peer Ids may be used for a create operation.
Once a batch of IntersectionForms are submitted for create, a
CreateResponse is returned for each IntersectionForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createIntersections() ,
errors specific to an individual IntersectionForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating IntersectionForm through the
IntersectionForm Id .
For updates, IntersectionForms are requested to the
Intersection Id that is to be updated using
getIntersectionFormsForUpdate() where the reference Id in the
IntersectionForm may be used to link the request. Similarly, the
IntersectionForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
IntersectionForm can only be used once for a successful update and cannot
be reused.
Once a batch of IntersectionForms are submitted for update, an
UpdateResponse is returned for each IntersectionForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateIntersections() ,
errors specific to an individual IntersectionForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating IntersectionForm through the
IntersectionForm Id .
The delete operations delete Intersections in bulk. To unmap
an Intersection from the current Map , the
IntersectionMapAssignmentSession should be used. These delete operations
attempt to remove the Intersection itself thus removing it from
all known Map catalogs. Bulk delete operations return the results
in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasIntersections(AliasRequestList aliasRequests) Adds anIdto anIntersectionfor the purpose of creating compatibility.createIntersections(IntersectionBatchFormList intersectionForms) Creates a new set ofIntersections.Deletes allIntersectionsin thisMap.deleteIntersections(IdList intersectionIds) Deletes intersections for the givenIds.getIntersectionFormsForCreate(IntersectionPathList paths, Type[] intersectionRecordTypes) Gets the intersection forms for creating a bunch of new intersections.getIntersectionFormsForUpdate(IdList intersectionIds) Gets the intersection forms for updating an existing set of intersections.updateIntersections(IntersectionBatchFormList intersectionForms) Updates existing intersections.Methods inherited from interface IntersectionAdminSession
addPathToIntersection, aliasIntersection, canCreateIntersections, canCreateIntersectionWithRecordTypes, canDeleteIntersections, canManageIntersectionAliases, canUpdateIntersection, canUpdateIntersections, createIntersection, deleteIntersection, getIntersectionFormForCreate, getIntersectionFormForUpdate, getMap, getMapId, removePathFromIntersection, updateIntersectionModifier and TypeMethodDescriptionvoidaddPathToIntersection(Id intersectionId, Id pathId) Adds a path to an existing intersection.voidaliasIntersection(Id intersectionId, Id aliasId) Adds anIdto anIntersectionfor the purpose of creating compatibility.booleanTests if this user can createIntersections.booleancanCreateIntersectionWithRecordTypes(Type[] intersectionRecordTypes) Tests if this user can create a singleIntersectionusing the desired record types.booleanTests if this user can deleteIntersections.booleanTests if this user can manageIdaliases forIntersections.booleancanUpdateIntersection(Id intersectionId) Tests if this user can update a specifiedIntersection.booleanTests if this user can updateIntersections.createIntersection(IntersectionForm intersectionForm) Creates a newIntersection.voiddeleteIntersection(Id intersectionId) Deletes anIntersection.getIntersectionFormForCreate(Id[] pathIds, Type[] intersectionRecordTypes) Gets the intersection form for creating new intersections.getIntersectionFormForUpdate(Id intersectionId) Gets the intersection form for updating an existing intersection.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.voidremovePathFromIntersection(Id intersectionId, Id pathId) Removes a path from an existing intersection.voidupdateIntersection(IntersectionForm intersectionForm) Updates an existing intersection.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
-
getIntersectionFormsForCreate
IntersectionBatchFormList getIntersectionFormsForCreate(IntersectionPathList paths, Type[] intersectionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the intersection forms for creating a bunch of new intersections.- Parameters:
paths- the list of paths for the intersectionsintersectionRecordTypes- array of intersection record types to be included in each create operation or an empty list if none- Returns:
- the intersection forms
- Throws:
NotFoundException- apathIdis not foundNullArgumentException-pathsorintersectionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createIntersections
CreateResponseList createIntersections(IntersectionBatchFormList intersectionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofIntersections. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
intersectionForms- the intersection forms- Returns:
- the create responses
- Throws:
NullArgumentException-intersectionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getIntersectionFormsForUpdate
IntersectionBatchFormList getIntersectionFormsForUpdate(IdList intersectionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the intersection forms for updating an existing set of intersections. A new intersection form should be requested for each update transaction.- Parameters:
intersectionIds- theIdsof theIntersection- Returns:
- the intersection forms
- Throws:
NotFoundException- anintersectionIdis not foundNullArgumentException-intersectionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateIntersections
UpdateResponseList updateIntersections(IntersectionBatchFormList intersectionForms) throws OperationFailedException, PermissionDeniedException Updates existing intersections. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
intersectionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-intersectionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllIntersections
DeleteResponseList deleteAllIntersections() throws OperationFailedException, PermissionDeniedExceptionDeletes allIntersectionsin thisMap.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIntersections
DeleteResponseList deleteIntersections(IdList intersectionIds) throws OperationFailedException, PermissionDeniedException Deletes intersections for the givenIds.- Parameters:
intersectionIds- theIdsof the intersections to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-intersectionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasIntersections
AliasResponseList aliasIntersections(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anIntersectionfor the purpose of creating compatibility. The primaryIdof theIntersectionis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another intersection, it is reassigned to the given intersectionId.- 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.
-