Package ubic.gemma.core.util
Class AbstractAuthenticatedCLI
- java.lang.Object
- 
- ubic.gemma.core.util.AbstractCLI
- 
- ubic.gemma.core.util.AbstractAuthenticatedCLI
 
 
- 
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.InitializingBean,- org.springframework.context.ApplicationContextAware,- org.springframework.context.EnvironmentAware,- CLI
 - Direct Known Subclasses:
- AbstractAutoSeekingCLI,- ArrayDesignAlternativePopulateCli,- BibRefUpdaterCli,- BlacklistCli,- CompleteCli,- DatabaseViewGeneratorCLI,- ExperimentalDesignViewCli,- ExternalDatabaseAdderCli,- ExternalDatabaseOverviewCli,- ExternalDatabaseUpdaterCli,- ExternalFileGeneLoaderCLI,- FactorValueMigratorCLI,- FindObsoleteTermsCli,- FixOntologyTermLabelsCli,- GenericGenelistDesignGenerator,- GeoGrabberCli,- LoadExpressionDataCli,- LoadSimpleExpressionDataCli,- MultifunctionalityCli,- NCBIGene2GOAssociationLoaderCLI,- NcbiGeneLoaderCLI,- ProtocolAdderCli,- ProtocolDeleterCli,- ProtocolListCli,- PubMedLoaderCli,- PubMedSearcher,- TaxonLoaderCli,- UpdateEe2AdCli,- UpdateEE2CCli,- UpdateGene2CsCli,- UpdatePubMedCli
 
 public abstract class AbstractAuthenticatedCLI extends AbstractCLI implements org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware Subclass this to create command line interface (CLI) tools that need authentication.Credentials may be supplied via the environment using the $GEMMA_USERNAMEand$GEMMA_PASSWORDvariables. A more secure$GEMMA_PASSWORD_CMDvariable can be used to specify a command that produces the password. If no environment variables are supplied, they will be prompted if the standard input is attached to a console (i.e tty).If the testortestdbprofile is active, environment variables with the$GEMMA_TEST_DB_prefix will be looked up instead.- Author:
- pavlidis
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface ubic.gemma.core.util.CLICLI.CommandGroup
 
- 
 - 
Field Summary- 
Fields inherited from class ubic.gemma.core.util.AbstractCLIABORTED, FAILURE, FAILURE_FROM_ERROR_OBJECTS, log, SUCCESS
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractAuthenticatedCLI()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected ExecutorServicecreateBatchTaskExecutorService()Create anExecutorServiceto be used for running batch tasks.protected abstract voiddoAuthenticatedWork()protected voiddoWork()Command line implementation.voidsetEnvironment(org.springframework.core.env.Environment environment)protected voidsetRequireLogin()Indicate that the command requires authentication.- 
Methods inherited from class ubic.gemma.core.util.AbstractCLIabort, addBatchOption, addErrorObject, addErrorObject, addErrorObject, addSuccessObject, addSuccessObject, addThreadsOption, addWarningObject, addWarningObject, allowPositionalArguments, awaitBatchExecutorService, buildOptions, executeCommand, getApplicationContext, getBatchTaskExecutor, getCliContext, getCommandAliases, getCommandGroup, getCommandName, getHelpFooter, getNumThreads, getOptions, getShortDesc, getUsage, processOptions, promptConfirmationOrAbort, setAllowPositionalArguments, setApplicationContext, setEstimatedMaxTasks, setReportFrequencyMillis
 
- 
 
- 
- 
- 
Method Detail- 
afterPropertiesSetpublic void afterPropertiesSet() throws Exception- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
- Throws:
- Exception
 
 - 
setEnvironmentpublic void setEnvironment(org.springframework.core.env.Environment environment) - Specified by:
- setEnvironmentin interface- org.springframework.context.EnvironmentAware
 
 - 
setRequireLoginprotected void setRequireLogin() Indicate that the command requires authentication.
 - 
doWorkprotected final void doWork() throws ExceptionDescription copied from class:AbstractCLICommand line implementation.This is called after AbstractCLI.buildOptions(Options)andAbstractCLI.processOptions(CommandLine). so the implementation can assume that all its arguments have already been initialized and any setup behaviour have been performed.- Specified by:
- doWorkin class- AbstractCLI
- Throws:
- Exception- in case of unrecoverable failure, an exception is thrown and will result in a- AbstractCLI.FAILUREexit code, otherwise use- AbstractCLI.addErrorObject(java.lang.Object, java.lang.String, java.lang.Throwable)to indicate an error and resume processing
 
 - 
doAuthenticatedWorkprotected abstract void doAuthenticatedWork() throws Exception- Throws:
- Exception
 
 - 
createBatchTaskExecutorServiceprotected ExecutorService createBatchTaskExecutorService() Description copied from class:AbstractCLICreate anExecutorServiceto be used for running batch tasks.- Overrides:
- createBatchTaskExecutorServicein class- AbstractCLI
 
 
- 
 
-