public interface PathAdminSession extends OsidSession
This session creates, updates, and deletes Paths. 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
gePathFormForCreate() specifying desired record Types
or none if no record Types are needed. The returned
PathForm 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 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.
For updates, PathForms are requested to the Path
Id that is to be updated using
getPathFormForUpdate(). 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.
The delete operations delete P{aths. To unmap a
Path from the current Graph, the
PathGraphAssignmentSession should be used. These delete operations
attempt to remove the Path 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 |
addEdge(Id pathId,
Id edgeId)
Adds an edge to a path.
|
void |
addEdges(Id pathId,
IdList edgeIds)
Adds edges to a path.
|
void |
aliasPath(Id pathId,
Id aliasId)
Adds an
Id to a Path for the purpose of
creating compatibility. |
boolean |
canCreatePaths()
Tests if this user can create
Paths. |
boolean |
canCreatePathWithRecordTypes(Type[] pathRecordTypes)
Tests if this user can create a single
Path using the
desired record types. |
boolean |
canDeletePaths()
Tests if this user can delete
Paths. |
boolean |
canManagePathAliases()
Tests if this user can manage
Id aliases for
Paths. |
boolean |
canUpdatePaths()
Tests if this user can update
Paths. |
Path |
createPath(PathForm pathForm)
Creates a new
Path. |
void |
deletePath(Id pathId)
Deletes a
Path. |
Graph |
getGraph()
Gets the
Graph associated with this session. |
Id |
getGraphId()
Gets the
Graph Id associated with this
session. |
PathForm |
getPathFormForCreate(Id startingNodeId,
Id endingNodeId,
Type[] pathRecordTypes)
Gets the path form for creating new paths.
|
PathForm |
getPathFormForUpdate(Id pathId)
Gets the path form for updating an existing path.
|
void |
removeEdge(Id pathId,
Id edgeId)
Removes an edge from a path.
|
void |
removeEdges(Id pathId,
IdList edgeIds)
Removes edges from a path.
|
void |
updatePath(PathForm pathForm)
Updates an existing path.
|
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 canCreatePaths()
Paths. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Path 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 Path ceration is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreatePathWithRecordTypes(Type[] pathRecordTypes)
Path using the
desired record types. While
TopologyManager.getPathRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Path. Providing an
empty array tests if a Path can be created with no
records.pathRecordTypes - array of path record types true if Path creation using the
specified record Types is supported,
false otherwiseNullArgumentException - pathRecordTypes
is null mandatory - This method must be implemented. PathForm getPathFormForCreate(Id startingNodeId, Id endingNodeId, Type[] pathRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
startingNodeId - the Id of the starting locationendingNodeId - the Id of the ending locationpathRecordTypes - array of path record typesNotFoundException - startingLocationId
or endingLocationId is not foundNullArgumentException - startingLocationId,
endingLocationId, or pathRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Path createPath(PathForm pathForm) throws OperationFailedException, PermissionDeniedException
Path. pathForm - the form for this Path Path IllegalStateException - pathForm already
used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - pathForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - pathForm did not
originate from getPathFormForCreate() mandatory - This method must be implemented. boolean canUpdatePaths()
Paths. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Path 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 Path modification is
not authorized, true otherwisemandatory - This method must be implemented. PathForm getPathFormForUpdate(Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException
pathId - the Id of the Path NotFoundException - pathId is not foundNullArgumentException - pathId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updatePath(PathForm pathForm) throws OperationFailedException, PermissionDeniedException
pathForm - the form containing the elements to be updatedIllegalStateException - pathForm already
used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - pathForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - pathForm did not
originate from getPathFormForUpdate() mandatory - This method must be implemented. boolean canDeletePaths()
Paths. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Path 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 Path deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deletePath(Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Path. pathId - the Id of the Path to
removeNotFoundException - pathId not foundNullArgumentException - pathId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void addEdge(Id pathId, Id edgeId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
pathId - the Id of a Path edgeId - the Id of the Edge to addAlreadyExistsException - edgeId already
in pathNotFoundException - pathId or
edgeId not foundNullArgumentException - pathId or
edgeId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void addEdges(Id pathId, IdList edgeIds) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
pathId - the Id of Path edgeIds - the Ids of the Edges to
addAlreadyExistsException - edgeId already
in pathNotFoundException - pathId or an
edgeId not foundNullArgumentException - pathId or
edgeIds is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void removeEdge(Id pathId, Id edgeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
pathId - the Id of a Path edgeId - the Id of the Edge to addNotFoundException - pathId does not
contain edgeId NullArgumentException - pathId or
edgeId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void removeEdges(Id pathId, IdList edgeIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
pathId - the Id of a Path edgeIds - the list of Ids of the Edges
to addNotFoundException - pathId does not
contain an edgeId NullArgumentException - pathId or
edgeIds is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManagePathAliases()
Id aliases for
Paths. 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 Path aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasPath(Id pathId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Path for the purpose of
creating compatibility. The primary Id of the
Path is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another path, it is reassigned to the given node
Id. pathId - the Id of a Path aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - pathId not foundNullArgumentException - pathId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.