org.alfresco.repo.clt
Class CltBase

java.lang.Object
  extended by org.alfresco.repo.clt.CltBase
Direct Known Subclasses:
AVMCopyIn, AVMCopyOut, AVMLs, AVMLsStores, AVMLsVersions, AVMMkDir, AVMMkLayeredDir, AVMMkStore, AVMRm, AVMSnapshot, RepoCopyIn, RepoCopyOut, RepoLs

public abstract class CltBase
extends java.lang.Object

This is the base class for AVM clts.


Field Summary
protected  AuthenticationService fAuthenticationService
          The Authentication Service.
protected  AVMRemote fAVMRemote
          The instance of the remote interface.
protected  AVMSyncService fAVMSyncService
          The instance of the remote sync service interface.
protected  org.springframework.context.ConfigurableApplicationContext fContext
          The ApplicationContext.
protected  RepoRemote fRepoRemote
          The instance of the remote repo interface.
 
Constructor Summary
protected CltBase()
          Construct a new one.
 
Method Summary
protected  void copyStream(java.io.InputStream in, java.io.OutputStream out)
           
 void exec(java.lang.String[] args, java.lang.Object[] flagDefs, int minArgs, java.lang.String usageMessage)
          All clts go through this call.
protected abstract  void run(java.util.Map flags, java.util.List args)
           
protected  java.lang.String[] splitPath(java.lang.String path)
          Utility to split an AVM path into a parent path and a base name.
protected  org.alfresco.util.Pair splitPathVersion(java.lang.String pathVersion)
           
protected  void usage()
          Handle syntax error by exiting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fAVMRemote

protected AVMRemote fAVMRemote
The instance of the remote interface.


fAVMSyncService

protected AVMSyncService fAVMSyncService
The instance of the remote sync service interface.


fRepoRemote

protected RepoRemote fRepoRemote
The instance of the remote repo interface.


fContext

protected org.springframework.context.ConfigurableApplicationContext fContext
The ApplicationContext.


fAuthenticationService

protected AuthenticationService fAuthenticationService
The Authentication Service.

Constructor Detail

CltBase

protected CltBase()
Construct a new one. This takes care of instantiating the application context and grabs references to the services.

Parameters:
args - The program arguments.
Method Detail

exec

public void exec(java.lang.String[] args,
                 java.lang.Object[] flagDefs,
                 int minArgs,
                 java.lang.String usageMessage)
All clts go through this call. This parses the arguments, exits if there are any errors and then passes the broken flags and arguments to the run method of the derived clt.

Parameters:
args - The raw command line arguments.
flagDefs - The definition of what flags to accept and their arities.
minArgs - The minimum number of actual arguments expected.
usageMessage - The message that should be printed if there is a syntax error.

usage

protected void usage()
Handle syntax error by exiting.


splitPath

protected java.lang.String[] splitPath(java.lang.String path)
Utility to split an AVM path into a parent path and a base name.

Parameters:
path - The path to split.
Returns:
An array of 1 or 2 Strings representing the parent path and the base name, or just the path if the path given is a root path.

copyStream

protected void copyStream(java.io.InputStream in,
                          java.io.OutputStream out)

splitPathVersion

protected org.alfresco.util.Pair splitPathVersion(java.lang.String pathVersion)

run

protected abstract void run(java.util.Map flags,
                            java.util.List args)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.