|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.delete.DeleteState
public class DeleteState
Tree-structure containing all scheduled deletes which closely resembles the
tree structure of the DeleteSpec
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 DeleteState
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.
IDelete
,
ticket:3031
,
ticket:3032
Constructor Summary | |
---|---|
DeleteState(OmeroContext ctx,
org.hibernate.Session session,
DeleteSpec spec)
|
Method Summary | |
---|---|
String |
execute(int j)
|
Set<Long> |
getDeletedsIds(String table)
Get the set of ids which were actually deleted. |
long |
getTotalDeletedCount()
Return the total number of ids which were deleted. |
long |
getTotalFoundCount()
Return the total number of ids loaded into this instance. |
static void |
permissionsClause(EventContext ec,
QueryBuilder qb)
Appends a clause to the QueryBuilder based on the current user. |
void |
release(DeleteStep step)
|
void |
rollback(DeleteStep step)
|
String |
savepoint(DeleteStep step)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DeleteState(OmeroContext ctx, org.hibernate.Session session, DeleteSpec spec) throws DeleteException
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.
DeleteException
Method Detail |
---|
public long getTotalFoundCount()
public long getTotalDeletedCount()
public Set<Long> getDeletedsIds(String table)
#addAll(String, Class, List)
public String execute(int j) throws DeleteException
step
- which step is to be invoked. Running a step multiple times is
not supported.
DeleteException
- 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 String savepoint(DeleteStep step)
public void release(DeleteStep step) throws DeleteException
DeleteException
public void rollback(DeleteStep step) throws DeleteException
DeleteException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta4.2.1-r8614-Beta4.2-b41
Copyright © 2009 The University of Dundee. All Rights Reserved.