Class ControllerScriptPathLoader
java.lang.Object
com.illumon.iris.controller.utils.ControllerScriptPathLoader
- All Implemented Interfaces:
ScriptPathLoader,StateOverrideScriptPathLoader
A
ScriptPathLoader slaved to the PersistentQueryController.- ImplNote:
- The lock/unlock operations are no-ops - we don't offer consistency for this implementation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidInstead of using the previously set override, use the state the loader was created with.voidclose()Free resources associated with this loader.getScriptBodyByDisplayPath(String displayPath) getScriptBodyByRelativePath(String relativePath) Get the currently active state as a JSON string created byScriptPathLoaderState.encodeJSON()voidlock()Acquire a read lock.voidrefresh()Refresh the loader internally.voidSets a state that should be used for loading operations instead of the state the loader was created with.voidunlock()Release a previously acquired read lock.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.util.scripts.ScriptPathLoader
getAvailableScriptDisplayPaths, getAvailableScriptRelativePaths, getScriptBodyByDisplayPath, getScriptBodyByRelativePath, getState, makeState
-
Method Details
-
lock
public void lock()Description copied from interface:ScriptPathLoaderAcquire a read lock. Use before invoking any of the get* methods, and hold for as long as consistency is required for this loader.- Specified by:
lockin interfaceScriptPathLoader
-
unlock
public void unlock()Description copied from interface:ScriptPathLoaderRelease a previously acquired read lock.- Specified by:
unlockin interfaceScriptPathLoader
-
getAvailableScriptDisplayPaths
- Specified by:
getAvailableScriptDisplayPathsin interfaceScriptPathLoader- Returns:
- The display paths currently available from this loader.
-
getAvailableScriptRelativePaths
- Specified by:
getAvailableScriptRelativePathsin interfaceScriptPathLoader- Returns:
- The relative paths currently available from this loader.
-
getScriptBodyByDisplayPath
- Specified by:
getScriptBodyByDisplayPathin interfaceScriptPathLoader- Parameters:
displayPath- The display path to load a script for.- Returns:
- The body of the requested script.
-
getScriptBodyByRelativePath
- Specified by:
getScriptBodyByRelativePathin interfaceScriptPathLoader- Parameters:
relativePath- The relative path to load a script for.- Returns:
- The body of the requested script.
-
refresh
public void refresh()Description copied from interface:ScriptPathLoaderRefresh the loader internally. Will respect existing read locks.- Specified by:
refreshin interfaceScriptPathLoader
-
close
public void close()Description copied from interface:ScriptPathLoaderFree resources associated with this loader.- Specified by:
closein interfaceScriptPathLoader
-
clearOverride
public void clearOverride()Description copied from interface:StateOverrideScriptPathLoaderInstead of using the previously set override, use the state the loader was created with.- Specified by:
clearOverridein interfaceStateOverrideScriptPathLoader
-
setOverrideState
Description copied from interface:StateOverrideScriptPathLoaderSets a state that should be used for loading operations instead of the state the loader was created with.- Specified by:
setOverrideStatein interfaceStateOverrideScriptPathLoader- Parameters:
state- the state to use for loading operations.
-
getUseStateJson
Description copied from interface:StateOverrideScriptPathLoaderGet the currently active state as a JSON string created byScriptPathLoaderState.encodeJSON()- Specified by:
getUseStateJsonin interfaceStateOverrideScriptPathLoader- Returns:
- the currently active state as a JSON string
-