public abstract class PolicyMonitor extends AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING| Constructor and Description |
|---|
PolicyMonitor()
empty constructor
|
PolicyMonitor(java.lang.String directory)
construtor with a predetermined directory to monitor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart()
called by the abstract lifecycle to start the monitor
|
protected void |
doStop()
called by the abstract life cycle to turn off the monitor
|
int |
getScanCount()
gets the number of times the scan has been run
|
int |
getScanInterval()
gets the scanner interval
|
boolean |
isInitialized()
true of the monitor is initialized, meaning that at least one
scan cycle has completed and any policy grants found have been chirped
|
boolean |
isReloadEnabled()
true of reload is enabled, false otherwise
|
abstract void |
onPolicyChange(PolicyBlock grant)
implemented by the user of the policy monitor to handle custom logic
related to the usage of the policy grant instance/s.
|
void |
setPolicyDirectory(java.lang.String directory)
set the policy directory to scan on a non-running monitor
|
void |
setReload(boolean reload)
sets the monitor to reload or not, but only if the monitor isn't already running
TODO this doesn't really _have_ to be on a non-running monitor
|
void |
setScanInterval(int scanInterval)
sets the scanner interval on a non-running instance of the monitor
|
void |
waitForScan()
initiates a scan and blocks until it has been completed
|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic PolicyMonitor()
public PolicyMonitor(java.lang.String directory)
directory - public void setPolicyDirectory(java.lang.String directory)
directory - public int getScanInterval()
public void setScanInterval(int scanInterval)
scanInterval - in secondsScanner.setScanInterval(int)public boolean isInitialized()
public int getScanCount()
public void waitForScan()
throws java.lang.Exception
java.lang.Exceptionpublic boolean isReloadEnabled()
public void setReload(boolean reload)
reload - protected void doStart()
throws java.lang.Exception
doStart in class AbstractLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class AbstractLifeCyclejava.lang.Exceptionpublic abstract void onPolicyChange(PolicyBlock grant)
grant - Copyright © 2013 FuseSource, Corp.. All Rights Reserved.