public class GraphHelper
extends java.lang.Object
GraphQuery
implementations for reuse.Constructor and Description |
---|
GraphHelper(Helper helper,
ome.services.graphs.GraphPathBean graphPathBean)
Construct a helper for a graph request instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkIsAdministrator(ome.model.enums.AdminPrivilege requiredPrivilege)
Check if the current user is an administrator.
|
java.util.Set<java.lang.Class<? extends ome.model.IObject>> |
getClassesFromNames(java.util.Collection<java.lang.String> classNames)
Given class names provided by the user, find the corresponding set of actual classes.
|
com.google.common.collect.SetMultimap<java.lang.String,java.lang.Long> |
getTargetMultimap(java.util.Set<java.lang.Class<? extends ome.model.IObject>> legalClasses,
java.util.Map<java.lang.String,java.util.List<java.lang.Long>> targetObjects)
Converts the Ice
StringLongListMap to a multimap. |
java.util.Set<java.lang.String> |
getTargetSet(java.util.Set<java.lang.Class<? extends ome.model.IObject>> legalClasses,
java.util.Collection<java.lang.String> targetClasses)
Converts the Ice
StringSet to a set. |
java.util.Set<java.lang.String> |
getTopLevelNames(java.lang.Iterable<java.lang.Class<? extends ome.model.IObject>> modelClasses)
Get the simple names of the top-level superclasses of the given classes.
|
ome.services.graphs.GraphTraversal |
prepareGraphTraversal(java.util.List<ChildOption> childOptions,
java.util.Set<ome.services.graphs.GraphPolicy.Ability> requiredPermissions,
ome.services.graphs.GraphPolicy graphPolicy,
java.lang.Iterable<java.util.function.Function<ome.services.graphs.GraphPolicy,ome.services.graphs.GraphPolicy>> graphPolicyAdjusters,
ome.security.ACLVoter aclVoter,
ome.services.graphs.GraphPathBean graphPathBean,
com.google.common.collect.SetMultimap<java.lang.String,java.lang.String> unnullable,
ome.services.graphs.GraphTraversal.Processor processor,
boolean dryRun)
Construct a graph traversal manager for a
GraphQuery request. |
void |
publishEventLog(org.springframework.context.ApplicationContext context,
java.lang.String action,
java.lang.String className,
java.util.Collection<java.lang.Long> ids)
Publish database changes to the event log.
|
public GraphHelper(Helper helper, ome.services.graphs.GraphPathBean graphPathBean)
helper
- the general request helper for the graph request instancegraphPathBean
- the graph path beanpublic boolean checkIsAdministrator(ome.model.enums.AdminPrivilege requiredPrivilege)
requiredPrivilege
- the privilege that the administrator must have if they are a light administratorpublic java.util.Set<java.lang.Class<? extends ome.model.IObject>> getClassesFromNames(java.util.Collection<java.lang.String> classNames)
classNames
- names of model object classespublic ome.services.graphs.GraphTraversal prepareGraphTraversal(java.util.List<ChildOption> childOptions, java.util.Set<ome.services.graphs.GraphPolicy.Ability> requiredPermissions, ome.services.graphs.GraphPolicy graphPolicy, java.lang.Iterable<java.util.function.Function<ome.services.graphs.GraphPolicy,ome.services.graphs.GraphPolicy>> graphPolicyAdjusters, ome.security.ACLVoter aclVoter, ome.services.graphs.GraphPathBean graphPathBean, com.google.common.collect.SetMultimap<java.lang.String,java.lang.String> unnullable, ome.services.graphs.GraphTraversal.Processor processor, boolean dryRun)
GraphQuery
request.childOptions
- the child options set on the requestrequiredPermissions
- the abilities that the user must have to operate upon an object for it to be includedgraphPolicy
- the graph policy for the requestgraphPolicyAdjusters
- the adjusters to be applied to the graph policyaclVoter
- ACL voter for permissions checkinggraphPathBean
- the graph path beanunnullable
- properties that, while nullable, may not be nulled by a graph traversal operationprocessor
- how to operate on the resulting target object graphdryRun
- if the request should skip the actual model object updatespublic java.util.Set<java.lang.String> getTargetSet(java.util.Set<java.lang.Class<? extends ome.model.IObject>> legalClasses, java.util.Collection<java.lang.String> targetClasses)
StringSet
to a set.legalClasses
- legal target object classestargetClasses
- the actual target object classesome.conditions.InternalException
- if any of the target classes are illegalpublic com.google.common.collect.SetMultimap<java.lang.String,java.lang.Long> getTargetMultimap(java.util.Set<java.lang.Class<? extends ome.model.IObject>> legalClasses, java.util.Map<java.lang.String,java.util.List<java.lang.Long>> targetObjects)
StringLongListMap
to a multimap.legalClasses
- legal target object classestargetObjects
- the model objects to processome.conditions.InternalException
- if any of the target object classes are illegalpublic java.util.Set<java.lang.String> getTopLevelNames(java.lang.Iterable<java.lang.Class<? extends ome.model.IObject>> modelClasses)
modelClasses
- some model classespublic void publishEventLog(org.springframework.context.ApplicationContext context, java.lang.String action, java.lang.String className, java.util.Collection<java.lang.Long> ids)
context
- the context for publishing the application eventaction
- the name of the change actionclassName
- the class of objects that were changedids
- the IDs of the objects that were changed