Interface GraphBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, GraphAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Graphs 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
Graph , a GraphForm is requested using
getGraphFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
GraphForms 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 GraphForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each GraphForm corresponds to an attempted
transaction.
The GraphForms returned from getGraphFormsForCreate()
may be linked to the originating request through the peer Ids of
the GraphForm . In the case where there may be duplicates, any
GraphForm of the same peer Ids may be used for a create
operation.
Once a batch of GraphForms are submitted for create, a
CreateResponse is returned for each GraphForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createGraph() , errors specific to an
individual GraphForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
GraphForm through the GraphForm Id .
For updates, GraphForms are requested to the Graph
Id that is to be updated using getGraphFormsForUpdate()
where the reference Id in the GraphForm may be used to
link the request. Similarly, the GraphForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The GraphForm can only be used once for a successful
update and cannot be reused.
Once a batch of GraphForms are submitted for update, an
UpdateResponse is returned for each GraphForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateGraph() , errors specific to an
individual GraphForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
GraphForm through the GraphForm Id .
The delete operations delete Graphs in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasGraphs(AliasRequestList aliasRequests) Adds anIdto aGraphfor the purpose of creating compatibility.createGraphs(GraphBatchFormList graphForms) Creates a new set ofGraphs.Deletes allGraphs.deleteGraphs(IdList graphIds) Deletes graphs for the givenIds.getGraphFormsForCreate(long number, Type[] graphRecordTypes) Gets the graph forms for creating a bunch of new graph.getGraphFormsForUpdate(IdList graphIds) Gets the graph forms for updating an existing set of graphs.updateGraphs(GraphBatchFormList graphForms) Updates existing graphs.Methods inherited from interface GraphAdminSession
aliasGraph, canCreateGraphs, canCreateGraphWithRecordTypes, canDeleteGraphs, canManageGraphAliases, canUpdateGraphs, createGraph, deleteGraph, getGraphFormForCreate, getGraphFormForUpdate, updateGraphModifier and TypeMethodDescriptionvoidaliasGraph(Id graphId, Id aliasId) Adds anIdto aGraphfor the purpose of creating compatibility.booleanTests if this user can createGraphs.booleancanCreateGraphWithRecordTypes(Type[] graphRecordTypes) Tests if this user can create a singleGraphusing the desired record types.booleanTests if this user can deleteGraphs.booleanTests if this user can manageIdaliases for graphs.booleanTests if this user can updateGraphs.createGraph(GraphForm graphForm) Creates a newGraph.voiddeleteGraph(Id graphId) Deletes aGraph.getGraphFormForCreate(Type[] graphRecordTypes) Gets the graph form for creating new graphs.getGraphFormForUpdate(Id graphId) Gets the graph form for updating an existing graph.voidupdateGraph(GraphForm graphForm) Updates an existing graphMethods 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
-
getGraphFormsForCreate
GraphBatchFormList getGraphFormsForCreate(long number, Type[] graphRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the graph forms for creating a bunch of new graph.- Parameters:
number- the number of forms to retrievegraphRecordTypes- array of graph record types to be included in each create operation or an empty list if none- Returns:
- the graph forms
- Throws:
NullArgumentException-graphRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createGraphs
CreateResponseList createGraphs(GraphBatchFormList graphForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofGraphs. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
graphForms- the graph forms- Returns:
- the create responses
- Throws:
NullArgumentException-graphFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getGraphFormsForUpdate
GraphBatchFormList getGraphFormsForUpdate(IdList graphIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the graph forms for updating an existing set of graphs. A new graph form should be requested for each update transaction.- Parameters:
graphIds- theIdsof theGraphs- Returns:
- the graph form
- Throws:
NotFoundException- agraphIdis not foundNullArgumentException-graphIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateGraphs
UpdateResponseList updateGraphs(GraphBatchFormList graphForms) throws OperationFailedException, PermissionDeniedException Updates existing graphs. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
graphForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-graphFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllGraphs
Deletes allGraphs.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteGraphs
DeleteResponseList deleteGraphs(IdList graphIds) throws OperationFailedException, PermissionDeniedException Deletes graphs for the givenIds.- Parameters:
graphIds- theIdsof the graphs to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-graphIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasGraphs
AliasResponseList aliasGraphs(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aGraphfor the purpose of creating compatibility. The primaryIdof theGraphis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another graph, it is reassigned to the given graphId.- 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.
-