public abstract class Command extends java.lang.Object implements CVSListener, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
localDirectory
The local directory from which the command is being run.
|
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).
|
protected static java.lang.String |
getTrimmedString(java.lang.String s)
Returns the trimmed version of the specified String s.
|
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 . |
protected void |
setLocalDirectory(java.lang.String localDirectory)
Sets the local directory for the command.
|
protected java.lang.String localDirectory
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.CommandException
CommandAbortedException
AuthenticationException
public 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.Object
public boolean hasFailed()
public void messageSent(MessageEvent e)
messageSent
in interface CVSListener
e
- the eventpublic void messageSent(BinaryMessageEvent e)
CVSListener
messageSent
in interface CVSListener
e
- the eventpublic void fileAdded(FileAddedEvent e)
fileAdded
in interface CVSListener
e
- the eventpublic void fileToRemove(FileToRemoveEvent e)
fileToRemove
in interface CVSListener
e
- the eventpublic void fileRemoved(FileRemovedEvent e)
fileRemoved
in interface CVSListener
e
- the eventpublic void fileUpdated(FileUpdatedEvent e)
fileUpdated
in interface CVSListener
e
- the eventpublic void fileInfoGenerated(FileInfoEvent e)
fileInfoGenerated
in interface CVSListener
public void commandTerminated(TerminationEvent e)
commandTerminated
in interface CVSListener
public void moduleExpanded(ModuleExpansionEvent e)
moduleExpanded
in interface CVSListener
public 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)
protected final void setLocalDirectory(java.lang.String localDirectory)
protected static final java.lang.String getTrimmedString(java.lang.String s)
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()
Built on January 12 2013. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.