org.netbeans.lib.cvsclient.command
Class BuildableCommand

java.lang.Object
  extended by org.netbeans.lib.cvsclient.command.Command
      extended by org.netbeans.lib.cvsclient.command.BuildableCommand
All Implemented Interfaces:
java.lang.Cloneable, CVSListener
Direct Known Subclasses:
AddCommand, BasicCommand, ImportCommand, RepositoryCommand

public abstract class BuildableCommand
extends Command

A class that provides common functionality for many of the CVS command that send similar sequences of requests.


Field Summary
protected  Builder builder
          An implementation of Builder interface that constructs a FileContainerInfo object from the server's output..
 
Fields inherited from class org.netbeans.lib.cvsclient.command.Command
localDirectory
 
Constructor Summary
BuildableCommand()
           
 
Method Summary
 void commandTerminated(TerminationEvent e)
          Called when server responses with "ok" or "error", (when the command finishes).
 Builder createBuilder(EventManager eventManager)
          Method that is called while the command is being executed.
 void execute(ClientServices client, EventManager eventManager)
          Execute a command.
protected  boolean isBuilderSet()
          Returns whether the builder is set.
 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 setBuilder(Builder builder)
          Used for setting user-defined builder.
 
Methods inherited from class org.netbeans.lib.cvsclient.command.Command
clone, fileAdded, fileInfoGenerated, fileRemoved, fileToRemove, fileUpdated, getCVSArguments, getCVSCommand, getDisplayName, getGlobalOptions, getLocalDirectory, getLocalPath, getOptString, getRelativeToLocalPathInUnixStyle, getTrimmedString, hasFailed, moduleExpanded, resetCVSCommand, setCVSCommand, setDisplayName, setLocalDirectory
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

protected Builder builder
An implementation of Builder interface that constructs a FileContainerInfo object from the server's output..

Constructor Detail

BuildableCommand

public BuildableCommand()
Method Detail

execute

public void execute(ClientServices client,
                    EventManager eventManager)
             throws CommandException,
                    AuthenticationException
Execute a command. This implementation sends a Root request, followed by as many Directory and Entry requests as is required by the recurse setting and the file arguments that have been set. Subclasses should call this first, and tag on the end of the requests list any further requests and, finally, the actually request that does the command (e.g.
update
,
status
etc.)

Overrides:
execute in class Command
Parameters:
client - the client services object that provides any necessary services to this command, including the ability to actually process all the requests
Throws:
CommandException - if an error occurs executing the command
AuthenticationException

createBuilder

public Builder createBuilder(EventManager eventManager)
Method that is called while the command is being executed. Descendants can override this method to return a Builder instance that will parse the server's output and create data structures.


messageSent

public void messageSent(BinaryMessageEvent e)
Description copied from interface: CVSListener
Called when the server wants to send a binary message to be displayed to the user. The message is only for information purposes and clients can choose to ignore these messages if they wish.

Specified by:
messageSent in interface CVSListener
Overrides:
messageSent in class Command
Parameters:
e - the event

messageSent

public void messageSent(MessageEvent e)
Description copied from class: Command
Called when the server wants to send a message to be displayed to the user. The message is only for information purposes and clients can choose to ignore these messages if they wish.

Specified by:
messageSent in interface CVSListener
Overrides:
messageSent in class Command
Parameters:
e - the event

isBuilderSet

protected boolean isBuilderSet()
Returns whether the builder is set.


setBuilder

public void setBuilder(Builder builder)
Used for setting user-defined builder. Can be also set null, in that case the builder mechanism is not used at all.


commandTerminated

public void commandTerminated(TerminationEvent e)
Called when server responses with "ok" or "error", (when the command finishes).

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

 

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