Java Doc for CVSClient.java in  » Source-Control » jcvsweb » com » ice » cvsc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Source Control » jcvsweb » com.ice.cvsc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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


Field Summary
final public static  intDEFAULT_CVS_PORT
    
final public static  intDEFAULT_DIR_PORT
    
final public static  intDEFAULT_RSH_PORT
    
final public static  intDEFAULT_SSH_PORT
    
final public static  StringDEFAULT_TEMP_PATH
    
final public static  StringRCS_ID
    
final public static  StringRCS_REV
    
final public static  intTRANSLATE_ASCII
     Used to indicate that a binary file is being transferred.
final public static  intTRANSLATE_NONE
     Used to indicate that an ascii file is being transferred.
 SshClientsshClient
    
 SessionChannelClientsshSession
    

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  CVSResponsebuildErrorResponse(CVSRequest request, CVSResponse response, String message)
    
public  booleancheckForCancel(CVSResponse response)
    
public  booleancloseServer()
    
public  StringgenerateTempPath()
    
public  StringgetHostName()
     Returns the hostname of the cvs server.
public  booleangetMultipleInterfaceSupport()
     Returns the port number of the cvs server.
public  intgetPort()
     Returns the port number of the cvs server.
public  StringgetReason()
     Returns the reason for the last error.
public  StringgetStickTag(CVSRequest request, String localDir)
    
public  StringgetTempDirectory()
     Returns the pathname of the directory in which temporary files are created.
public  booleanisCanceled()
    
public  booleanisServerOpen()
     Indicates whether or not the connection to the server is established.
public  booleanperformLogin(CVSRequest request)
    
public  booleanperformRSHProtocol(String remoteUserName, String serverCommand)
    
public  CVSResponseprocessCVSRequest(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  CVSResponseprocessCVSRequest(CVSRequest request, CVSResponse response)
    
public  CVSResponsereadAndParseResponse(CVSRequest request, CVSResponse response)
    
public  StringreadAsciiLine(Reader in)
    
public  StringreadLine()
    
public  StringreadResponse()
    
public  booleanrequestValidRequests(CVSRequest request)
    
public  booleanretrieveFile(CVSResponseItem item, File file)
    
public  booleansendArguments(CVSArgumentVector arguments)
    
public  booleansendCVSArgument(String argument)
    
public  booleansendCVSEntries(CVSRequest request)
    
public  booleansendCVSEntry(CVSRequest request, CVSEntry entry, File entryFile)
    
public  booleansendCVSModule(CVSRequest request)
    
public  booleansendCVSRootDirectory(CVSRequest request)
    
public  booleansendEntriesArguments(CVSRequest request)
    
public  booleansendEntryRepository(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  booleansendFileAscii(CVSEntry entry, File entryFile, boolean gzipFileMode)
    
public  booleansendFileContents(InputStream in)
    
public  booleansendFileRaw(CVSEntry entry, File entryFile, boolean useGzipFile)
    
public  booleansendGlobalArguments(CVSArgumentVector arguments)
    
public  booleansendLine(String line)
    
public  booleansendLostEntry(CVSRequest request, CVSEntry entry, boolean useUnchanged)
    
public  booleansendModified(CVSRequest request, CVSEntry entry, File entryFile, boolean empty, int trans)
    
public  booleansendNotifies(CVSRequest request)
    
public  booleansendRootRepository(CVSRequest request)
     Send the "root" of our repository.
public  booleansendSetVariables(CVSRequest request)
    
public  booleansendStatic(CVSRequest request, CVSEntry entry)
    
public  booleansendSticky(CVSRequest request, CVSEntry entry)
    
public  booleansendSticky(CVSRequest request, String localDir)
    
public  booleansendString(String string)
    
public  booleansendUnchangedEntry(CVSRequest request, CVSEntry entry, boolean useUnchanged)
    
public  booleansendValidResponses(CVSRequest request, String additional)
    
public  voidsetCanceled(boolean can)
    
public  voidsetHostName(String hostName)
     Sets the hostname of the cvs server.
public  voidsetMultipleInterfaceSupport(boolean flag)
     Sets the port number of the cvs server.
public  voidsetPort(int port)
     Sets the port number of the cvs server.
public  voidsetReason(String reason)
     Sets the resaon for the last error.
public  voidsetTempDirectory(String tempPath)
     Sets the pathname of the directory in which temporary files are created.
public  booleanverifyHost(String host, SshPublicKey pk)
    

Field Detail
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)



RCS_ID
final public static String RCS_ID(Code)



RCS_REV
final public static String RCS_REV(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)




Constructor Detail
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).




Method Detail
buildErrorResponse
public CVSResponse buildErrorResponse(CVSRequest request, CVSResponse response, String message)(Code)



checkForCancel
public boolean checkForCancel(CVSResponse response)(Code)



closeServer
public boolean closeServer()(Code)



generateTempPath
public String generateTempPath()(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.



getStickTag
public String getStickTag(CVSRequest request, String localDir)(Code)



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.



performLogin
public boolean performLogin(CVSRequest request)(Code)



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.



processCVSRequest
public CVSResponse processCVSRequest(CVSRequest request, CVSResponse response)(Code)



readAndParseResponse
public CVSResponse readAndParseResponse(CVSRequest request, CVSResponse response)(Code)



readAsciiLine
public String readAsciiLine(Reader in)(Code)



readLine
public String readLine()(Code)



readResponse
public String readResponse()(Code)



requestValidRequests
public boolean requestValidRequests(CVSRequest request)(Code)



retrieveFile
public boolean retrieveFile(CVSResponseItem item, File file)(Code)



sendArguments
public boolean sendArguments(CVSArgumentVector arguments)(Code)



sendCVSArgument
public boolean sendCVSArgument(String argument)(Code)



sendCVSEntries
public boolean sendCVSEntries(CVSRequest request)(Code)



sendCVSEntry
public boolean sendCVSEntry(CVSRequest request, CVSEntry entry, File entryFile)(Code)



sendCVSModule
public boolean sendCVSModule(CVSRequest request)(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)



sendFileContents
public boolean sendFileContents(InputStream in)(Code)



sendFileRaw
public boolean sendFileRaw(CVSEntry entry, File entryFile, boolean useGzipFile)(Code)



sendGlobalArguments
public boolean sendGlobalArguments(CVSArgumentVector arguments)(Code)



sendLine
public boolean sendLine(String line)(Code)



sendLostEntry
public boolean sendLostEntry(CVSRequest request, CVSEntry entry, boolean useUnchanged)(Code)



sendModified
public boolean sendModified(CVSRequest request, CVSEntry entry, File entryFile, boolean empty, int trans)(Code)



sendNotifies
public boolean sendNotifies(CVSRequest request)(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.



sendSetVariables
public boolean sendSetVariables(CVSRequest request)(Code)



sendStatic
public boolean sendStatic(CVSRequest request, CVSEntry entry)(Code)



sendSticky
public boolean sendSticky(CVSRequest request, CVSEntry entry)(Code)



sendSticky
public boolean sendSticky(CVSRequest request, String localDir)(Code)



sendString
public boolean sendString(String string)(Code)



sendUnchangedEntry
public boolean sendUnchangedEntry(CVSRequest request, CVSEntry entry, boolean useUnchanged)(Code)



sendValidResponses
public boolean sendValidResponses(CVSRequest request, String additional)(Code)



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)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.