public interface EdgeAdminSession extends OsidSession
This session creates, updates, and deletes Edges. 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
geEdgeFormForCreate() specifying the nodes and
desired record Types or none if no record Types
are needed. The returned EdgeForm 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 the 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.
For updates, EdgeForms are requested to the Edge
Id that is to be updated using
getEdgeFormForUpdate(). 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.
The delete operations delete Edges. 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.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasEdge(Id edgeId,
Id aliasId)
Adds an
Id to an Edge for the purpose of
creating compatibility. |
boolean |
canCreateEdges()
Tests if this user can create
Edges. |
boolean |
canCreateEdgeWithRecordTypes(Type[] edgeRecordTypes)
Tests if this user can create a single
Edge using the
desired record types. |
boolean |
canDeleteEdges()
Tests if this user can delete
Edges. |
boolean |
canManageEdgeAliases()
Tests if this user can manage
Id aliases for edges. |
boolean |
canUpdateEdges()
Tests if this user can update
Edges. |
Edge |
createEdge(EdgeForm edgeForm)
Creates a new
Edge. |
void |
deleteEdge(Id edgeId)
Deletes an
Edge. |
EdgeForm |
getEdgeFormForCreate(Id sourceNodeId,
Id destinationNodeId,
Type[] edgeRecordTypes)
Gets the edge form for creating new edges.
|
EdgeForm |
getEdgeFormForUpdate(Id edgeId)
Gets the edge form for updating an existing edge.
|
Graph |
getGraph()
Gets the
Graph associated with this session. |
Id |
getGraphId()
Gets the
Graph Id associated with this
session. |
void |
updateEdge(EdgeForm edgeForm)
Updates an existing edge.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getGraphId()
Graph Id associated with this
session. Graph Id associated with this sessionmandatory - This method must be implemented. Graph getGraph() throws OperationFailedException, PermissionDeniedException
Graph associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateEdges()
Edges. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Edge will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false if Edge creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateEdgeWithRecordTypes(Type[] edgeRecordTypes)
Edge using the
desired record types. While
TopologyManager.getEdgeRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Edge. Providing an
empty array tests if an Edge can be created with no
records.edgeRecordTypes - array of edge record types true if Edge creation using the
specified record Types is supported,
false otherwiseNullArgumentException - edgeRecordTypes
is null mandatory - This method must be implemented. EdgeForm getEdgeFormForCreate(Id sourceNodeId, Id destinationNodeId, Type[] edgeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
sourceNodeId - the Id of the starting node.destinationNodeId - the Id of the ending node.edgeRecordTypes - array of edge record typesNotFoundException - sourceNodeId or
destinationNodeId is not foundNullArgumentException - sourceNodeId,
destinationNodeId, or edgeRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Edge createEdge(EdgeForm edgeForm) throws OperationFailedException, PermissionDeniedException
Edge. edgeForm - the form for this Edge Edge IllegalStateException - edgeForm already
used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - edgeForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - edgeForm did not
originate from getEdgeFormForCreate() mandatory - This method must be implemented. boolean canUpdateEdges()
Edges. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Edge will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false if Edge modification is
not authorized, true otherwisemandatory - This method must be implemented. EdgeForm getEdgeFormForUpdate(Id edgeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
edgeId - the Id of the Edge NotFoundException - edgeId is not foundNullArgumentException - edgeId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateEdge(EdgeForm edgeForm) throws OperationFailedException, PermissionDeniedException
edgeForm - the form containing the elements to be updatedIllegalStateException - edgeForm already
used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - edgeForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - edgeForm did not
originate from getEdgeFormForUpdate() mandatory - This method must be implemented. boolean canDeleteEdges()
Edges. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Edge will result
in a PERMISSION_DENIED. This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false if Edge deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteEdge(Id edgeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Edge. edgeId - the Id of the Edge to
removeNotFoundException - edgeId not foundNullArgumentException - edgeId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageEdgeAliases()
Id aliases for edges. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known changing an alias will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer alias operations to an
unauthorized user. false if Edge aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasEdge(Id edgeId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Edge for the purpose of
creating compatibility. The primary Id of the
Edge is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another edge, it is reassigned to the given edge
Id. edgeId - the Id of an Edge aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - edgeId not foundNullArgumentException - edgeId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.