Package org.alfresco.tools
Class Tool
- java.lang.Object
-
- org.alfresco.tools.Tool
-
- Direct Known Subclasses:
Export,Import,RenameUser,Repository
public abstract class Tool extends java.lang.ObjectAbstract Tool Implementation- Author:
- David Caruana
-
-
Constructor Summary
Constructors Constructor Description Tool()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddisplayHelp()Display Tool Helpprotected abstract intexecute()Perform Tool Behaviourprotected voidexit(int status)Exit Toolprotected org.springframework.context.ApplicationContextgetApplicationContext()Get the Application Contextprotected ServiceRegistrygetServiceRegistry()Get the Repository Service Registryprotected abstract java.lang.StringgetToolName()Get the tool nameprotected inthandleError(java.lang.Throwable e)Handle Error Messageprotected voidlogError(java.lang.String msg)Log Error messageprotected voidlogInfo(java.lang.String msg)Log messageprotected voidlogVerbose(java.lang.String msg)Log Verbose messageprotected org.alfresco.tools.ToolContextprocessArgs(java.lang.String[] args)Process Tool Argumentsvoidstart(java.lang.String[] args)Tool entry point
-
-
-
Method Detail
-
processArgs
protected org.alfresco.tools.ToolContext processArgs(java.lang.String[] args) throws org.alfresco.tools.ToolArgumentExceptionProcess Tool Arguments- Parameters:
args- the arguments- Returns:
- the tool context
- Throws:
ToolExceptionorg.alfresco.tools.ToolArgumentException
-
displayHelp
protected void displayHelp()
Display Tool Help
-
execute
protected abstract int execute() throws ToolExceptionPerform Tool Behaviour- Throws:
ToolException
-
getToolName
protected abstract java.lang.String getToolName()
Get the tool name- Returns:
- the tool name
-
logInfo
protected void logInfo(java.lang.String msg)
Log message- Parameters:
msg- message to log
-
logVerbose
protected void logVerbose(java.lang.String msg)
Log Verbose message- Parameters:
msg- message to log
-
logError
protected void logError(java.lang.String msg)
Log Error message- Parameters:
msg- message to log
-
handleError
protected int handleError(java.lang.Throwable e)
Handle Error Message- Parameters:
e- exception
-
exit
protected void exit(int status)
Exit Tool- Parameters:
status- status code
-
getApplicationContext
protected final org.springframework.context.ApplicationContext getApplicationContext()
Get the Application Context- Returns:
- the application context
-
getServiceRegistry
protected final ServiceRegistry getServiceRegistry()
Get the Repository Service Registry- Returns:
- the service registry
-
start
public final void start(java.lang.String[] args)
Tool entry point- Parameters:
args- the tool arguments
-
-