Package org.alfresco.repo.admin
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 Summary
FieldsModifier and TypeFieldDescriptionprotected AuthorityServiceprotected StringLast command issuedprotected TransactionServiceFields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringexecuteCommand(String line) Execute a single command using the BufferedReader passed in for any data needed.static BaseInterpretergetConsoleBean(org.springframework.context.ApplicationContext context, String beanName) Get current user nameprotected booleanhasAuthority(String username) interpretCommand(String line) Interpret a single command using the BufferedReader passed in for any data needed.protected voidonBootstrap(org.springframework.context.ApplicationEvent event) protected voidonShutdown(org.springframework.context.ApplicationEvent event) voidrep()A Read-Eval-Print loop.static voidstatic voidvoidsetAuthorityService(AuthorityService authorityService) voidsetCurrentUserName(String username) voidsetTransactionService(TransactionService transactionService) Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
-
Field Details
-
transactionService
-
authorityService
-
lastCommand
Last command issued
-
-
Constructor Details
-
BaseInterpreter
public BaseInterpreter()Make up a new console.
-
-
Method Details
-
runMain
-
runMain
-
getConsoleBean
public static BaseInterpreter getConsoleBean(org.springframework.context.ApplicationContext context, String beanName) -
setTransactionService
-
setAuthorityService
-
rep
public void rep()A Read-Eval-Print loop. -
interpretCommand
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
-
executeCommand
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
Get current user name- Returns:
- user name
-
setCurrentUserName
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event) - Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event) - Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-