Class Tool

  • Direct Known Subclasses:
    Export, Import, RenameUser, Repository

    public abstract class Tool
    extends java.lang.Object
    Abstract 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 void displayHelp()
      Display Tool Help
      protected abstract int execute()
      Perform Tool Behaviour
      protected void exit​(int status)
      Exit Tool
      protected org.springframework.context.ApplicationContext getApplicationContext()
      Get the Application Context
      protected ServiceRegistry getServiceRegistry()
      Get the Repository Service Registry
      protected abstract java.lang.String getToolName()
      Get the tool name
      protected int handleError​(java.lang.Throwable e)
      Handle Error Message
      protected void logError​(java.lang.String msg)
      Log Error message
      protected void logInfo​(java.lang.String msg)
      Log message
      protected void logVerbose​(java.lang.String msg)
      Log Verbose message
      protected org.alfresco.tools.ToolContext processArgs​(java.lang.String[] args)
      Process Tool Arguments
      void start​(java.lang.String[] args)
      Tool entry point
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Tool

        public Tool()
    • Method Detail

      • processArgs

        protected org.alfresco.tools.ToolContext processArgs​(java.lang.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
      • 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