Interface EdgeBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, EdgeAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Edges 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
Edge , an EdgeForm is requested using
getEdgeFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
EdgeForms 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
EdgeForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each EdgeForm corresponds to an attempted transaction.
The EdgeForms returned from getEdgeFormsForCreate()
may be linked to the originating request through the peer Ids of
the EdgeForm . In the case where there may be duplicates, any
EdgeForm of the same peer Ids may be used for a create
operation.
Once a batch of EdgeForms are submitted for create, a
CreateResponse is returned for each EdgeForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createEdges() , errors specific to an
individual EdgeForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
EdgeForm through the EdgeForm Id .
For updates, EdgeForms are requested to the Edge
Id that is to be updated using getEdgeFormsForUpdate()
where the reference Id in the EdgeForm may be used to link
the request. Similarly, the EdgeForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The EdgeForm can only be used once for a successful update
and cannot be reused.
Once a batch of EdgeForms are submitted for update, an
UpdateResponse is returned for each EdgeForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateEdges() , errors specific to an
individual EdgeForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
EdgeForm through the EdgeForm Id .
The delete operations delete Edges in bulk. To unmap an
Edge from the current Graph , the
EdgeGraphAssignmentSession should be used. These delete operations
attempt to remove the Edge itself thus removing it from all known
Graph catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasEdges(AliasRequestList aliasRequests) Adds anIdto anEdgefor the purpose of creating compatibility.createEdges(EdgeBatchFormList edgeForms) Creates a new set ofEdges.Deletes allEdgesin thisGraph.deleteEdges(IdList edgeIds) Deletes edges for the givenIds.deleteEdgesForDestinationNode(Id destinationNodeId) Deletes edges for the given destination node.deleteEdgesForSourceNode(Id sourceNodeId) Deletes edges for the given source node.Deletes edges ineffective before the given date.getEdgeFormsForCreate(EdgePeerList peers, Type[] edgeRecordTypes) Gets the edge forms for creating a bunch of new edges.getEdgeFormsForUpdate(IdList edgeIds) Gets the edge forms for updating an existing set of edges.updateEdges(EdgeBatchFormList edgeForms) Updates existing edges.Methods inherited from interface EdgeAdminSession
aliasEdge, canCreateEdges, canCreateEdgeWithRecordTypes, canDeleteEdges, canManageEdgeAliases, canUpdateEdges, createEdge, deleteEdge, getEdgeFormForCreate, getEdgeFormForUpdate, getGraph, getGraphId, updateEdgeModifier and TypeMethodDescriptionvoidAdds anIdto anEdgefor the purpose of creating compatibility.booleanTests if this user can createEdges.booleancanCreateEdgeWithRecordTypes(Type[] edgeRecordTypes) Tests if this user can create a singleEdgeusing the desired record types.booleanTests if this user can deleteEdges.booleanTests if this user can manageIdaliases for edges.booleanTests if this user can updateEdges.createEdge(EdgeForm edgeForm) Creates a newEdge.voiddeleteEdge(Id edgeId) Deletes anEdge.getEdgeFormForCreate(Id sourceNodeId, Id destinationNodeId, Type[] edgeRecordTypes) Gets the edge form for creating new edges.getEdgeFormForUpdate(Id edgeId) Gets the edge form for updating an existing edge.getGraph()Gets theGraphassociated with this session.Gets theGraphIdassociated with this session.voidupdateEdge(EdgeForm edgeForm) Updates an existing edge.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
-
getEdgeFormsForCreate
EdgeBatchFormList getEdgeFormsForCreate(EdgePeerList peers, Type[] edgeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the edge forms for creating a bunch of new edges. A form is returned for each set of edge peers.- Parameters:
peers- a list of edge peersedgeRecordTypes- array of edge record types to be included in each create operation or an empty list if none- Returns:
- the edge forms
- Throws:
NotFoundException- a node is not foundNullArgumentException-peersoredgeRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createEdges
CreateResponseList createEdges(EdgeBatchFormList edgeForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofEdges. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
edgeForms- the edge forms- Returns:
- the create responses
- Throws:
NullArgumentException-edgeFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getEdgeFormsForUpdate
EdgeBatchFormList getEdgeFormsForUpdate(IdList edgeIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the edge forms for updating an existing set of edges. A new edge form should be requested for each update transaction.- Parameters:
edgeIds- theIdsof theEdge- Returns:
- the edge form
- Throws:
NotFoundException- anedgeIdis not foundNullArgumentException-edgeIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEdges
UpdateResponseList updateEdges(EdgeBatchFormList edgeForms) throws OperationFailedException, PermissionDeniedException Updates existing edges. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
edgeForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-edgeFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllEdges
Deletes allEdgesin thisGraph.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEdges
DeleteResponseList deleteEdges(IdList edgeIds) throws OperationFailedException, PermissionDeniedException Deletes edges for the givenIds.- Parameters:
edgeIds- theIdsof the edges to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-edgeIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEdgesForSourceNode
DeleteResponseList deleteEdgesForSourceNode(Id sourceNodeId) throws OperationFailedException, PermissionDeniedException Deletes edges for the given source node.- Parameters:
sourceNodeId- theIdof a node- Returns:
- the delete responses
- Throws:
NullArgumentException-sourceNodeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteEdgesForDestinationNode
DeleteResponseList deleteEdgesForDestinationNode(Id destinationNodeId) throws OperationFailedException, PermissionDeniedException Deletes edges for the given destination node.- Parameters:
destinationNodeId- theIdof a node- Returns:
- the delete responses
- Throws:
NullArgumentException-destinationNodeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveEdgesByDate
DeleteResponseList deleteIneffectiveEdgesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes edges ineffective 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.
-
aliasEdges
AliasResponseList aliasEdges(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anEdgefor the purpose of creating compatibility. The primaryIdof theEdgeis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another edge, it is reassigned to the given edgeId.- 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.
-