Package com.illumon.iris.db.util.scripts
Class ConsoleScriptPathLoader
java.lang.Object
com.illumon.iris.db.util.scripts.ConsoleScriptPathLoader
- All Implemented Interfaces:
ScriptPathLoader
public class ConsoleScriptPathLoader extends Object implements ScriptPathLoader
This loader loads *only* using IrisDbGroovySession.findScript(String script).
Consistency locking and refresh methods are no-ops.
-
Constructor Summary
Constructors Constructor Description ConsoleScriptPathLoader()
-
Method Summary
Modifier and Type Method Description void
close()
Free resources associated with this loader.Set<String>
getAvailableScriptDisplayPaths()
String
getScriptBodyByDisplayPath(String displayPath)
String
getScriptBodyByRelativePath(String relativePath)
void
lock()
Acquire a read lock.void
refresh()
Refresh the loader internally.void
unlock()
Release a previously acquired read lock.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.util.scripts.ScriptPathLoader
getAvailableScriptDisplayPaths, getScriptBodyByDisplayPath, getScriptBodyByRelativePath, getState
-
Constructor Details
-
ConsoleScriptPathLoader
public ConsoleScriptPathLoader()
-
-
Method Details
-
lock
public void lock()Description copied from interface:ScriptPathLoader
Acquire 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:
lock
in interfaceScriptPathLoader
-
unlock
public void unlock()Description copied from interface:ScriptPathLoader
Release a previously acquired read lock.- Specified by:
unlock
in interfaceScriptPathLoader
-
getAvailableScriptDisplayPaths
- Specified by:
getAvailableScriptDisplayPaths
in interfaceScriptPathLoader
- Returns:
- The display paths currently available from this loader.
-
getScriptBodyByDisplayPath
- Specified by:
getScriptBodyByDisplayPath
in interfaceScriptPathLoader
- Parameters:
displayPath
- The display path to load a script for.- Returns:
- The body of the requested script.
- Throws:
IOException
- If a problem occurred reading the script body.
-
getScriptBodyByRelativePath
- Specified by:
getScriptBodyByRelativePath
in interfaceScriptPathLoader
- Parameters:
relativePath
- The relative path to load a script for.- Returns:
- The body of the requested script.
- Throws:
IOException
- If a problem occurred reading the script body.
-
refresh
public void refresh()Description copied from interface:ScriptPathLoader
Refresh the loader internally. Will respect existing read locks.- Specified by:
refresh
in interfaceScriptPathLoader
-
close
public void close()Description copied from interface:ScriptPathLoader
Free resources associated with this loader.- Specified by:
close
in interfaceScriptPathLoader
-