|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.rule.RuleServiceImpl
public class RuleServiceImpl
Rule service implementation.
This service automatically binds to the transaction flush hooks. It will therefore participate in any flushes that occur during the transaction as well.
| Nested Class Summary | |
|---|---|
class |
RuleServiceImpl.ExecutedRuleData
Helper class to contain the information about a rule that is executed |
| Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy |
|---|
Policy.Arg |
| Field Summary |
|---|
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeCreateChildAssociationPolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdateNodePolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy |
|---|
QNAME |
| Fields inherited from interface org.alfresco.repo.policy.Policy |
|---|
NAMESPACE |
| Constructor Summary | |
|---|---|
RuleServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef actionableNodeRef,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
Rule rule)
Add a rule to the pending execution list |
void |
addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef actionableNodeRef,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
Rule rule,
boolean executeAtEnd)
Add a rule to the pending execution list |
void |
beforeCreateChildAssociation(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
org.alfresco.service.cmr.repository.NodeRef childNodeRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
boolean isNewNode)
Cache invalidation |
int |
countRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Count the number of rules associated with an actionable node. |
void |
disableRule(Rule rule)
Disables a rule, preventing it from being fired. |
void |
disableRules()
Disable rules for the current thread |
void |
disableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Disables the rules for a given node reference. |
void |
enableRule(Rule rule)
Enables a rule previously disabled. |
void |
enableRules()
Enable rules for the current thread |
void |
enableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Enables the rules for a given node reference. |
void |
executePendingRules()
Execute all pending rules |
void |
executeRule(Rule rule,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
java.util.Set executedRules)
Execute a rule |
java.util.List |
getLinkedFromRuleNodes(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get a list of the all the rule nodes that link to the passed rule node. |
org.alfresco.service.cmr.repository.NodeRef |
getLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the node reference to the rule node which the rule node links to. |
org.alfresco.service.cmr.repository.NodeRef |
getOwningNodeRef(Action action)
Returns the owning node reference for an action. |
org.alfresco.service.cmr.repository.NodeRef |
getOwningNodeRef(Rule rule)
Returns the owning node reference for a rule. |
Rule |
getRule(org.alfresco.service.cmr.repository.NodeRef ruleNodeRef)
Create the rule object from the rule node reference |
java.util.List |
getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get all the rules associated with an actionable node, including those inherited from parents. |
java.util.List |
getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean includeInherited)
Get the rules associated with an actionable node. |
java.util.List |
getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean includeInherited,
java.lang.String ruleTypeName)
Get the rules associated with an actionable node that are of a specific rule type. |
RuleType |
getRuleType(java.lang.String name)
Gets a rule type by name. |
java.util.List |
getRuleTypes()
Get the rule types currently defined in the repository. |
org.alfresco.service.cmr.repository.ChildAssociationRef |
getSavedRuleFolderAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets the saved rule folder reference |
protected org.alfresco.service.cmr.repository.NodeRef |
getSavedRuleFolderRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
|
boolean |
hasRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates whether the node in question has any rules associated with it. |
void |
init()
Registers to listen for events of interest. |
boolean |
isEnabled()
Indicates whether rules are currently enabled for the current thread or not |
boolean |
isLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates whether the passed rule node reference is linked to another rule node. |
void |
onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Cache invalidation |
void |
onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Cache invalidation |
void |
onUpdateNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Cache invalidation |
void |
registerRuleType(RuleType ruleType)
Register the rule type |
void |
removeAllRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Removes all the rules associated with an actionable node |
void |
removeRule(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule)
Removes a rule from the given rule actionable node |
void |
removeRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Remove all pending rules that are actioning upon the given node reference |
boolean |
rulesEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates wether the rules for a given node are enabled or not. |
void |
saveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule)
Saves the details of the rule to the specified node reference. |
void |
saveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule,
int index)
|
void |
setActionService(ActionService actionService)
Set the action service |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service |
void |
setNodeRulesCache(org.alfresco.repo.cache.SimpleCache nodeRulesCache)
Set the cache to hold node's individual rules. |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the permission-safe node service |
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Set the permission service |
void |
setPolicyComponent(PolicyComponent policyComponent)
Set the policy component to listen for various events |
void |
setRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef ruleNodeRef,
int index)
|
void |
setRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule,
int index)
|
void |
setRulesDisabled(boolean rulesDisabled)
Set the global rules disabled flag |
void |
setRuntimeActionService(RuntimeActionService runtimeActionService)
Set the runtime action service |
void |
setRuntimeNodeService(org.alfresco.service.cmr.repository.NodeService runtimeNodeService)
Set the direct node service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RuleServiceImpl()
| Method Detail |
|---|
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setRuntimeNodeService(org.alfresco.service.cmr.repository.NodeService runtimeNodeService)
public void setActionService(ActionService actionService)
public void setRuntimeActionService(RuntimeActionService runtimeActionService)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
public void setNodeRulesCache(org.alfresco.repo.cache.SimpleCache nodeRulesCache)
nodeRulesCache - a cache of raw rules contained on a nodeNullCachepublic void setRulesDisabled(boolean rulesDisabled)
rulesDisabled - true to disable allr ules, false otherwisepublic void init()
public void beforeCreateChildAssociation(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
org.alfresco.service.cmr.repository.NodeRef childNodeRef,
org.alfresco.service.namespace.QName assocTypeQName,
org.alfresco.service.namespace.QName assocQName,
boolean isNewNode)
beforeCreateChildAssociation in interface NodeServicePolicies.BeforeCreateChildAssociationPolicyparentNodeRef - the parent node referencechildNodeRef - the child node referenceassocTypeQName - the type of the associationassocQName - the name of the associationisNewNode - true if the node is new or false if the node is being linked inpublic void onUpdateNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
onUpdateNode in interface NodeServicePolicies.OnUpdateNodePolicynodeRef - reference to the updated nodepublic void onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
onCreateNode in interface NodeServicePolicies.OnCreateNodePolicychildAssocRef - the created child association reference
public void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
onAddAspect in interface NodeServicePolicies.OnAddAspectPolicynodeRef - the node to which the aspect was addedaspectTypeQName - the type of the aspectprotected org.alfresco.service.cmr.repository.NodeRef getSavedRuleFolderRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
public org.alfresco.service.cmr.repository.ChildAssociationRef getSavedRuleFolderAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef)
getSavedRuleFolderAssoc in interface RuntimeRuleServicenodeRef - the node reference
public java.util.List getRuleTypes()
RuleService
getRuleTypes in interface RuleServiceorg.alfresco.repo.rule.RuleService#getRuleTypes()public RuleType getRuleType(java.lang.String name)
RuleService
getRuleType in interface RuleServicename - the name of the rule type
org.alfresco.repo.rule.RuleService#getRuleType(java.lang.String)public void enableRules()
RuleService
enableRules in interface RuleServiceRuleService.enableRules()public void disableRules()
RuleService
disableRules in interface RuleServiceRuleService.disableRules()public boolean isEnabled()
RuleService
isEnabled in interface RuleServiceRuleService.isEnabled()public boolean rulesEnabled(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
rulesEnabled in interface RuleServicenodeRef - the node reference
RuleService.rulesEnabled(NodeRef)public void disableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
disableRules in interface RuleServicenodeRef - the node referenceRuleService.disableRules(NodeRef)public void enableRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
enableRules in interface RuleServicenodeRef - the node referenceRuleService.enableRules(NodeRef)public void disableRule(Rule rule)
RuleService
disableRule in interface RuleServicerule - the rule to disableRuleService.disableRule(org.alfresco.service.cmr.rule.Rule)public void enableRule(Rule rule)
RuleService
enableRule in interface RuleServicerule - the rule to enableRuleService.enableRule(org.alfresco.service.cmr.rule.Rule)public boolean hasRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
hasRules in interface RuleServicenodeRef - the node reference
org.alfresco.service.cmr.rule.RuleService#hasRules(org.alfresco.repo.ref.NodeRef)public java.util.List getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleServiceAn exception is raised if the actionable aspect is not present on the passed node.
getRules in interface RuleServicenodeRef - the node reference
org.alfresco.repo.rule.RuleService#getRules(org.alfresco.repo.ref.NodeRef)
public java.util.List getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean includeInherited)
RuleServiceOptionally this list includes rules inherited from its parents.
An exception is raised if the actionable aspect is not present on the passed node.
getRules in interface RuleServicenodeRef - the node referenceincludeInherited - indicates whether the inherited rules should be included in
the result list or not
org.alfresco.repo.rule.RuleService#getRules(org.alfresco.repo.ref.NodeRef, boolean)
public java.util.List getRules(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean includeInherited,
java.lang.String ruleTypeName)
RuleService
getRules in interface RuleServicenodeRef - the node referenceincludeInherited - indicates whether the inherited rules should be included in
the result list or notruleTypeName - the name of the rule type, if null is passed all rule types
are returned
org.alfresco.repo.rule.RuleService#getRulesByRuleType(org.alfresco.repo.ref.NodeRef, org.alfresco.repo.rule.RuleType)public int countRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
countRules in interface RuleServicenodeRef - the node reference
RuleService.countRules(org.alfresco.service.cmr.repository.NodeRef)public Rule getRule(org.alfresco.service.cmr.repository.NodeRef ruleNodeRef)
getRule in interface RuleServiceruleNodeRef - the rule node reference
public void saveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule)
RuleServiceIf the rule is already associated with the node, the details are updated with those specified.
saveRule in interface RuleServiceorg.alfresco.repo.rule.RuleService#saveRule(org.alfresco.repo.ref.NodeRef, org.alfresco.repo.rule.Rule)
public void saveRule(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule,
int index)
saveRule in interface RuleServiceRuleService.saveRule(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.rule.Rule, int)
public void setRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.cmr.repository.NodeRef ruleNodeRef,
int index)
setRulePosition in interface RuleServiceRuleService.setRulePosition(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, int)
public void setRulePosition(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule,
int index)
setRulePosition in interface RuleServiceRuleService.setRulePosition(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.rule.Rule, int)
public void removeRule(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Rule rule)
RuleService
removeRule in interface RuleServicenodeRef - the actionable node referenceorg.alfresco.repo.rule.RuleService#removeRule(org.alfresco.repo.ref.NodeRef, org.alfresco.service.cmr.rule.Rule)public void removeAllRules(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
removeAllRules in interface RuleServicenodeRef - the actionable node referenceorg.alfresco.repo.rule.RuleService#removeAllRules(NodeRef)
public void addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef actionableNodeRef,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
Rule rule)
RuntimeRuleService
addRulePendingExecution in interface RuntimeRuleServiceactionableNodeRef - actionable node referenceactionedUponNodeRef - actioned upon node referencerule - ruleRuntimeRuleService.addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.rule.Rule)public void removeRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
RuntimeRuleService
removeRulePendingExecution in interface RuntimeRuleServiceactionedUponNodeRef - actioned upon node reference
public void addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef actionableNodeRef,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
Rule rule,
boolean executeAtEnd)
RuntimeRuleService
addRulePendingExecution in interface RuntimeRuleServiceactionableNodeRef - actionable node referenceactionedUponNodeRef - actioned upon node referencerule - ruleexecuteAtEnd - true if execute rule at the end of the transaction, false otherwiseRuntimeRuleService.addRulePendingExecution(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.rule.Rule, boolean)public void executePendingRules()
RuntimeRuleService
executePendingRules in interface RuntimeRuleServiceorg.alfresco.repo.rule.RuleService#executePendingRules()
public void executeRule(Rule rule,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef,
java.util.Set executedRules)
RuntimeRuleService
executeRule in interface RuntimeRuleServicerule - ruleactionedUponNodeRef - actioned upon node referenceexecutedRules - already executed rulesRuntimeRuleService.executeRule(org.alfresco.service.cmr.rule.Rule, org.alfresco.service.cmr.repository.NodeRef, java.util.Set)public void registerRuleType(RuleType ruleType)
registerRuleType in interface RuntimeRuleServiceruleTypeAdapter - the rule type adapterpublic org.alfresco.service.cmr.repository.NodeRef getOwningNodeRef(Rule rule)
RuleService
getOwningNodeRef in interface RuleServicerule - the rule
RuleService.getOwningNodeRef(org.alfresco.service.cmr.rule.Rule)public org.alfresco.service.cmr.repository.NodeRef getOwningNodeRef(Action action)
RuleService
getOwningNodeRef in interface RuleServiceaction - the action
RuleService.getOwningNodeRef(org.alfresco.service.cmr.action.Action)public boolean isLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
isLinkedToRuleNode in interface RuleServicenodeRef - rule node reference
RuleService.isLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef)public org.alfresco.service.cmr.repository.NodeRef getLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
getLinkedToRuleNode in interface RuleServicenodeRef - node reference of a rule node
RuleService.getLinkedToRuleNode(org.alfresco.service.cmr.repository.NodeRef)public java.util.List getLinkedFromRuleNodes(org.alfresco.service.cmr.repository.NodeRef nodeRef)
RuleService
getLinkedFromRuleNodes in interface RuleServicenodeRef - node reference of a rule node
RuleService.getLinkedFromRuleNodes(org.alfresco.service.cmr.repository.NodeRef)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||