Package org.alfresco.tools
Class Tool
java.lang.Object
org.alfresco.tools.Tool
- Direct Known Subclasses:
Export,Import,RenameUser,Repository
Abstract Tool Implementation
- Author:
- David Caruana
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDisplay Tool Helpprotected abstract intexecute()Perform Tool Behaviourprotected voidexit(int status) Exit Toolprotected final org.springframework.context.ApplicationContextGet the Application Contextprotected final ServiceRegistryGet the Repository Service Registryprotected abstract StringGet the tool nameprotected intHandle Error Messageprotected voidLog Error messageprotected voidLog messageprotected voidlogVerbose(String msg) Log Verbose messageprotected org.alfresco.tools.ToolContextprocessArgs(String[] args) Process Tool Argumentsfinal voidTool entry point
-
Constructor Details
-
Tool
public Tool()
-
-
Method Details
-
processArgs
protected org.alfresco.tools.ToolContext processArgs(String[] args) throws org.alfresco.tools.ToolArgumentException Process Tool Arguments- Parameters:
args- the arguments- Returns:
- the tool context
- Throws:
ToolExceptionorg.alfresco.tools.ToolArgumentException
-
displayHelp
protected void displayHelp()Display Tool Help -
execute
Perform Tool Behaviour- Throws:
ToolException
-
getToolName
Get the tool name- Returns:
- the tool name
-
logInfo
Log message- Parameters:
msg- message to log
-
logVerbose
Log Verbose message- Parameters:
msg- message to log
-
logError
Log Error message- Parameters:
msg- message to log
-
handleError
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
Get the Repository Service Registry- Returns:
- the service registry
-
start
Tool entry point- Parameters:
args- the tool arguments
-