Interface EdgeGraphAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Edges to
Graph objects An Edge may appear in multiple Graph
objects and removing the last reference to an Edge is the
equivalent of deleting it. Each Graph may have its own
authorizations governing who is allowed to operate on it.
Adding a reference of an Edge to another Graph is not
a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignEdgeToGraph(Id edgeId, Id graphId) Adds an existingEdgeto aGraph.booleanTests if this user can alter edge/graph mappings.booleancanAssignEdgesToGraph(Id graphId) Tests if this user can alter edge/graph mappings.getAssignableGraphIds(Id graphId) Gets a list of graphs including and under the given graph node in which any edge can be assigned.getAssignableGraphIdsForEdge(Id graphId, Id edgeId) Gets a list of graphs including and under the given graph node in which a specific edge can be assigned.voidreassignEdgeToGraph(Id edgeId, Id fromGraphId, Id toGraphId) Moves anEdgefrom oneGraphto another.voidunassignEdgeFromGraph(Id edgeId, Id graphId) Removes anEdgefrom aGraph.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
-
canAssignEdges
boolean canAssignEdges()Tests if this user can alter edge/graph mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignEdgesToGraph
Tests if this user can alter edge/graph mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
graphId- theIdof theGraph- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-graphIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableGraphIds
Gets a list of graphs including and under the given graph node in which any edge can be assigned.- Parameters:
graphId- theIdof theGraph- Returns:
- list of assignable graph
Ids - Throws:
NullArgumentException-graphIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableGraphIdsForEdge
Gets a list of graphs including and under the given graph node in which a specific edge can be assigned.- Parameters:
graphId- theIdof theGraphedgeId- theIdof theEdge- Returns:
- list of assignable graph
Ids - Throws:
NullArgumentException-graphIdoredgeIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignEdgeToGraph
void assignEdgeToGraph(Id edgeId, Id graphId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingEdgeto aGraph.- Parameters:
edgeId- theIdof theEdgegraphId- theIdof theGraph- Throws:
AlreadyExistsException-edgeIdis already assigned tographIdNotFoundException-edgeIdorgraphIdnot foundNullArgumentException-edgeIdorgraphIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignEdgeFromGraph
void unassignEdgeFromGraph(Id edgeId, Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anEdgefrom aGraph.- Parameters:
edgeId- theIdof theEdgegraphId- theIdof theGraph- Throws:
NotFoundException-edgeIdorgraphIdnot found oredgeIdnot assigned tographIdNullArgumentException-edgeIdorgraphIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignEdgeToGraph
void reassignEdgeToGraph(Id edgeId, Id fromGraphId, Id toGraphId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anEdgefrom oneGraphto another. Mappings to otherGraphsare unaffected.- Parameters:
edgeId- theIdof theEdgefromGraphId- theIdof the currentGraphtoGraphId- theIdof the destinationGraph- Throws:
AlreadyExistsException-edgeIdalready assigned totoGraphIdNotFoundException-edgeId, fromGraphId, ortoGraphIdnot found oredgeIdnot mapped tofromGraphIdNullArgumentException-edgeId, fromGraphId, ortoGraphIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-