public class ZkUpdateWatcher extends java.lang.Object implements WorkflowUpdateWatcher
| Constructor and Description |
|---|
ZkUpdateWatcher() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate()
activate the service.
|
void |
checkWorkflowVersions()
compare cluster versions of workflows with local versions and update local deployment.
|
void |
initialize()
connect to Zookeeper and create root node.
|
void |
registerProcessor(WorkflowProcessor processor)
register a workflow processor to be notified on updates.
|
void |
setZkService(ZooKeeperService zkService)
service reference bind method.
|
void |
startPolling()
start polling for updates.
|
void |
startPolling(int pollIntervalSeconds)
start polling for updates with custom interval.
|
boolean |
startWatching()
install a ZK watch on the root node to get notifications about changes.
|
void |
stopPolling()
stop polling for updates.
|
void |
stopWatching()
stop watching: ZK watch on root node will not be reinstalled.
|
void |
unsetZkService(ZooKeeperService zkService)
service reference unbind method.
|
void |
workflowDeleted(java.lang.String workflowName)
Send delete notification, call on custom workflow remove.
|
void |
workflowLoadedOnStart(java.lang.String workflowName,
java.lang.String timestamp)
Initialize notification structure for workflow, call on initial load on service start.
|
void |
workflowUpdated(java.lang.String workflowName,
java.lang.String timestamp)
Send update notification, call on custom workflow creation or update.
|
public void setZkService(ZooKeeperService zkService)
public void unsetZkService(ZooKeeperService zkService)
public void registerProcessor(WorkflowProcessor processor)
WorkflowUpdateWatcherregisterProcessor in interface WorkflowUpdateWatcherprotected void activate()
public void initialize()
throws KeeperException
KeeperExceptionpublic boolean startWatching()
WorkflowUpdateWatcherstartWatching in interface WorkflowUpdateWatcherpublic void stopWatching()
WorkflowUpdateWatcherstopWatching in interface WorkflowUpdateWatcherpublic void startPolling()
WorkflowUpdateWatcherstartPolling in interface WorkflowUpdateWatcherpublic void startPolling(int pollIntervalSeconds)
WorkflowUpdateWatcherstartPolling in interface WorkflowUpdateWatcherpublic void stopPolling()
WorkflowUpdateWatcherstopPolling in interface WorkflowUpdateWatcherpublic void workflowLoadedOnStart(java.lang.String workflowName,
java.lang.String timestamp)
throws ProcessingException
WorkflowUpdateWatcherworkflowLoadedOnStart in interface WorkflowUpdateWatcherProcessingExceptionpublic void workflowUpdated(java.lang.String workflowName,
java.lang.String timestamp)
throws ProcessingException
WorkflowUpdateWatcherworkflowUpdated in interface WorkflowUpdateWatcherProcessingExceptionpublic void workflowDeleted(java.lang.String workflowName)
throws ProcessingException
WorkflowUpdateWatcherworkflowDeleted in interface WorkflowUpdateWatcherProcessingExceptionpublic void checkWorkflowVersions()
WorkflowUpdateWatchercheckWorkflowVersions in interface WorkflowUpdateWatcher