org.netbeans.lib.cvsclient.command.watch
Class WatchCommand

java.lang.Object
  extended by org.netbeans.lib.cvsclient.command.Command
      extended by org.netbeans.lib.cvsclient.command.BuildableCommand
          extended by org.netbeans.lib.cvsclient.command.BasicCommand
              extended by org.netbeans.lib.cvsclient.command.watch.WatchCommand
All Implemented Interfaces:
java.lang.Cloneable, CVSListener

public class WatchCommand
extends BasicCommand


Field Summary
 
Fields inherited from class org.netbeans.lib.cvsclient.command.BasicCommand
clientServices, files, requests
 
Fields inherited from class org.netbeans.lib.cvsclient.command.BuildableCommand
builder
 
Fields inherited from class org.netbeans.lib.cvsclient.command.Command
localDirectory
 
Constructor Summary
WatchCommand()
          Construct a new WatchCommand.
 
Method Summary
 void commandTerminated(TerminationEvent e)
          If a builder was set-up, it's outputDone() method is called.
 void execute(ClientServices client, EventManager eventManager)
          Executes this command.
 java.lang.String getCVSArguments()
          Returns the arguments of the command in the command-line style.
 java.lang.String getCVSCommand()
          Returns how this command would look like when typed on the command line.
 java.lang.String getOptString()
          String returned by this method defines which options are available for this command.
 Watch getWatch()
          Returns the watch.
 WatchMode getWatchMode()
          Returns the WatchMode.
 void resetCVSCommand()
          Resets all switches in this command.
 boolean setCVSCommand(char opt, java.lang.String optArg)
          Uses the specified argument to set the appropriate properties.
 void setWatch(Watch watch)
          Sets the watch.
 void setWatchMode(WatchMode watchMode)
          Sets the WatchMode.
 
Methods inherited from class org.netbeans.lib.cvsclient.command.BasicCommand
addArgumentRequest, addArgumentRequests, addDirectoryRequest, addRequest, addRequestForFile, addRequestForWorkingDirectory, addRequestsForDirectory, addRequestsForFile, appendFileArguments, assumeLocalPathWhenUnspecified, doesCheckFileTime, getFileEndingWith, getFiles, getRecursive, getXthFile, isRecursive, sendEntryAndModifiedRequests, setFiles, setRecursive
 
Methods inherited from class org.netbeans.lib.cvsclient.command.BuildableCommand
createBuilder, isBuilderSet, messageSent, messageSent, setBuilder
 
Methods inherited from class org.netbeans.lib.cvsclient.command.Command
clone, fileAdded, fileInfoGenerated, fileRemoved, fileToRemove, fileUpdated, getDisplayName, getGlobalOptions, getLocalDirectory, getLocalPath, getRelativeToLocalPathInUnixStyle, getTrimmedString, hasFailed, moduleExpanded, setDisplayName, setLocalDirectory
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatchCommand

public WatchCommand()
Construct a new WatchCommand.

Method Detail

execute

public void execute(ClientServices client,
                    EventManager eventManager)
             throws CommandException,
                    AuthenticationException
Executes this command.

Overrides:
execute in class BasicCommand
Parameters:
client - the client services object that provides any necessary services to this command, including the ability to actually process all the requests
eventManager - the EventManager used for sending events
Throws:
java.lang.IllegalStateException - if the commands options aren't set correctly
AuthenticationException - if the connection could not be established
CommandException - if some other thing gone wrong

commandTerminated

public void commandTerminated(TerminationEvent e)
If a builder was set-up, it's outputDone() method is called. This method is called, when the server responses with "ok" or "error" (== when the command finishes).

Specified by:
commandTerminated in interface CVSListener
Overrides:
commandTerminated in class BuildableCommand

setCVSCommand

public boolean setCVSCommand(char opt,
                             java.lang.String optArg)
Uses the specified argument to set the appropriate properties. To be mainly used for automatic settings (like parsing the .cvsrc file)

Specified by:
setCVSCommand in class Command
Returns:
whether the option (switch) was recognized and set

getOptString

public java.lang.String getOptString()
String returned by this method defines which options are available for this command.

Specified by:
getOptString in class Command

resetCVSCommand

public void resetCVSCommand()
Resets all switches in this command. After calling this method, the command behaves like newly created.

Specified by:
resetCVSCommand in class Command

getCVSCommand

public java.lang.String getCVSCommand()
Returns how this command would look like when typed on the command line.

Specified by:
getCVSCommand in class Command

getCVSArguments

public java.lang.String getCVSArguments()
Returns the arguments of the command in the command-line style. Similar to getCVSCommand() however without the files and command's name

Specified by:
getCVSArguments in class Command

getWatchMode

public WatchMode getWatchMode()
Returns the WatchMode.


setWatchMode

public void setWatchMode(WatchMode watchMode)
Sets the WatchMode.


getWatch

public Watch getWatch()
Returns the watch.


setWatch

public void setWatch(Watch watch)
Sets the watch. If the WatchMode ADD or REMOVE is used, null is the same as Watch.ALL. If the WatchMode ON or OFF is used, this option isn't used at all.


 

Built on August 7 2008.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.