| java.lang.Object com.ice.cvsc.CVSClient
CVSClient | public class CVSClient extends Object implements HostKeyVerification(Code) | | Implements the client side of the CVS server-client protocol.
This object is used by a CVSProject object to implement the
protocols required to communicate with the CVS server and
complete CVS requests. CVSClient's use TCP communications
to a specified host and port (default is 2401). CVSClients
can stand on their own, however, there is not much
interesting that can be accomplished without the information
contained in a CVSProject. Typically, you use a CVSClient
by handing it a CVSRequest, and it will hand back a CVSResponse.
Thanks to Wes Sonnenreich for his original
attempt at the integration of MindBright's SSH package into this
client. The effort was most helpful in understanding the package.
version: $Revision: 2.20 $ author: Timothy Gerard Endres, time@ice.com. See Also: CVSRequest See Also: CVSResponse See Also: CVSProject |
Constructor Summary | |
public | CVSClient() Creates a CVS client. | public | CVSClient(String hostName, int port) Creates a CVS client using the provided hostname and port number. |
Method Summary | |
public CVSResponse | buildErrorResponse(CVSRequest request, CVSResponse response, String message) | public boolean | checkForCancel(CVSResponse response) | public boolean | closeServer() | public String | generateTempPath() | public String | getHostName() Returns the hostname of the cvs server. | public boolean | getMultipleInterfaceSupport() Returns the port number of the cvs server. | public int | getPort() Returns the port number of the cvs server. | public String | getReason() Returns the reason for the last error. | public String | getStickTag(CVSRequest request, String localDir) | public String | getTempDirectory() Returns the pathname of the directory in which temporary files are created. | public boolean | isCanceled() | public boolean | isServerOpen() Indicates whether or not the connection to the server is established. | public boolean | performLogin(CVSRequest request) | public boolean | performRSHProtocol(String remoteUserName, String serverCommand) | public CVSResponse | processCVSRequest(CVSRequest request) This method is the heart of the CVSClient class.
Given a CVSRequest, this method will perform all of the
processing required to open the connection, authenticate,
send all requests, read all responses, and package the
responses into a CVSResponse object, which is returned
as the result of this method. | public CVSResponse | processCVSRequest(CVSRequest request, CVSResponse response) | public CVSResponse | readAndParseResponse(CVSRequest request, CVSResponse response) | public String | readAsciiLine(Reader in) | public String | readLine() | public String | readResponse() | public boolean | requestValidRequests(CVSRequest request) | public boolean | retrieveFile(CVSResponseItem item, File file) | public boolean | sendArguments(CVSArgumentVector arguments) | public boolean | sendCVSArgument(String argument) | public boolean | sendCVSEntries(CVSRequest request) | public boolean | sendCVSEntry(CVSRequest request, CVSEntry entry, File entryFile) | public boolean | sendCVSModule(CVSRequest request) | public boolean | sendCVSRootDirectory(CVSRequest request) | public boolean | sendEntriesArguments(CVSRequest request) | public boolean | sendEntryRepository(CVSRequest request, CVSEntry entry) This method is used to send the 'Directory' command before
an entry is sent, to set the "context" of the entry (i.e.,
the entry's directory).
Note that jCVS has a peculiarity. | public boolean | sendFileAscii(CVSEntry entry, File entryFile, boolean gzipFileMode) | public boolean | sendFileContents(InputStream in) | public boolean | sendFileRaw(CVSEntry entry, File entryFile, boolean useGzipFile) | public boolean | sendGlobalArguments(CVSArgumentVector arguments) | public boolean | sendLine(String line) | public boolean | sendLostEntry(CVSRequest request, CVSEntry entry, boolean useUnchanged) | public boolean | sendModified(CVSRequest request, CVSEntry entry, File entryFile, boolean empty, int trans) | public boolean | sendNotifies(CVSRequest request) | public boolean | sendRootRepository(CVSRequest request) Send the "root" of our repository. | public boolean | sendSetVariables(CVSRequest request) | public boolean | sendStatic(CVSRequest request, CVSEntry entry) | public boolean | sendSticky(CVSRequest request, CVSEntry entry) | public boolean | sendSticky(CVSRequest request, String localDir) | public boolean | sendString(String string) | public boolean | sendUnchangedEntry(CVSRequest request, CVSEntry entry, boolean useUnchanged) | public boolean | sendValidResponses(CVSRequest request, String additional) | public void | setCanceled(boolean can) | public void | setHostName(String hostName) Sets the hostname of the cvs server. | public void | setMultipleInterfaceSupport(boolean flag) Sets the port number of the cvs server. | public void | setPort(int port) Sets the port number of the cvs server. | public void | setReason(String reason) Sets the resaon for the last error. | public void | setTempDirectory(String tempPath) Sets the pathname of the directory in which temporary files are created. | public boolean | verifyHost(String host, SshPublicKey pk) |
DEFAULT_CVS_PORT | final public static int DEFAULT_CVS_PORT(Code) | | |
DEFAULT_DIR_PORT | final public static int DEFAULT_DIR_PORT(Code) | | |
DEFAULT_RSH_PORT | final public static int DEFAULT_RSH_PORT(Code) | | |
DEFAULT_SSH_PORT | final public static int DEFAULT_SSH_PORT(Code) | | |
DEFAULT_TEMP_PATH | final public static String DEFAULT_TEMP_PATH(Code) | | |
TRANSLATE_ASCII | final public static int TRANSLATE_ASCII(Code) | | Used to indicate that a binary file is being transferred.
|
TRANSLATE_NONE | final public static int TRANSLATE_NONE(Code) | | Used to indicate that an ascii file is being transferred.
|
sshClient | SshClient sshClient(Code) | | SSH supporting fields
|
sshSession | SessionChannelClient sshSession(Code) | | |
CVSClient | public CVSClient()(Code) | | Creates a CVS client.
The client is unusable, however, until
the hostname and port number are established.
Parameters: adminDirPath - The pathname of the admin ('CVS') directory. |
CVSClient | public CVSClient(String hostName, int port)(Code) | | Creates a CVS client using the provided hostname and port number.
Parameters: hostName - The hostname of the cvs server. Parameters: port - The port number of the cvs server (typically 2401). |
closeServer | public boolean closeServer()(Code) | | |
getHostName | public String getHostName()(Code) | | Returns the hostname of the cvs server.
|
getMultipleInterfaceSupport | public boolean getMultipleInterfaceSupport()(Code) | | Returns the port number of the cvs server.
|
getPort | public int getPort()(Code) | | Returns the port number of the cvs server.
|
getReason | public String getReason()(Code) | | Returns the reason for the last error.
|
getTempDirectory | public String getTempDirectory()(Code) | | Returns the pathname of the directory in which temporary files are created.
|
isCanceled | public boolean isCanceled()(Code) | | |
isServerOpen | public boolean isServerOpen()(Code) | | Indicates whether or not the connection to the server is established.
|
performRSHProtocol | public boolean performRSHProtocol(String remoteUserName, String serverCommand)(Code) | | |
processCVSRequest | public CVSResponse processCVSRequest(CVSRequest request)(Code) | | This method is the heart of the CVSClient class.
Given a CVSRequest, this method will perform all of the
processing required to open the connection, authenticate,
send all requests, read all responses, and package the
responses into a CVSResponse object, which is returned
as the result of this method. The result is guaranteed
to not be null, and will have its status set to indicate
the status of the reuest. The resulting response object
should be handed into the CVSProject's processCVSResponse()
method to process the server's reponses on the local
project contents.
Parameters: request - The CVSRequest describing our request. |
requestValidRequests | public boolean requestValidRequests(CVSRequest request)(Code) | | |
sendCVSArgument | public boolean sendCVSArgument(String argument)(Code) | | |
sendCVSRootDirectory | public boolean sendCVSRootDirectory(CVSRequest request)(Code) | | |
sendEntriesArguments | public boolean sendEntriesArguments(CVSRequest request)(Code) | | |
sendEntryRepository | public boolean sendEntryRepository(CVSRequest request, CVSEntry entry)(Code) | | This method is used to send the 'Directory' command before
an entry is sent, to set the "context" of the entry (i.e.,
the entry's directory).
Note that jCVS has a peculiarity. We only
send the entries the user has selected in many cases. Thus,
if we refer to a file 'com/ice/cvsc/CVSLog.java', we send
that 'Directory' command, but none for the directories 'com',
and 'ice'. In most cases, this is not an issue, but for a top
level command like Update, this causes entire branches of the
project hierarchy to be skipped because we had not sent the
'Directory' command for that level. To solve this, whenever
we send a 'Directory' command, we send all of the intermediate
levels as well. In order to minimize the redundancy, we keep
a list of what has already been sent in 'this.dirHash'.
Parameters: request - The current request. Parameters: entry - The entry for which to send the command. True if successful, else failure. |
sendFileAscii | public boolean sendFileAscii(CVSEntry entry, File entryFile, boolean gzipFileMode)(Code) | | |
sendFileRaw | public boolean sendFileRaw(CVSEntry entry, File entryFile, boolean useGzipFile)(Code) | | |
sendRootRepository | public boolean sendRootRepository(CVSRequest request)(Code) | | Send the "root" of our repository. Since all of our commands
now work with the assumption that everything is relative to
"./", we need to properly establish 'Directory .' for the
module that we are working with.
|
setCanceled | public void setCanceled(boolean can)(Code) | | |
setHostName | public void setHostName(String hostName)(Code) | | Sets the hostname of the cvs server.
Parameters: hostName - The hostname of the cvs server. |
setMultipleInterfaceSupport | public void setMultipleInterfaceSupport(boolean flag)(Code) | | Sets the port number of the cvs server.
Parameters: port - The port number of the cvs server (typically 2401). |
setPort | public void setPort(int port)(Code) | | Sets the port number of the cvs server.
Parameters: port - The port number of the cvs server (typically 2401). |
setReason | public void setReason(String reason)(Code) | | Sets the resaon for the last error.
Parameters: reason - The string describing the reason. |
setTempDirectory | public void setTempDirectory(String tempPath)(Code) | | Sets the pathname of the directory in which temporary files are created.
Parameters: tempPath - The full pathname of the temporary directory. |
verifyHost | public boolean verifyHost(String host, SshPublicKey pk) throws TransportProtocolException(Code) | | |
|
|