Class BaseInterpreter

java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.admin.BaseInterpreter
All Implemented Interfaces:
EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener
Direct Known Subclasses:
RepoAdminInterpreter, TenantInterpreter, WorkflowInterpreter

public abstract class BaseInterpreter extends org.springframework.extensions.surf.util.AbstractLifecycleBean
An interactive console
  • Field Details

  • Constructor Details

    • BaseInterpreter

      public BaseInterpreter()
      Make up a new console.
  • Method Details

    • runMain

      public static void runMain(String beanName)
    • runMain

      public static void runMain(org.springframework.context.ApplicationContext context, String beanName)
    • getConsoleBean

      public static BaseInterpreter getConsoleBean(org.springframework.context.ApplicationContext context, String beanName)
    • setTransactionService

      public void setTransactionService(TransactionService transactionService)
    • setAuthorityService

      public void setAuthorityService(AuthorityService authorityService)
    • rep

      public void rep()
      A Read-Eval-Print loop.
    • interpretCommand

      public String interpretCommand(String line) throws IOException
      Interpret a single command using the BufferedReader passed in for any data needed.
      Parameters:
      line - The unparsed command
      Returns:
      The textual output of the command.
      Throws:
      IOException
    • hasAuthority

      protected boolean hasAuthority(String username)
    • executeCommand

      protected abstract String executeCommand(String line) throws IOException
      Execute a single command using the BufferedReader passed in for any data needed. TODO: Use decent parser!
      Parameters:
      line - The unparsed command
      Returns:
      The textual output of the command.
      Throws:
      IOException
    • getCurrentUserName

      public String getCurrentUserName()
      Get current user name
      Returns:
      user name
    • setCurrentUserName

      public void setCurrentUserName(String username)
    • onBootstrap

      protected void onBootstrap(org.springframework.context.ApplicationEvent event)
      Specified by:
      onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • onShutdown

      protected void onShutdown(org.springframework.context.ApplicationEvent event)
      Specified by:
      onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean