Class Tool

java.lang.Object
org.alfresco.tools.Tool
Direct Known Subclasses:
Export, Import, RenameUser, Repository

public abstract class Tool extends Object
Abstract Tool Implementation
Author:
David Caruana
  • 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:
      ToolException
      org.alfresco.tools.ToolArgumentException
    • displayHelp

      protected void displayHelp()
      Display Tool Help
    • execute

      protected abstract int execute() throws ToolException
      Perform Tool Behaviour
      Throws:
      ToolException
    • getToolName

      protected abstract String getToolName()
      Get the tool name
      Returns:
      the tool name
    • logInfo

      protected void logInfo(String msg)
      Log message
      Parameters:
      msg - message to log
    • logVerbose

      protected void logVerbose(String msg)
      Log Verbose message
      Parameters:
      msg - message to log
    • logError

      protected void logError(String msg)
      Log Error message
      Parameters:
      msg - message to log
    • handleError

      protected int handleError(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(String[] args)
      Tool entry point
      Parameters:
      args - the tool arguments