Package de.valtech.aecu.api.service
Interface AecuService
-
@ProviderType public interface AecuService
Service interface for AECU. Use this to execute scripts or query the history.
How to perform an execution:- Get a list of files to execute using
getFiles
. This will filter all files that do not match the run mode and any fallback scripts. - Start a new history entry to store your results using
createHistoryEntry
. This store a new run with in-progress state. - Execute your files one by one with
execute
- Store each script run in history using
storeExecutionInHistory
- Mark the run as done by closing the history with
finishHistoryEntry
- Author:
- Roland Gruber
- Get a list of files to execute using
-
-
Field Summary
Fields Modifier and Type Field Description static String
AECU_APPS_PATH_PREFIX
Prefix in repository where install hook AECU scripts are located.static String
AECU_CONF_PATH_PREFIX
Prefix in repository where install hook AECU scripts are located.static String
AECU_VAR_PATH_PREFIX
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HistoryEntry
createHistoryEntry()
Starts a new history entry.ExecutionResult
execute(String path)
Executes the script at the given position.ExecutionResult
execute(String path, String data)
Executes the script at the given position.HistoryEntry
executeWithInstallHookHistory(String path)
Executes the script(s) at the given position and taking install hook history into account.HistoryEntry
executeWithInstallHookHistory(String path, String data)
Executes the script(s) at the given position and taking install hook history into account.HistoryEntry
finishHistoryEntry(HistoryEntry history)
Finishes the history entry.List<String>
getFiles(String path)
Returns a list of files that can be executed in the given path.List<HistoryEntry>
getHistory(int startIndex, int count)
Returns the last history entries.String
getVersion()
Returns the AECU version.boolean
isValidScriptName(String name)
Checks if the name is a valid script.boolean
matchesRunmodes(String name)
Checks if the folder matches the system's run modes if specified in folder name.HistoryEntry
storeExecutionInHistory(HistoryEntry history, ExecutionResult result)
Stores an execution run in existing history.
-
-
-
Field Detail
-
AECU_VAR_PATH_PREFIX
@Deprecated static final String AECU_VAR_PATH_PREFIX
Deprecated.Prefix in repository where ad-hoc AECU scripts are located.- See Also:
- Constant Field Values
-
AECU_CONF_PATH_PREFIX
static final String AECU_CONF_PATH_PREFIX
Prefix in repository where install hook AECU scripts are located.- See Also:
- Constant Field Values
-
AECU_APPS_PATH_PREFIX
static final String AECU_APPS_PATH_PREFIX
Prefix in repository where install hook AECU scripts are located.- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersion
String getVersion()
Returns the AECU version.- Returns:
- version
-
getFiles
List<String> getFiles(String path) throws AecuException
Returns a list of files that can be executed in the given path.- Parameters:
path
- file or folder- Returns:
- list of files that are executable
- Throws:
AecuException
- error finding files (e.g. invalid path)
-
matchesRunmodes
boolean matchesRunmodes(String name)
Checks if the folder matches the system's run modes if specified in folder name.- Parameters:
name
- resource name- Returns:
- matches run modes
-
isValidScriptName
boolean isValidScriptName(String name)
Checks if the name is a valid script.- Parameters:
name
- file name- Returns:
- is valid
-
execute
ExecutionResult execute(String path) throws AecuException
Executes the script at the given position.- Parameters:
path
- path of script- Returns:
- execution result
- Throws:
AecuException
- error during execution
-
execute
ExecutionResult execute(String path, String data) throws AecuException
Executes the script at the given position.- Parameters:
path
- path of scriptdata
- json object of script- Returns:
- execution result
- Throws:
AecuException
- error during execution
-
createHistoryEntry
HistoryEntry createHistoryEntry() throws AecuException
Starts a new history entry.- Returns:
- history entry
- Throws:
AecuException
- error setting up entry
-
storeExecutionInHistory
HistoryEntry storeExecutionInHistory(HistoryEntry history, ExecutionResult result) throws AecuException
Stores an execution run in existing history.- Parameters:
history
- history entryresult
- script execution result- Returns:
- updated history
- Throws:
AecuException
- error inserting history entry
-
finishHistoryEntry
HistoryEntry finishHistoryEntry(HistoryEntry history) throws AecuException
Finishes the history entry.- Parameters:
history
- open history entry- Returns:
- history entry
- Throws:
AecuException
- error saving state
-
getHistory
List<HistoryEntry> getHistory(int startIndex, int count) throws AecuException
Returns the last history entries. The search starts at the newest entry.- Parameters:
startIndex
- start reading at this index (first is 0)count
- number of entries to read- Returns:
- history entries (newest first)
- Throws:
AecuException
- error reading history
-
executeWithInstallHookHistory
HistoryEntry executeWithInstallHookHistory(String path) throws AecuException
Executes the script(s) at the given position and taking install hook history into account.- Parameters:
path
- path of script/folder- Returns:
- execution result
- Throws:
AecuException
- error during execution
-
executeWithInstallHookHistory
HistoryEntry executeWithInstallHookHistory(String path, String data) throws AecuException
Executes the script(s) at the given position and taking install hook history into account.- Parameters:
path
- path of script/folderdata
- data json string of script- Returns:
- execution result
- Throws:
AecuException
- error during execution
-
-