@Deprecated public class BaseGraphSpec extends Object implements GraphSpec, org.springframework.beans.factory.BeanNameAware
GraphSpec
which takes the id of some id as the root of action.IGraph
Modifier and Type | Class and Description |
---|---|
static class |
BaseGraphSpec.SubSpecIterator
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
protected ExtendedMetadata |
em
Deprecated.
|
protected List<GraphEntry> |
entries
Deprecated.
The paths which make up this graph specification.
|
protected long |
id
Deprecated.
The id of the root type which will be processed.
|
protected Map<String,String> |
options
Deprecated.
Options passed to the
#initialize(long, Map) method, which may be
used during GraphState.execute(int) to alter behavior. |
protected String |
superspec
Deprecated.
Path of the superspec.
|
Constructor and Description |
---|
BaseGraphSpec(List<String> entries)
Deprecated.
|
BaseGraphSpec(String name,
String... entries)
Deprecated.
Simplified constructor, primarily used for testing.
|
Modifier and Type | Method and Description |
---|---|
protected org.hibernate.Query |
buildQuery(String[] sub,
GraphEntry subpath,
QueryBuilder qb,
QueryBuilder and,
org.hibernate.Session session)
Deprecated.
|
QueryBuilder |
chgrpQuery(EventContext ec,
String table,
GraphOpts opts)
Deprecated.
Return a
QueryBuilder which has been properly initialized to take the parameters "id"
and "grp" and then have QueryBuilder.query(Session) called. |
QueryBuilder |
chmodQuery(EventContext ec,
String table,
GraphOpts opts)
Deprecated.
|
protected QueryBuilder |
createQueryBuilder(String[] sub,
GraphEntry subpath)
Deprecated.
|
QueryBuilder |
deleteQuery(EventContext ec,
String table,
GraphOpts opts)
Deprecated.
|
List<GraphEntry> |
entries()
Deprecated.
Returns a copy of the list of
GraphEntry instances contained in
this GraphSpec |
Class<IObject> |
getHibernateClass(String table)
Deprecated.
Return the Hibernate type (ome.model.*) for the given table.
|
String |
getName()
Deprecated.
The name of this specification.
|
String |
getSuperSpec()
Deprecated.
Specification of where this
GraphSpec is attached under another
. |
ExperimenterGroup |
groupInfo(SqlAction sql)
Deprecated.
Like
GraphSpec.load(Session) uses the current table and id information
to look up information on the given target. |
int |
initialize(long id,
String superspec,
Map<String,String> options)
Deprecated.
Called as each action is started.
|
protected void |
join(QueryBuilder qb,
String from,
String fromAlias,
String to,
String toAlias)
Deprecated.
Used to generate a join statement on the
QueryBuilder making use
of {@link ExtendedMetadata#getRelationship(String, String). |
protected void |
joinDataset(QueryBuilder qb,
String dataset,
String fileset)
Deprecated.
|
protected void |
joinPlate(QueryBuilder qb,
String plate,
String fileset)
Deprecated.
|
IObject |
load(org.hibernate.Session session)
Deprecated.
Loads the object that this spec points to.
|
boolean |
overrideKeep()
Deprecated.
Always returns false.
|
protected long[][] |
parseResults(String[] sub,
GraphEntry subpath,
List<List<Long>> results)
Deprecated.
|
void |
permissionsClause(EventContext ec,
QueryBuilder qb,
boolean sqlQuery)
Deprecated.
Appends a clause to the
QueryBuilder based on the current user. |
void |
postProcess(org.springframework.beans.factory.ListableBeanFactory factory)
Deprecated.
Gives all specs a chance to reference subspecs.
|
long[][] |
queryBackupIds(org.hibernate.Session session,
int step,
GraphEntry subpath,
QueryBuilder and)
Deprecated.
If a given path is processed before its sub-path, this points to a
one-to-one relationship.
|
protected List<List<Long>> |
runQuery(String[] sub,
GraphEntry subpath,
org.hibernate.Query q,
org.hibernate.Session session)
Deprecated.
|
void |
setBeanName(String beanName)
Deprecated.
Set the name of the bean in the bean factory that created this bean.
|
void |
setExtendedMetadata(ExtendedMetadata em)
Deprecated.
|
String |
toString()
Deprecated.
|
Iterator<GraphSpec> |
walk()
Deprecated.
Returns an iterator over all subspecs and their subspecs, depth-first.
|
protected void |
walk(String[] sub,
GraphEntry entry,
QueryBuilder qb)
Deprecated.
Walks the parts given adding a new relationship between each.
|
protected final List<GraphEntry> entries
GraphState.execute(int)
protected ExtendedMetadata em
protected long id
protected String superspec
protected Map<String,String> options
#initialize(long, Map)
method, which may be
used during GraphState.execute(int)
to alter behavior.public BaseGraphSpec(String name, String... entries)
public void setBeanName(String beanName)
org.springframework.beans.factory.BeanNameAware
Invoked after population of normal bean properties but before an
init callback such as InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
beanName
- the name of the bean in the factory.
Note that this name is the actual bean name used in the factory, which may
differ from the originally specified name: in particular for inner bean
names, the actual bean name might have been made unique through appending
"#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String)
method to extract the original bean name (without suffix), if desired.public void setExtendedMetadata(ExtendedMetadata em)
public String getName()
GraphSpec
public String getSuperSpec()
GraphSpec
GraphSpec
is attached under another
. The reverse of
GraphEntry.getSubSpec()
.getSuperSpec
in interface GraphSpec
public Class<IObject> getHibernateClass(String table)
GraphSpec
getHibernateClass
in interface GraphSpec
public void postProcess(org.springframework.beans.factory.ListableBeanFactory factory)
GraphSpec
postProcess
in interface GraphSpec
public int initialize(long id, String superspec, Map<String,String> options) throws GraphException
GraphSpec
GraphState.execute(int)
can take clean up actions.initialize
in interface GraphSpec
id
- identifier of the root object which defines the graph to be
processed.superspec
- points to the relationship between the root object and the
current graph. In many cases, this value will be null so that
the current object is taken to be the root, but if this is a
subspec, or a non-standard naming is being used, then the
superspec will be used.options
- possibly null or empty map of options which can override the
operations provided in the definition of the specification.
For example, if the spec "/Image" defines "/Image/Annotation"
as "HARD" (the default), then the options map could contain
{"/Image/Annotation":"ORPHAN"}to modify that setting.
GraphException
public Iterator<GraphSpec> walk()
GraphSpec
public List<GraphEntry> entries()
GraphSpec
GraphEntry
instances contained in
this GraphSpec
public boolean overrideKeep()
overrideKeep
in interface GraphSpec
public IObject load(org.hibernate.Session session) throws GraphException
GraphSpec
GraphSpec.queryBackupIds(Session, int, GraphEntry, QueryBuilder)
but only returns the last element.load
in interface GraphSpec
GraphException
public ExperimenterGroup groupInfo(SqlAction sql)
GraphSpec
GraphSpec.load(Session)
uses the current table and id information
to look up information on the given target.protected QueryBuilder createQueryBuilder(String[] sub, GraphEntry subpath)
protected org.hibernate.Query buildQuery(String[] sub, GraphEntry subpath, QueryBuilder qb, QueryBuilder and, org.hibernate.Session session) throws GraphException
GraphException
protected List<List<Long>> runQuery(String[] sub, GraphEntry subpath, org.hibernate.Query q, org.hibernate.Session session)
protected long[][] parseResults(String[] sub, GraphEntry subpath, List<List<Long>> results)
public long[][] queryBackupIds(org.hibernate.Session session, int step, GraphEntry subpath, QueryBuilder and) throws GraphException
GraphSpec
#initialize(long, Map)
so that foreign key
constraints which require a higher level object to be processed first, can
be processed.
For example,
/Channel /Channel/StatsInforequires the Channel to be processed first, but without the Channel, there's no way to detect which StatsInfo should be removed. Therefore,
#backupIds
in this case would contain:
[ null, # Nothing for Channel. [1,2,3], # The ids of all StatsInfo object which should be removed. ]
queryBackupIds
in interface GraphSpec
GraphException
public QueryBuilder chgrpQuery(EventContext ec, String table, GraphOpts opts)
GraphSpec
QueryBuilder
which has been properly initialized to take the parameters "id"
and "grp" and then have QueryBuilder.query(Session)
called.chgrpQuery
in interface GraphSpec
public QueryBuilder chmodQuery(EventContext ec, String table, GraphOpts opts)
chmodQuery
in interface GraphSpec
public QueryBuilder deleteQuery(EventContext ec, String table, GraphOpts opts)
deleteQuery
in interface GraphSpec
public void permissionsClause(EventContext ec, QueryBuilder qb, boolean sqlQuery)
QueryBuilder
based on the current user.
If the user is an admin like root, then nothing is appended, and any
action 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.protected void walk(String[] sub, GraphEntry entry, QueryBuilder qb) throws GraphException
joinDataset(QueryBuilder, String, String)
and
joinPlate(QueryBuilder, String, String)
.GraphException
protected void joinDataset(QueryBuilder qb, String dataset, String fileset)
protected void joinPlate(QueryBuilder qb, String plate, String fileset)
protected void join(QueryBuilder qb, String from, String fromAlias, String to, String toAlias) throws GraphException
QueryBuilder
making use
of ExtendedMetadata#getRelationship(String, String). If the value
returned by that value is null, a {@link GraphException} will be thrown.
Otherwise something of the form:
join FROM.rel as TOwill be added to the {@link QueryBuilder}
GraphException
Version: 5.1.3-ice35-b52
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.