public abstract class Command extends java.lang.Object implements CVSListener, java.lang.Cloneable
| Constructor and Description |
|---|
Command() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
This method just calls the Object.clone() and makes it public.
|
void |
commandTerminated(TerminationEvent e)
Called when server responses with "ok" or "error", (when the command finishes).
|
void |
execute(ClientServices client,
EventManager eventManager)
Execute this command.
|
void |
fileAdded(FileAddedEvent e)
Called when a file has been added.
|
void |
fileInfoGenerated(FileInfoEvent e)
Called when file status information has been received.
|
void |
fileRemoved(FileRemovedEvent e)
Called when a file is removed.
|
void |
fileToRemove(FileToRemoveEvent e)
Called when a file is going to be removed.
|
void |
fileUpdated(FileUpdatedEvent e)
Called when a file has been updated.
|
abstract java.lang.String |
getCVSArguments()
Returns the arguments of the command in the command-line style.
|
abstract java.lang.String |
getCVSCommand()
This method returns how the command would looklike when typed on the
command line.
|
java.lang.String |
getDisplayName()
Returns localized name describing command purpose
or
null. |
GlobalOptions |
getGlobalOptions()
Get the global options.
|
java.lang.String |
getLocalDirectory()
Returns the local path the command is associated with.
|
java.lang.String |
getLocalPath()
Deprecated.
Please use the getLocalDirectory() method instead.
|
abstract java.lang.String |
getOptString()
Returns a String that defines which options are available for this
particular command.
|
java.lang.String |
getRelativeToLocalPathInUnixStyle(java.io.File file)
Returns the relative path of the specified file (relative to the set
local path).
|
boolean |
hasFailed() |
void |
messageSent(BinaryMessageEvent e)
Called when the server wants to send a binary message to be displayed to
the user.
|
void |
messageSent(MessageEvent e)
Called when the server wants to send a message to be displayed to
the user.
|
void |
moduleExpanded(ModuleExpansionEvent e)
This is called when the servers has responded to an expand-modules
request.
|
abstract void |
resetCVSCommand()
Resets all switches in the command to the default behaviour.
|
abstract boolean |
setCVSCommand(char opt,
java.lang.String optArg)
Takes the arguments and sets the command.
|
void |
setDisplayName(java.lang.String name)
Defines prefered display name or
null. |
public void execute(ClientServices client, EventManager eventManager) throws CommandException, CommandAbortedException, AuthenticationException
client - the client services object that provides any necessary
services to this command, including the ability to actually
process all the requestse - the event manager. The command can use this to fire events
if necessary - for example, while parsing status responses.CommandExceptionCommandAbortedExceptionAuthenticationExceptionpublic abstract java.lang.String getCVSCommand()
public abstract java.lang.String getCVSArguments()
public abstract boolean setCVSCommand(char opt,
java.lang.String optArg)
public abstract void resetCVSCommand()
public abstract java.lang.String getOptString()
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean hasFailed()
public void messageSent(MessageEvent e)
messageSent in interface CVSListenere - the eventpublic void messageSent(BinaryMessageEvent e)
CVSListenermessageSent in interface CVSListenere - the eventpublic void fileAdded(FileAddedEvent e)
fileAdded in interface CVSListenere - the eventpublic void fileToRemove(FileToRemoveEvent e)
fileToRemove in interface CVSListenere - the eventpublic void fileRemoved(FileRemovedEvent e)
fileRemoved in interface CVSListenere - the eventpublic void fileUpdated(FileUpdatedEvent e)
fileUpdated in interface CVSListenere - the eventpublic void fileInfoGenerated(FileInfoEvent e)
fileInfoGenerated in interface CVSListenerpublic void commandTerminated(TerminationEvent e)
commandTerminated in interface CVSListenerpublic void moduleExpanded(ModuleExpansionEvent e)
moduleExpanded in interface CVSListenerpublic final java.lang.String getLocalDirectory()
public final java.lang.String getLocalPath()
public final GlobalOptions getGlobalOptions()
public final java.lang.String getRelativeToLocalPathInUnixStyle(java.io.File file)
public void setDisplayName(java.lang.String name)
null.
Localized string should highlight command purpose (use verb in gerund).
E.g. UpdateCommand used to refresh statuses should
be named "Refreshing Status" rather than "cvs -N update",
"Updating" or "Status Refresh".public java.lang.String getDisplayName()
null.getCVSCommand()