|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.graphs.GraphState
public class GraphState
Tree-structure containing all scheduled deletes which closely resembles the
tree structure of the GraphSpec
itself. All ids of the intended
deletes will be collected in a preliminary phase. This is necessary since
intermediate deletes, may disconnect the graph, causing later deletes to fail
if they were solely based on the id of the root element.
The GraphState
instance can only be initialized with a graph of
initialized s.
To handle SOFT requirements, each new attempt to delete either a node or a
leaf in the subgraph is surrounded by a savepoint. Ids added during a
savepoint (or a sub-savepoint) or only valid until release is called, at
which time they are merged into the final view.
Constructor Summary | |
---|---|
GraphState(GraphStepFactory factory,
ome.util.SqlAction sql,
org.hibernate.Session session,
GraphSpec spec)
|
Method Summary | |
---|---|
void |
add()
|
int |
collapse(boolean keep)
|
Iterable<Map.Entry<String,Set<Long>>> |
entrySet()
|
String |
execute(int j)
|
Class<ome.model.IObject> |
getClass(String key)
|
Set<Long> |
getProcessedIds(String table)
Get the set of ids which were actually processed. |
long |
getTotalFoundCount()
Return the total number of ids loaded into this instance. |
long |
getTotalProcessedCount()
Return the total number of ids which were processed. |
static void |
permissionsClause(EventContext ec,
QueryBuilder qb)
Appends a clause to the QueryBuilder based on the current user. |
void |
release(String savepoint,
int count)
|
void |
rollback(String savepoint,
int count)
|
void |
savepoint(String savepoint)
|
int |
size()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GraphState(GraphStepFactory factory, ome.util.SqlAction sql, org.hibernate.Session session, GraphSpec spec) throws GraphException
ctx
- Stored the OmeroContext
instance for raising event
during #release(String)
session
- non-null, active Hibernate session that will be used to delete
all necessary items as well as lookup items for deletion.
GraphException
Method Detail |
---|
public long getTotalFoundCount()
public long getTotalProcessedCount()
public Set<Long> getProcessedIds(String table)
#addAll(String, Class, List)
public String execute(int j) throws GraphException
step
- which step is to be invoked. Running a step multiple times is
not supported.
GraphException
- Any errors which were caused during execution. Which
execution states may be encountered is strongly tied to the
definition of the specification and to the options which are
passed in during initialization.public static void permissionsClause(EventContext ec, QueryBuilder qb)
QueryBuilder
based on the current user.
If the user is an admin like root, then nothing is appened, and any
delete is permissible. If the user is a leader of the current group, then
the object must be in the current group. Otherwise, the object must
belong to the current user.
public Class<ome.model.IObject> getClass(String key)
getClass
in interface GraphStep.Callback
public void add()
add
in interface GraphStep.Callback
public int size()
size
in interface GraphStep.Callback
public Iterable<Map.Entry<String,Set<Long>>> entrySet()
entrySet
in interface GraphStep.Callback
public int collapse(boolean keep)
collapse
in interface GraphStep.Callback
public void savepoint(String savepoint)
savepoint
in interface GraphStep.Callback
public void release(String savepoint, int count) throws GraphException
release
in interface GraphStep.Callback
GraphException
public void rollback(String savepoint, int count) throws GraphException
rollback
in interface GraphStep.Callback
GraphException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.4-dbcbce5a-b4
Copyright © 2009 The University of Dundee. All Rights Reserved.