Package de.valtech.aecu.api.service
Interface AecuService
-
@ProviderType public interface AecuServiceService 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 StringAECU_APPS_PATH_PREFIXPrefix in repository where install hook AECU scripts are located.static StringAECU_CONF_PATH_PREFIXPrefix in repository where install hook AECU scripts are located.static StringAECU_VAR_PATH_PREFIXDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HistoryEntrycreateHistoryEntry()Starts a new history entry.ExecutionResultexecute(String path)Executes the script at the given position.ExecutionResultexecute(String path, String data)Executes the script at the given position.HistoryEntryexecuteWithInstallHookHistory(String path)Executes the script(s) at the given position and taking install hook history into account.HistoryEntryexecuteWithInstallHookHistory(String path, String data)Executes the script(s) at the given position and taking install hook history into account.HistoryEntryfinishHistoryEntry(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.StringgetVersion()Returns the AECU version.booleanisValidScriptName(String name)Checks if the name is a valid script.booleanmatchesRunmodes(String name)Checks if the folder matches the system's run modes if specified in folder name.HistoryEntrystoreExecutionInHistory(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
-
-